The version of newgrp is
static char *sccsid = "@(#)newgrp.c 4.1 (Berkeley) 10/1/80";
The changes are
*** newgrp.c.old Fri Feb 25 09:48:07 1983
--- newgrp.c.new Fri Feb 25 09:52:12 1983
***************
*** 45,51
setuid(getuid());
for (i=3; i<15; i++)
close(i);
! execl((pwd->pw_shell[0]?pwd->pw_shell:"/bin/sh"), "-i", 0);
printf("No shell!\n");
exit(0);
}
--- 45,51 -----
setuid(getuid());
for (i=3; i<15; i++)
close(i);
! execl((pwd->pw_shell[0]?pwd->pw_shell:"/bin/sh"), "newgrp", 0);
printf("No shell!\n");
exit(0);
}
I figured that "newgrp" was making the new shell a login shell because
"getty" and "login", curse their pointy little heads, won't permit you
to specify a group name as well as a user name when logging in (i.e., you
respond log in like:
login: guy bin
and you will be immediately put in as group "bin" even though your default
group may be "other".). This way, for example, if your .profile does any
group-dependent processing, it will be performed again (for example, my
.profile sets my umask depending on what group I am in).
Guy Harris
RLG Corporation
...!decvax!mcnc!rlgvax!guy
...!seismo!rlgvax!guy
:-) Mike Braca, Brown CS, ..!decvax!brunix!mjb, mjb.brown@udel-relay