On Thu, 29 Oct 2009 casper....@sun.com wrote:

> Do you have the complete NFS trace output?  My reading of the source code
> says that the file will be created with the proper gid so I am actually
> believing that the client "over corrects" the attributes after creating
> the file/directory.

Yes, we submitted that to support. It's SR#71757154, although I don't know
if they've kept the ticket kept up-to-date. My understanding of the current
status is that they have verified the behavior we describe, and given the
ambiguity of the POSIX spec are not necessarily inclined to change it.

I've attached a small packet capture from creating a subdirectory on a
Solaris 10U8 NFS server from both a Linux client and a Solaris client.

For the linux client:

----------------------------------
hen...@damien /mnt/sgid_test $ ls -ld .
drwx--s--x 2 henson iit 2 Oct 29 17:29 .

hen...@damien /mnt/sgid_test $ id
uid=1005(henson) gid=1012(csupomona)

hen...@damien /mnt/sgid_test $ mkdir linux

hen...@damien /mnt/sgid_test $ ls -l
total 2
drwx--s--x 2 henson csupomona 2 Oct 29 17:31 linux
----------------------------------

The mkdir operation appears to consist of the compound call
"PUTFH;SAVEFH;CREATE;GETFH;GETATTR;RESTOREFH;GETATTR"; the CREATE call
specifies an attrmask of just FATTR4_MODE. The response to the GETATTR call
shows the FATTR4_OWNER_GROUP to be csupomona.

For the Solaris client:

----------------------------------
hen...@s10 /mnt/sgid_test $ ls -ld .
drwx--s--x+  3 henson   iit            3 Oct 29 17:31 .

hen...@s10 /mnt/sgid_test $ id
uid=1005(henson) gid=1012(csupomona)

hen...@s10 /mnt/sgid_test $ mkdir solaris

hen...@s10 /mnt/sgid_test $ ls -l
total 4
drwx--s--x+  2 henson   iit            2 Oct 29 17:33 solaris
----------------------------------

The mkdir in this case consists of the compound call
"PUTFH;CREATE;GETFH;GETATTR;SAVEFH;PUTFH;GETATTR;RESTOREFH;NVERIFY;SETATTR",
the CREATE call specifies an attrmask of both FATTR4_MODE *and*
FATTR4_OWNER_GROUP with iit as the group.

In the reply to GETATTR, FATTR4_OWNER_GROUP is iit.


We don't see any evidence that the Linux client explicitly changes the
group ownership after the directory is made. If I might inquire, which
source code are you looking at? Is it available though the OpenSolaris
online source browser? If so, could I trouble you for a link to it?

Thanks much for any help you might provide in clarifying this issue, and if
our understanding of the behavior turns out to be accurate, any help in
getting a change committed to better respect the sgid bit :)...


-- 
Paul B. Henson  |  (909) 979-6361  |  http://www.csupomona.edu/~henson/
Operating Systems and Network Analyst  |  hen...@csupomona.edu
California State Polytechnic University  |  Pomona CA 91768

Attachment: linux_mkdir.pcap
Description: Binary data

Attachment: solaris_mkdir.pcap
Description: Binary data

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to