setgid bit not honoured/displayed

From: Steve Feehan <sfeehan_at_zoo.uvm.edu>
Date: Tue, 05 Feb 2002 21:06:35 -0500

I have a Tru64 5.1a system that exports an AdvFS via NFS. The filesystem
is mounted by Linux and IRIX clients.

First, it seems that Tru64 handles the setgid bit on directories somewhat
strangely. If I create a directory and set the setgid bit, then do an ls:

tru64> mkdir foo
tru64> chgrp admins foo
tru64> chmod g+s foo
tru64> ls -ld foo
drwxrwsr-x 2 sfeehan admins 8192 Feb 5 20:52 foo

ok, so far, so good... now I do this:

tru64> cd foo
tru64> mkdir bar
tru64> ls -ld bar
drwxrwxr-x 2 sfeehan admins 8192 Feb 5 20:53 bar

The group of the directory bar/ was set correctly, but where is the 's'
in the group execute bit? Now do:

tru64> cd bar
tru64> mkdir baz
tru64> ls -ld baz
drwxrwxr-x 2 sfeehan admins 8192 Feb 5 20:54 baz/

So the setgid bit is being inherited by new directories, but it doesn't
show up in the mode. Why?

Now the really bad part... on Linux it is the same as Tru64, but on Irix
we get:

irix> ls -ld foo
drwxrwsr-x 3 sfeehan admins 8192 Feb 5 20:53 foo/
irix> cd foo
irix> mkdir buz
irix> ls -ld buz
drwxrwxr-x 2 sfeehan admins 8192 Feb 5 20:58 buz

Looks ok... well, the 's' is missing from the mode, but it's missing on
tru64 and linux as well...

irix> cd buz
irix> mkdir bad
irix> ls -ld bad
drwxrwxr-x 2 sfeehan sfeehan 8192 Feb 5 21:00 bad

The setgid bit was lost on buz/ so bad/ is created with my login group.
This is really evil, becuase a) it's unexpected behaviour and b) there
is no way to tell from the ls output what the modes of a directory are.

Has anyone else seen this before? Am I missing something really simple?

Thanks in advance.

-- 
Steve Feehan
Unix Systems Administrator
Structural Biology and Bioinformatics Group
University of Vermont
Received on Wed Feb 06 2002 - 02:06:45 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT