Bug 4138 - Incoming chmod can't override inherited directory setgid
Summary: Incoming chmod can't override inherited directory setgid
Status: CLOSED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.9
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-30 11:41 UTC by Matt McCutchen
Modified: 2006-10-15 13:26 UTC (History)
0 users

See Also:


Attachments

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).