lkml.org 
[lkml]   [2007]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectnfsd bug: create file with specific uid/gid
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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-30 18:15    [W:0.060 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site