minor NFS bug

Stefan Persson (d4stefpe@dtek.chalmers.se)
Tue, 19 Aug 1997 21:00:06 +0200 (MET DST)


Hi everyone.

I recently found out that the kernel-based nfsd refuses to open any files
or directories with the setgid-bit set.
Looking at the code a bit, I found out that the check for mandatory locking
indicates a lock on a file if the setgid-bit is set, and the sticky-bit is
turned off.
Now, as I understand it, mandatory locking is supposed to be indicated by
setting the setgid-bit and turning off the _group_execute_ bit.
Anyway, the following tiny patch fixes this. Am I missing something?

----------

--- vfs.c.old Tue Aug 19 20:04:02 1997
+++ vfs.c Tue Aug 19 20:04:50 1997
@@ -44,7 +44,7 @@

/* Hack until we have a macro check for mandatory locks. */
#ifndef IS_ISMNDLK
-#define IS_ISMNDLK(i) (((i)->i_mode & (S_ISGID|S_ISVTX)) == S_ISGID)
+#define IS_ISMNDLK(i) (((i)->i_mode & (S_ISGID|S_IXGRP)) == S_ISGID)
#endif

/* Check for dir entries '.' and '..' */

----------

regards,
/stefan