[comp.protocols.tcp-ip.ibmpc] pc-nfs group access permissions

richard@uhccux.uhcc.hawaii.edu (Richard Foulk) (01/21/89)

I'm trying to use unix group permissions to allow two PC users on
our network to share files (read and write).  According to the
pc-nfs manual a single group is supported.  Unfortunately, so far
my attempts to make it work have failed.

Both users belong to the same group according to the server's
/etc/passwd file and (redundantly) the /etc/group file.

I've noticed that there's a sample NETGROUP file in the pc-nfs
distribution but it doesn't seem to be mentioned anywhere in
the manual.  And the sample doesn't make much sense to me.

When I run "net name" from either user it shows that they both
belong to the same group.  Yet I'm unable to create new files
in the others directory (with group read, write and execute
permissions on).

Has anyone been able to get this to work?

Thanks.

Richard Foulk		richard@uhccux.uhcc.hawaii.edu

geoff@eagle_snax.UUCP ( R.H. coast near the top) (01/25/89)

In article <3031@uhccux.uhcc.hawaii.edu> richard@uhccux.uhcc.hawaii.edu (Richard Foulk) writes:
>I'm trying to use unix group permissions to allow two PC users on
>our network to share files (read and write).  According to the
>pc-nfs manual a single group is supported.  Unfortunately, so far
>my attempts to make it work have failed.
>

When I read your posting, I sat down to try it at once. I began by
creating a directory from Unix, then mounting the file system and
CHDIR'ing to it on DOS with a different UID but the same GID. Ooops -
it DOES seem to be broken. Then I tried again, but created the
directories under PC-NFS. This time, it seemed to work. What's
going on here?

What I was running into (and what I suspect that Richard encountered)
is one of the more common misunderstandings under BSD-based Unix
systems. When you create a directory...

     The directory's owner ID is set to the  process's  effective
     user  ID.   The  directory's  group ID is set to that of the
     parent directory in which it is created.

from mkdir(2) under SunOS 3.2 - under SunOS4.0 it's different:

    The directory's owner ID is set to the  process's  effective
     user ID.
 
     The directory's group ID is set to either:

          +  the effective  group  ID  of  the  process,  if  the
             filesystem  was  not  mounted  with  the  BSD  file-
             creation semantics flag (see mount(2)) and the  set-
             gid bit of the parent directory is clear, or

          +  the group ID of the directory in which the  file  is
             created.

PC-NFS always sets the GID to that of the "creating process" (i.e.
the user's GID from "net name"). Many folks assume that this
happens under Unix, but 'taint necessarily so...

Geoff


-- 
Geoff Arnold, Sun Microsystems Inc.  | "It is well known that the longer one
PC Dist. Sys. Group (home of PC-NFS) |postpones a pleasure, the greater the
UUCP: {hplabs,decwrl...}!sun!garnold |pleasure when it arrives. Therefore, if
ARPA: garnold@sun.com                |one postpones it forever..." (Smullyan)