Red Hat Bugzilla – Bug 4707
knfsd has problems with exporting setgid on directories
Last modified: 2008-05-01 11:37:51 EDT
We recently installed a new file server on our network,
running a fresh RH 6.0 install on a raid filesystem. We used
the release 2.2.5 SMP kernel and the released knfsd to set
up an NFS exported partition, and noticed problems deleting
the ~/.gnome and ~/.enlightenment directories of an NFS
gnome and enlightenment appear to install these directories
with the following permissions:
From the client:rm -rf ~/.enlightenment would fail to delete
the directory (which is nfs mounted from the NFS server
running RH6, described above). However, if we used chmod g-s
~/.enlightenment from the client, we could delete the
To be sure that we wer seeing someting reproducible, from
the client we did 'mkdir ~/foo; chmod 700 ~/foo; chmod g+s
~/foo; rm -rf ~/foo' and got the same problem.
Finally, we noticed some other strangeness, like if we
created a directory with these weird permissions, and used
'touch ~/foo/foobar' to create an empty file, 'ls ~/foo'
would NOT list foobar! Stranger still, 'rm ~/foo/foobar'
would then delete foobar, even though ls didn't see it.
We then duplicated the test on a FreeBSD NFS server running
on the network, and saw no problems. We may yet try the user
space NFS server.
As an aside, the other thing about KNFSD that really bothers
us is that file handles aren't preserved when the server
reboots. I recall from an earlier stint with user space nfsd
that it could handle this. It would be nice to have RPMS
available for user space NFS with the Red Hat distribution.
------- Additional Comments From 08/26/99 01:28 -------
this looks like mandatory locking stuff.
It is not setgid if group has no execute permissions but
file (directory in this case) is marked to have mandatory locks
OK - that makes sense. I didn't know about that locking mechanism.
Still, the knfsd server doesn't appear to be handling the locks
properly, or at least not the same as a locally mounted disk, from
what I can see.
The description of the problem I gave yesterday was pretty lame.
Here's a more understandable problem description:
Machine A: /vol1 is local, /vol2 is NFS mounted from B:/vol2
Machine B: exports /vol2 via knfsd
From machine A: 'mkdir /vol1/foo /vol2/foo; chmod 2700 /vol1/foo
/vol2/foo' . 'rm -rf /vol1/foo' works, but 'rm -rf /vol2/foo' fails.
I'd think that the locking should behave the same way whether the disk
is local or NFS mounted.
Likewise, the behavior with 'touch foobar' in /vol1/foo/ and
/vol2/foo/ is different when the lock is on.
assigned to johnsonm