Bug 4138 - Incoming chmod can't override inherited directory setgid
Incoming chmod can't override inherited directory setgid
Product: rsync
Classification: Unclassified
Component: core
All All
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2006-09-30 11:41 UTC by Matt McCutchen
Modified: 2006-10-15 13:26 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen 2006-09-30 11:41:35 UTC
[I mentioned this on the mailing list but nothing happened.  I'm entering it in Bugzilla so it won't be forgotten.]

When --perms is off, an incoming chmod of "Dg-s" does not prevent new directories on the receiver from inheriting setgid bits; it probably should.  Incoming chmod currently takes effect in dest_mode, which is too soon for it to affect the directory setgid check in set_file_attrs.

To avoid further bugs of this nature, I propose that incoming chmod
should take effect right before the actual call to chmod in
set_file_attrs, as rsyncd-perm once did.
Comment 1 Wayne Davison 2006-10-08 17:03:17 UTC
I checked-in a fix that moves where the "incoming chmod" rules tweak the file's mode (so that it happens at the last moment prior to setting the file's permissions).