PATCH: fileflags fixes (was Re: congrats!)

Wayne Davison wayned at samba.org
Sun Mar 2 15:23:29 GMT 2008


On Sat, Mar 01, 2008 at 06:10:21PM -0500, Robert DuToit wrote:
> Verifying:            bsd-flags ... FAIL
> Verifying:                 fifo ... FAIL
> Verifying:              devices ... FAIL

I'm attaching a patch that adds the *_APPEND changes I mentioned and
also a fix for the sending of devices and special files.

..wayne..
-------------- next part --------------
--- a/rsync.h
+++ b/rsync.h
@@ -469,8 +469,8 @@ typedef unsigned int size_t;
 #ifndef SF_NOUNLINK
 #define SF_NOUNLINK 0
 #endif
-#define USR_IMMUTABLE (UF_IMMUTABLE|UF_NOUNLINK)
-#define SYS_IMMUTABLE (SF_IMMUTABLE|SF_NOUNLINK)
+#define USR_IMMUTABLE (UF_IMMUTABLE|UF_NOUNLINK|UF_APPEND)
+#define SYS_IMMUTABLE (SF_IMMUTABLE|SF_NOUNLINK|SF_APPEND)
 #define ALL_IMMUTABLE (USR_IMMUTABLE|SYS_IMMUTABLE)
 #define ST_FLAGS(st) (st.st_flags)
 #else
--- a/xattrs.c
+++ b/xattrs.c
@@ -282,6 +282,10 @@ int get_xattr(const char *fname, stat_x *sxp)
 {
 	sxp->xattr = new(item_list);
 	*sxp->xattr = empty_xattr;
+
+	if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode))
+		return 0;
+
 	if (rsync_xal_get(fname, sxp->xattr) < 0) {
 		free_xattr(sxp);
 		return -1;
@@ -799,6 +803,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
 		return -1;
 	}
 
+	if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode)) {
+		errno = ENOTSUP;
+		return -1;
+	}
+
 	ndx = F_XATTR(file);
 	return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
 }


More information about the rsync mailing list