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
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);