The Samba-Bugzilla – Bug 4138
Incoming chmod can't override inherited directory setgid
Last modified: 2006-10-15 13:26:36 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.
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).