Subject: Re: bin/11047: newgrp is missing
To: Manuel Bouyer <email@example.com>
From: Andrew Brown <firstname.lastname@example.org>
Date: 04/27/2002 15:20:12
>> >What exactly is newgrp good for on a system that allows users to be in
>> >more than one group at a time?
>> On SYSV, using newgrp allows one to create files with a particular group
>> ownership. On NetBSD one would use chmod.
>I don't think newgrp would help in this case, because the 4.4BSD semantic is
>to create new files with the group of the directory if the user is allowed
>A newgrp would only help in case of file creation in a directory which groups
>is not in the user's group list.
that already works.
> ls -ld .
drwxrwxrwt 2 root 47 512 Apr 27 11:27 ./
uid=204(andrew) gid=20(staff) groups=20(staff),0(wheel),9(wsrc)
> rm foo
rm: foo: No such file or directory
> touch foo
> ls -l foo
-rw-r--r-- 1 andrew 47 0 Apr 27 15:18 foo
oh, and for what it's worth:
> chmod 2755 foo
chmod: foo: Operation not permitted
i can't exploit that to gain extra permissions.
|-----< "CODE WARRIOR" >-----|
email@example.com * "ah! i see you have the internet
firstname.lastname@example.org (Andrew Brown) that goes *ping*!"
email@example.com * "information is power -- share the wealth."