summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5223b78)
value. Also fixed the removal of rsync-internal xattr values on the
destination files when we aren't copying rsync-internal xattr values.
+ if (daemon_chmod_modes && !S_ISLNK(new_mode))
+ new_mode = tweak_mode(new_mode, daemon_chmod_modes);
+
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode) && !ACL_READY(*sxp))
get_acl(fname, sxp);
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode) && !ACL_READY(*sxp))
get_acl(fname, sxp);
if (preserve_xattrs && fnamecmp)
set_xattr(fname, file, fnamecmp, sxp);
if (am_root < 0)
if (preserve_xattrs && fnamecmp)
set_xattr(fname, file, fnamecmp, sxp);
if (am_root < 0)
- set_stat_xattr(fname, file);
+ set_stat_xattr(fname, file, new_mode);
#endif
if (!preserve_times || (S_ISDIR(sxp->st.st_mode) && preserve_times == 1))
#endif
if (!preserve_times || (S_ISDIR(sxp->st.st_mode) && preserve_times == 1))
- if (daemon_chmod_modes && !S_ISLNK(new_mode))
- new_mode = tweak_mode(new_mode, daemon_chmod_modes);
-
#ifdef SUPPORT_ACLS
/* It's OK to call set_acl() now, even for a dir, as the generator
* will enable owner-writability using chmod, if necessary.
#ifdef SUPPORT_ACLS
/* It's OK to call set_acl() now, even for a dir, as the generator
* will enable owner-writability using chmod, if necessary.
#endif
/* No rsync.%FOO attributes are copied w/o 2 -X options. */
#endif
/* No rsync.%FOO attributes are copied w/o 2 -X options. */
- if (preserve_xattrs < 2 && name_len > RPRE_LEN
+ if (am_sender && preserve_xattrs < 2 && name_len > RPRE_LEN
&& name[RPRE_LEN] == '%' && HAS_PREFIX(name, RSYNC_PREFIX))
continue;
&& name[RPRE_LEN] == '%' && HAS_PREFIX(name, RSYNC_PREFIX))
continue;
* any needed xattrs with a flag that lets us know they need to be sent to
* the receiver. When called by the receiver, reads the sent data and
* stores it in place of its checksum. */
* any needed xattrs with a flag that lets us know they need to be sent to
* the receiver. When called by the receiver, reads the sent data and
* stores it in place of its checksum. */
-void recv_xattr_request(struct file_struct *file, int f_in)
+int recv_xattr_request(struct file_struct *file, int f_in)
{
item_list *lst = rsync_xal_l.items;
char *old_datum, *name;
rsync_xa *rxa;
{
item_list *lst = rsync_xal_l.items;
char *old_datum, *name;
rsync_xa *rxa;
+ int rel_pos, cnt, got_xattr_data = 0;
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
rxa->name = name;
free(old_datum);
read_buf(f_in, rxa->datum, rxa->datum_len);
rxa->name = name;
free(old_datum);
read_buf(f_in, rxa->datum, rxa->datum_len);
+
+ return got_xattr_data;
}
/* ------------------------------------------------------------------------- */
}
/* ------------------------------------------------------------------------- */
: !HAS_PREFIX(name, USER_PREFIX))
continue;
#endif
: !HAS_PREFIX(name, USER_PREFIX))
continue;
#endif
+ if (am_root < 0 && name_len > RPRE_LEN
+ && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0)
+ continue;
for (i = 0; i < xalp->count; i++) {
if (strcmp(name, rxas[i].name) == 0)
for (i = 0; i < xalp->count; i++) {
if (strcmp(name, rxas[i].name) == 0)
-int set_stat_xattr(const char *fname, struct file_struct *file)
+int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
{
STRUCT_STAT fst, xst;
dev_t rdev;
{
STRUCT_STAT fst, xst;
dev_t rdev;
}
fst.st_mode &= (_S_IFMT | CHMOD_BITS);
}
fst.st_mode &= (_S_IFMT | CHMOD_BITS);
- fmode = file->mode & (_S_IFMT | CHMOD_BITS);
+ fmode = new_mode & (_S_IFMT | CHMOD_BITS);
if (IS_DEVICE(fmode) || IS_SPECIAL(fmode)) {
uint32 *devp = F_RDEV_P(file);
if (IS_DEVICE(fmode) || IS_SPECIAL(fmode)) {
uint32 *devp = F_RDEV_P(file);