Last active
December 17, 2015 14:39
-
-
Save r10r/5626346 to your computer and use it in GitHub Desktop.
Do not set xattrs for symlinks on OSX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/rsync.c b/rsync.c | |
index b040a67..d6abae4 100644 | |
--- a/rsync.c | |
+++ b/rsync.c | |
@@ -496,16 +496,22 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, | |
#endif | |
#ifdef SUPPORT_XATTRS | |
- if (am_root < 0) | |
- set_stat_xattr(fname, file, new_mode); | |
- if (preserve_xattrs && fnamecmp) { | |
- uint32 tmpflags = sxp->st.st_flags; | |
- sxp->st.st_flags = F_FFLAGS(file); /* set_xattr() needs to check UF_COMPRESSED */ | |
- set_xattr(fname, file, fnamecmp, sxp); | |
- sxp->st.st_flags = tmpflags; | |
- if (S_ISDIR(sxp->st.st_mode)) | |
- link_stat(fname, &sx2.st, 0); | |
- } | |
+#ifdef HAVE_OSX_XATTRS | |
+ if (!S_ISLNK(file->mode)) { | |
+#endif | |
+ if (am_root < 0) | |
+ set_stat_xattr(fname, file, new_mode); | |
+ if (preserve_xattrs && fnamecmp) { | |
+ uint32 tmpflags = sxp->st.st_flags; | |
+ sxp->st.st_flags = F_FFLAGS(file); /* set_xattr() needs to check UF_COMPRESSED */ | |
+ set_xattr(fname, file, fnamecmp, sxp); | |
+ sxp->st.st_flags = tmpflags; | |
+ if (S_ISDIR(sxp->st.st_mode)) | |
+ link_stat(fname, &sx2.st, 0); | |
+ } | |
+#ifdef HAVE_OSX_XATTRS | |
+ } | |
+#endif | |
#endif | |
if (!preserve_times |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment