X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6283e9ef43dcea5843a12604e27f6b26ef93682d..6d56efa6ea66afa2e6f4eb79d9dd5f3b54b723c3:/xattrs.c diff --git a/xattrs.c b/xattrs.c index b2040f26..051c08d9 100644 --- a/xattrs.c +++ b/xattrs.c @@ -114,7 +114,7 @@ static int rsync_xal_compare_names(const void *x1, const void *x2) static ssize_t get_xattr_names(const char *fname) { ssize_t list_len; - double arg; + int64 arg; if (!namebuf) { namebuf_len = 1024; @@ -132,11 +132,11 @@ static ssize_t get_xattr_names(const char *fname) } else if (errno == ENOTSUP) return 0; else if (errno != ERANGE) { - arg = (double)namebuf_len; + arg = namebuf_len; got_error: rsyserr(FERROR_XFER, errno, - "get_xattr_names: llistxattr(\"%s\",%.0f) failed", - fname, arg); + "get_xattr_names: llistxattr(\"%s\",%s) failed", + fname, big_num(arg, 0)); return -1; } list_len = sys_llistxattr(fname, NULL, 0); @@ -294,7 +294,7 @@ int copy_xattrs(const char *source, const char *dest) size_t datum_len; char *name, *ptr; #ifdef HAVE_LINUX_XATTRS - int user_only = am_sender ? 0 : !am_root; + int user_only = am_sender ? 0 : am_root <= 0; #endif /* This puts the name list into the "namebuf" buffer. */ @@ -591,8 +591,8 @@ int recv_xattr_request(struct file_struct *file, int f_in) exit_cleanup(RERR_STREAMIO); } if (!XATTR_ABBREV(*rxa) || rxa->datum[0] != XSTATE_ABBREV) { - rprintf(FERROR, "[%s] internal abbrev error on %s (%s, len=%d)!\n", - who_am_i(), f_name(file, NULL), rxa->name, rxa->datum_len); + rprintf(FERROR, "[%s] internal abbrev error on %s (%s, len=%ld)!\n", + who_am_i(), f_name(file, NULL), rxa->name, (long)rxa->datum_len); exit_cleanup(RERR_STREAMIO); } @@ -745,6 +745,9 @@ static int rsync_xal_set(const char *fname, item_list *xalp, ssize_t list_len; size_t i, len; char *name, *ptr, sum[MAX_DIGEST_LEN]; +#ifdef HAVE_LINUX_XATTRS + int user_only = am_root <= 0; +#endif size_t name_len; int ret = 0; @@ -820,8 +823,8 @@ static int rsync_xal_set(const char *fname, item_list *xalp, #ifdef HAVE_LINUX_XATTRS /* We always ignore the system namespace, and non-root * ignores everything but the user namespace. */ - if (am_root ? HAS_PREFIX(name, SYSTEM_PREFIX) - : !HAS_PREFIX(name, USER_PREFIX)) + if (user_only ? !HAS_PREFIX(name, USER_PREFIX) + : HAS_PREFIX(name, SYSTEM_PREFIX)) continue; #endif if (am_root < 0 && name_len > RPRE_LEN