zsh-users
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: chamont@polhp3.in2p3.fr (David Chamont)
Cc: zsh-users@math.gatech.edu
Subject: Re: newgrp
Date: Thu, 12 Dec 1996 15:18:09 +0100 (MET)	[thread overview]
Message-ID: <199612121418.PAA10636@bolyai.cs.elte.hu> (raw)
In-Reply-To: <32B01157.24A1@polhp3.in2p3.fr> from David Chamont at "Dec 12, 96 03:06:15 pm"

David Chamont wrote:
> It is probably not the best solution, but I went around the lack of
> newgrp command by writing the following script, and then asked my
> administrator to change the owner to root and mode to 4755,
> and finally add the alias newgrp='exec newgrp'.
> At least it works !

Be careful with that.  Zsh was not designed to run setuid scripts although
some attempt was made to make is somewhat secure.  I do hope that the
script you wrote is secure but I cannot guarantee that zsh has no bugs that
can be exploited to gain root privileges.  And I would not run ypcat and
grep with 0 euid.  I would use this:

>           --------------------------------------------
>           #!/usr/local/bin/zsh

            EUID=UID

>           
>           accord=non
>           for g in `groups` ; do
>             if [[ $g = "$1" ]] ; then
>               group=`ypcat group | grep "^${1}:"`
                EUID=0
>               GID=${${group%:*}##*:}
                break
>             fi
>           done
>           
>           EUID=$UID
            UID=UID
>           exec zsh
>           --------------------------------------------

Zoltan


  reply	other threads:[~1996-12-12 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <32AFD799.7407@polhp3.in2p3.fr>
1996-12-12 10:17 ` newgrp Peter Stephenson
1996-12-12 13:44   ` newgrp Zoltan Hidvegi
1996-12-12 14:06     ` newgrp David Chamont
1996-12-12 14:18       ` Zoltan Hidvegi [this message]
1996-12-12 16:25         ` newgrp Richard Coleman
1996-12-11 18:29 newgrp David Chamont
1996-12-12  9:10 ` newgrp Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199612121418.PAA10636@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=chamont@polhp3.in2p3.fr \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).