Bug 4707 - knfsd has problems with exporting setgid on directories
knfsd has problems with exporting setgid on directories
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: nfs-utils (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-08-25 15:22 EDT by George Karabin
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-14 23:28:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description George Karabin 1999-08-25 15:22:14 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
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 13:34:59 EDT
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-08 22:36:23 EDT
assigned to johnsonm

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