From: Al Clark (aclark@netcom.com)
Date: 09/28/92


From: aclark@netcom.com (Al Clark)
Subject: Re: Which group id?
Date: Mon, 28 Sep 1992 21:30:40 GMT

In article <1992Sep28.001618.21799@cs.brown.edu> wcn@cs.brown.edu (Wen-Chun Ni) writes:
>
>Suppose I have a directory whose group id is "student." My set of group
>id includes "student" but the group id in my passwd entry is
>"graduate". If I write a file into the directory, what group id
>will be set to this file?
>
> Under Linux: it's "graduate."
> Under SunOS: it's "student."
>
>Which is correct? I think SunOS is right. Opinions?
>
>
>
>Wen-Chun Ni

The default group of a new file under SunOS is your choice;
If the directory has ordinary permissions, you'll use the passwd entry
group ("graduate" above). However, if the directory has setgid bit set,
you'll use the directories group id. See chmod(1). If you look closely,
I think you'll find this is the case in your example. This is Sun's
way of resolving the difference between the BSD and SYS5 defaults.

Linux appears to be using the SYS5 approach, but without a newgrp command.

-- 
Al - aclark@netcom.com - My opinions are my own.