Bug 4707 - knfsd has problems with exporting setgid on directories
Summary: knfsd has problems with exporting setgid on directories
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: nfs-utils
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-08-25 19:22 UTC by George Karabin
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-15 04:28:01 UTC
Embargoed:


Attachments (Terms of Use)

Description George Karabin 1999-08-25 19:22:14 UTC
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
client.

gnome and enlightenment appear to install these directories
with the following permissions:

drwx--S---

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

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.
/usr/src/linux/Documentation/mandatory.txt

It is not setgid if group has no execute permissions but
file (directory in this case) is marked to have mandatory locks
applied.

Comment 1 George Karabin 1999-08-26 17:34:59 UTC
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.

Comment 2 Cristian Gafton 2000-08-09 02:36:23 UTC
assigned to johnsonm


Note You need to log in before you can comment on or make changes to this bug.