This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shares with strange ACL settings


On Aug 12 15:50, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > I don't know what to do about this.  We're talking back and forth
> > about reflecting group perms into user perms and whether we do it
> > or not, it always seems to have some downside on some installations.
> 
> Since there are fundamental differences between how Windows evaluates ACL
> vs. what POSIX expects this problem isn't going away anytime soon. 
> Depending on how much control you have over the default or inherited ACL you
> can pretend these differences are non-existing with varying degrees of
> success.  Another fly in that ointment are the Backup/Restore privileges,
> but these you can control if you are aware of them.

Cygwin is aware of them and access(2) explicitely checks for them.  That
obviously doesn't help for applications like perl, who "know better"
than the underlying OS how to evaluate perms.

> > > So, it would probably help if I had a mount option to force the ownership to
> > > some account that I am never logged in as, either via a mount option or
> > > whenever the POSIX user modes are all cleared.  I don't know if that might
> > > confuse applications when they check ownership on newly created files,
> > > though.  Is that something that is implementable easily so it could be
> > > tested via a snapshot?
> > 
> > I'm not sure I understand the idea of mounting w/ an explicit user account
> > and how this might help.  What about just using the noacl mount option
> > for weird shares like the above?
> 
> That mount option would ensure that the ACL are actually consulted by a
> POSIX application when the user mode bits are all cleared since the file
> would appear not to be owned by the (E)UID.  The only other option I can see
> would be to augment stat to traverse the DACL when both these conditions are
> met: the file is owned by the (E)UID of the calling process and the user
> mode bits are all cleared.  That is, do the faccessat on behalf of the
> application that it would otherwise (likely) do if the file was _not_ owned
> by the user.  Of course you can't really know why stat was called and that
> might impact perfromance quite noticeably.

It does.  Another, *very* simple idea is this:  Spill the group and
other perms into the user bits only if the owner of the file is the
current user.  Would that help?

> As to "why not use the noacl option", that makes the file mode tests
> completely useless and requires more elaborate error handling that would
> otherwise not be necessary.  Some users and scripts they have written are
> not prepared for that extra complication.

But there's no additional checking necessary because the perms are
guarded by the OS anyway.  The applications just don't know them exactly.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpJMwzMc4tJW.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]