Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: newgrp

Peter Stephenson wrote:
> > Wether with the above function, or with the alias proposed in the FAQ,
> > I always finally receive the message "zsh: newgrp not found",
> > since there is no newgrp command available.
> aha --- most systems have an external command newgrp available which
> seems to be missing there.  zsh does have some mechanism for changing
> the group by altering $GID, but the way it's set up it's only usable by
> the superuser, as far as I can tell.

That's because on Unix systems superuser privileges are required to change
the primary group id.  There is nothing in zsh which would prevent changing
the GID parameter.  If it fails it fails because the OS refused change it.
Of course some trickery with chgrp and setgid might also help but on secure
systems normal users have no write access to suid mounted filesystems.
Also secure systems does not use HP, or if ther use, they definitely do not
keep suid newgrp since a root exploit was posted recently to bugtraq using
HP's newgrp (where you can find one or two HP root exploits every week so
if you subscribe it will not be difficult to install the missing newgrp on
your machine).


Messages sorted by: Reverse Date, Date, Thread, Author