linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nfsd bug: create file with specific uid/gid
@ 2007-11-30 17:06 Roger Willcocks
  2007-11-30 22:01 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Willcocks @ 2007-11-30 17:06 UTC (permalink / raw)
  To: linux-kernel

nfsd/vfs.c:nfsd_create (the v2 version of create) says:

"Set file attributes. Mode has already been set and
setting uid/gid works only for root"

but it doesn't actually test for root-ness (which could happen if the 
access is no-root-squash). There's similar code without the comment in 
nfsd_create_v3. In both cases the test:

    if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID|ATTR_MODE)) != 0)

should read:

    if (current->fsuid != 0)
        iap->ia_valid &= ~(ATTR_UID|ATTR_GID);
    if ((iap->ia_valid &= ~ATTR_MODE) != 0)

although arguably they should return an EPERM error if the uid/gid bits 
are set, instead of silently ignoring them.

--
Roger



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

end of thread, other threads:[~2007-12-03 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-30 17:06 nfsd bug: create file with specific uid/gid Roger Willcocks
2007-11-30 22:01 ` J. Bruce Fields
2007-12-01 11:36   ` Roger Willcocks
2007-12-03 16:17     ` J. Bruce Fields

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