Commit 128cf584 authored by David Dykstra's avatar David Dykstra

When writing to a daemon with read only = false and uid = root and -g,

was not preserving group permisions.  Bug was introduced March 1 in
version 1.100 of rsync.c with an error in re-ordering of the boolean
expressions.  In order to completely preserve the earlier semantics,
change_gid should depend on "(am_root || !am_daemon)", but I don't see why
group ownership should behave differently in a non-root daemon.
parent 7e0ca8e2
...@@ -179,7 +179,7 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, ...@@ -179,7 +179,7 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
} }
change_uid = am_root && preserve_uid && st->st_uid != file->uid; change_uid = am_root && preserve_uid && st->st_uid != file->uid;
change_gid = !am_daemon && preserve_gid && file->gid != (gid_t) -1 && \ change_gid = preserve_gid && file->gid != (gid_t) -1 && \
st->st_gid != file->gid; st->st_gid != file->gid;
if (change_gid && !am_root) { if (change_gid && !am_root) {
/* enforce bsd-style group semantics: non-root can only /* enforce bsd-style group semantics: non-root can only
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment