int len, iflags = 0;
struct file_list *flist;
uchar fnamecmp_type = FNAMECMP_FNAME;
- int verbose_save, ndx;
+ int ndx;
read_loop:
while (1) {
NDX_FLIST_OFFSET - dir_flist->count);
exit_cleanup(RERR_PROTOCOL);
}
- verbose_save = verbose;
- verbose = 0; /* TODO allow verbose messages? */
/* Send everything read from f_in to msg_fd_out. */
send_msg_int(MSG_FLIST, ndx);
flist = recv_file_list(f_in);
flist->parent_ndx = ndx;
stop_flist_forward();
-
- verbose = verbose_save;
}
iflags = protocol_version >= 29 ? read_shortint(f_in)
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && fnamecmp)
set_xattr(fname, file, fnamecmp, sxp);
+ if (am_root < 0)
+ set_stat_xattr(fname, file);
#endif
if (!preserve_times || (S_ISDIR(sxp->st.st_mode) && omit_dir_times))
(long)sxp->st.st_gid, (long)F_GID(file));
}
}
- if (do_lchown(fname,
+ if (am_root < 0) {
+ ;
+ } else if (do_lchown(fname,
change_uid ? F_UID(file) : sxp->st.st_uid,
change_gid ? F_GID(file) : sxp->st.st_gid) != 0) {
/* shouldn't have attempted to change uid or gid
change_uid ? "chown" : "chgrp",
full_fname(fname));
goto cleanup;
- }
+ } else
/* a lchown had been done - we have to re-stat if the
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
#ifdef HAVE_CHMOD
if (!BITS_EQUAL(sxp->st.st_mode, new_mode, CHMOD_BITS)) {
- int ret = do_chmod(fname, new_mode);
+ int ret = am_root < 0 ? 0 : do_chmod(fname, new_mode);
if (ret < 0) {
rsyserr(FERROR, errno,
"failed to set permissions on %s",