X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/aa3faf5f8c2a05110bb1f39fd8d0742d5ca0431e..6500e0769a56919df1d47759828104a08df850bb:/xattrs.c diff --git a/xattrs.c b/xattrs.c index df1a2a1c..3a7cb25b 100644 --- a/xattrs.c +++ b/xattrs.c @@ -33,6 +33,9 @@ extern int am_generator; extern int read_only; extern int list_only; extern int preserve_xattrs; +extern int preserve_links; +extern int preserve_devices; +extern int preserve_specials; extern int checksum_seed; #define RSYNC_XAL_INITIAL 5 @@ -285,18 +288,24 @@ int get_xattr(const char *fname, stat_x *sxp) sxp->xattr = new(item_list); *sxp->xattr = empty_xattr; -#ifdef NO_SPECIAL_XATTRS - if (IS_SPECIAL(sxp->st.st_mode)) - return 0; + if (S_ISREG(sxp->st.st_mode) || S_ISDIR(sxp->st.st_mode)) { + /* Everyone supports this. */ + } else if (S_ISLNK(sxp->st.st_mode)) { +#ifndef NO_SYMLINK_XATTRS + if (!preserve_links) #endif -#ifdef NO_DEVICE_XATTRS - if (IS_DEVICE(sxp->st.st_mode)) - return 0; + return 0; + } else if (IS_SPECIAL(sxp->st.st_mode)) { +#ifndef NO_SPECIAL_XATTRS + if (!preserve_specials) #endif -#ifdef NO_SYMLINK_XATTRS - if (S_ISLNK(sxp->st.st_mode)) - return 0; + return 0; + } else if (IS_DEVICE(sxp->st.st_mode)) { +#ifndef NO_DEVICE_XATTRS + if (!preserve_devices) #endif + return 0; + } if (rsync_xal_get(fname, sxp->xattr) < 0) { free_xattr(sxp);