From: Wayne Davison Date: Sat, 24 May 2008 16:56:44 +0000 (-0700) Subject: Fixed the device/special discarding in get_xattr(). X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/07bbd4a4cc7d89a5cd17d0b680c0be6dac6e1589 Fixed the device/special discarding in get_xattr(). --- diff --git a/fileflags.diff b/fileflags.diff index f3acbf4..17eb0c0 100644 --- a/fileflags.diff +++ b/fileflags.diff @@ -164,6 +164,14 @@ diff --git a/flist.c b/flist.c if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */ F_OWNER(file) = st.st_uid; if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */ +@@ -1342,6 +1373,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist, + #endif + #ifdef SUPPORT_XATTRS + if (preserve_xattrs) { ++ sx.st.st_mode = file->mode; + sx.xattr = NULL; + if (get_xattr(fname, &sx) < 0) + return NULL; diff --git a/generator.c b/generator.c --- a/generator.c +++ b/generator.c @@ -239,7 +247,7 @@ diff --git a/generator.c b/generator.c #ifdef SUPPORT_ACLS if (preserve_acls && !S_ISLNK(file->mode)) { if (!ACL_READY(*sxp)) -@@ -1426,6 +1449,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1429,6 +1452,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, file->mode = dest_mode(file->mode, sx.st.st_mode, dflt_perms, statret == 0); } @@ -250,7 +258,7 @@ diff --git a/generator.c b/generator.c if (statret != 0 && basis_dir[0] != NULL) { int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx, itemizing, code); -@@ -1461,10 +1488,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1464,10 +1491,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, /* We need to ensure that the dirs in the transfer have writable * permissions during the time we are putting files within them. * This is then fixed after the transfer is done. */ @@ -267,7 +275,7 @@ diff --git a/generator.c b/generator.c rsyserr(FERROR_XFER, errno, "failed to modify permissions on %s", full_fname(fname)); -@@ -1499,6 +1531,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1502,6 +1534,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, file->mode = dest_mode(file->mode, sx.st.st_mode, dflt_perms, exists); } @@ -278,7 +286,7 @@ diff --git a/generator.c b/generator.c #ifdef SUPPORT_HARD_LINKS if (preserve_hard_links && F_HLINK_NOT_FIRST(file) -@@ -2024,13 +2060,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx) +@@ -2028,13 +2064,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx) continue; fname = f_name(file, NULL); if (!(file->mode & S_IWUSR)) @@ -534,7 +542,7 @@ diff --git a/rsync.c b/rsync.c if (verbose > 1 && flags & ATTRS_REPORT) { if (updated) rprintf(FCLIENT, "%s\n", fname); -@@ -569,7 +617,8 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -570,7 +618,8 @@ int finish_transfer(const char *fname, const char *fnametmp, /* Change permissions before putting the file into place. */ set_file_attrs(fnametmp, file, NULL, fnamecmp, @@ -544,7 +552,7 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) -@@ -588,6 +637,10 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -589,6 +638,10 @@ int finish_transfer(const char *fname, const char *fnametmp, } if (ret == 0) { /* The file was moved into place (not copied), so it's done. */