diff options
author | Wayne Davison <wayned@samba.org> | 2008-06-08 21:07:30 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-06-08 21:14:46 -0700 |
commit | 6283e9ef43dcea5843a12604e27f6b26ef93682d (patch) | |
tree | c1272b7627de1eec53eb4d7b99fd23c313f009b5 /xattrs.c | |
parent | 7462c6ac39d86cb8252ec47246569e3ddda35b6a (diff) | |
download | rsync-6283e9ef43dcea5843a12604e27f6b26ef93682d.tar.gz |
A couple more xattr improvements:
- Made the XSTATE_* defines avoid using 0.
- Call !XATTR_ABBREV() in recv_xattr_request().
- Improved the "internal abbrev" error message.
- Fixed the potential for a directory time glitch in xattrs.diff.
Diffstat (limited to 'xattrs.c')
-rw-r--r-- | xattrs.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -44,9 +44,9 @@ extern int checksum_seed; #define XATTR_ABBREV(x) ((size_t)((x).name - (x).datum) < (x).datum_len) -#define XSTATE_ABBREV 0 -#define XSTATE_DONE 1 -#define XSTATE_TODO 2 +#define XSTATE_ABBREV 1 +#define XSTATE_DONE 2 +#define XSTATE_TODO 3 #define USER_PREFIX "user." #define UPRE_LEN ((int)sizeof USER_PREFIX - 1) @@ -590,8 +590,9 @@ int recv_xattr_request(struct file_struct *file, int f_in) who_am_i(), num, f_name(file, NULL)); exit_cleanup(RERR_STREAMIO); } - if (rxa->datum_len <= MAX_FULL_DATUM || rxa->datum[0] != XSTATE_ABBREV) { - rprintf(FERROR, "[%s] internal abbrev error!\n", who_am_i()); + if (!XATTR_ABBREV(*rxa) || rxa->datum[0] != XSTATE_ABBREV) { + rprintf(FERROR, "[%s] internal abbrev error on %s (%s, len=%d)!\n", + who_am_i(), f_name(file, NULL), rxa->name, rxa->datum_len); exit_cleanup(RERR_STREAMIO); } |