linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* setfsuid() and access() syscall
@ 2009-08-04 20:55 Ondrej Palkovsky
  2009-08-04 21:29 ` Matthew Wilcox
  2009-08-04 21:53 ` Serge E. Hallyn
  0 siblings, 2 replies; 4+ messages in thread
From: Ondrej Palkovsky @ 2009-08-04 20:55 UTC (permalink / raw)
  To: linux-fsdevel

Hello,

the access() syscall (to find out if the user has permission to do 
something on file) does not seem to reflect the setfsuid() syscall. 
There are 2 conflicting pieces of information:

- kernel/sys.c:
/*
 * "setfsuid()" sets the fsuid - the uid used for filesystem checks. This
 * is used for "access()" and for the NFS daemon (letting nfsd stay at
 * whatever uid it wants to). It normally shadows "euid", except when
 * explicitly set by setfsuid() or for access..
 */
- fs/namei.c
/*
 * access() needs to use the real uid/gid, not the effective uid/gid.
 * We do this by temporarily clearing all FS-related capabilities and
 * switching the fsuid/fsgid around to the real ones.
 */

The resulting behaviour (2.6.18, 2.6.28, source code for 2.6.30 seems to 
be the same) seems to be that access() is dependent on uid, not fsuid - 
this seems to me to be a bug, which unfortunately somewhat inhibits 
multithreaded file servers that want to use access() e.g. for ACL 
checks. Is there some reason why it is implemented the way it is as it 
looks like an intention?

Best regards
Ondrej Palkovsky


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-05  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-04 20:55 setfsuid() and access() syscall Ondrej Palkovsky
2009-08-04 21:29 ` Matthew Wilcox
2009-08-05  7:57   ` Ondrej Palkovsky
2009-08-04 21:53 ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).