am I missing something, or are permissions always preserved?

Ben bench at
Wed Jan 1 22:24:22 EST 2003

I'm not sure what POSIX calls for, but on both Linux and AIX (the two
unix OSes I have access to) I can leave off the mode arg when calling
open(2). Granted, doing so gives me a mode that normally isn't so good,
but in my case this would be fine, as I have samba forcing modes to be
what I want them to be.

However, after looking into this more, it turns out that samba
apparently causes chmod(2) to fail _only_ when trying to set modes
S_ISUID, S_ISGID, or S_ISVTX. Trying to set these modes in open(2), or
trying to set any other modes in open(2) or chmod(2), silently fails
without raising an error.

So while this might well be a samba problem, it could be avoided if
rsync behaved as I would expect it to. The original files do indeed have
S_ISGUID set on them, but I don't see why rsync should try to preserve
this if I didn't tell it to preserve permissions.

On Wed, 2003-01-01 at 07:13, Green, Paul wrote:
> Ben [mailto:bench at]
> > I'm relatively new to rsync, but it seems to me that if there's an
> > option to perserve permissions and you don't set it, then rsync
> > shouldn't do anything with permissions.
> Sounds good, but recall how POSIX / Unix system calls work. To create a
> file, you have to specify what mode (permission) it should have.  There is
> no way to tell creat() or open() to "do the default thing."
> I think a case could be made that this is a defect / incompatibility in the
> underlying file system layer that issues complaints about permissions.
> Before I attempted to code any kind of a fix, I'd sure want to read the
> specs of this layer and understand how the designers thought this problem
> should be approached.
> Thanks
> PG
> --
> Paul Green, Senior Technical Consultant, Stratus Computer, Inc.
> Voice: +1 978-461-7557; FAX: +1 978-461-3610; Video on request.
> Speaking from Stratus not for Stratus

More information about the rsync mailing list