*
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
void win_error(void *jcr, char *prefix, POOLMEM *ofile);
#endif
+/* For old systems that don't have lchown() use chown() */
+#ifndef HAVE_LCHOWN
+#define lchown chown
+#endif
/*=============================================================*/
/* */
/* Encode a stat structure into a base64 character string */
-void encode_stat(char *buf, struct stat *statp)
+void encode_stat(char *buf, struct stat *statp, uint32_t LinkFI)
{
char *p = buf;
/*
p += to_base64((int64_t)statp->st_mtime, p);
*p++ = ' ';
p += to_base64((int64_t)statp->st_ctime, p);
+ *p++ = ' ';
+ p += to_base64((int64_t)LinkFI, p);
*p = 0;
return;
}
/* Decode a stat packet from base64 characters */
void
-decode_stat(char *buf, struct stat *statp)
+decode_stat(char *buf, struct stat *statp, uint32_t *LinkFI)
{
char *p = buf;
int64_t val;
p++;
p += from_base64(&val, p);
statp->st_ctime = val;
+ /* Optional FileIndex of hard linked file data */
+ if (*p == ' ' || (*p != 0 && *(p+1) == ' ')) {
+ p++;
+ p += from_base64(&val, p);
+ *LinkFI = (uint32_t)val;
+ } else {
+ *LinkFI = 0;
+ }
}
/*
void unix_name_to_win32(POOLMEM **win32_name, char *name)
{
- /* One extra byte should suffice, but we take 10 */
- *win32_name = check_pool_memory_size(*win32_name, strlen(name)+10);
+ /* One extra byte should suffice, but we double it */
+ *win32_name = check_pool_memory_size(*win32_name, 2*strlen(name)+1);
cygwin_conv_to_win32_path(name, *win32_name);
}