Question Need for 'module' installed in 3.6.0-rc2

Linda Walsh samba at tlinx.org
Mon Jun 13 13:16:11 MDT 2011





I was looking over the vfs modules installed in 360rc2 and noticed
one that didn't have an '0ld':

[/usr/lib64/samba/vfs/] linux_xfs_sgid.so

I looked at the opensuse dist and it doesn't install it.

I tried to read the manpage on it to see what it is supposed to do,
but it doesn't exist.

So I looked at the source.
It appears to implement **standard** linux functionality in regards to
the SGID bit:  any file or directory created in a directory under
a dir with the SGID bit set, is created, owned by the same group as
the parent dir (this appears to be assumed to work by the module).

But the 2nd part, which also is standard on linux (I don't think it is
just xfs) is that any directories created under that dir also get the
SGID bit set, and that the module manually implements by switching into
'root mode' to set the bit.

Just tested this in the shell on the server (running Opensuse 11.4,
my own 'vanilla kernel @ 2.6.38.3'):

Ishtar:law> groups|grep lp      #I'm not in group 'lp'....
Ishtar:law> mkdir lp
Ishtar:law> sudo chgrp lp lp
Ishtar:law> sudo chmod g+s lp
Ishtar:law> cd lp
Ishtar:law/lp> touch x
Ishtar:law/lp> mkdir newdir
Ishtar:law/lp> llg -a
total 16
drwxrws--x   3 law lp          27 Jun 13 11:45 ./
drwxr-sr-x 220 law lawgroup 12288 Jun 13 11:45 ../
drwxrws--x   2 law lp           6 Jun 13 11:45 newdir/
-rw-rw----   1 law lp           0 Jun 13 11:45 x
-------------------------

Notice that both dirs and files get created in the group, but more
importantly, that the sgid bit is set on any new dirs created.

So what's this module for, anyway if it is implementing something already
in the OS? 

Maybe it once was needed, is no longer needed, so the docs were removed,
but the source files got left behind?






More information about the samba-technical mailing list