From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16839 invoked from network); 5 Oct 2004 17:32:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Oct 2004 17:32:27 -0000 Received: (qmail 74629 invoked from network); 5 Oct 2004 17:32:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Oct 2004 17:32:21 -0000 Received: (qmail 25192 invoked by alias); 5 Oct 2004 17:31:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8038 Received: (qmail 25146 invoked from network); 5 Oct 2004 17:31:09 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Oct 2004 17:31:09 -0000 Received: (qmail 70849 invoked from network); 5 Oct 2004 17:30:12 -0000 Received: from pop.gmx.de (HELO mail.gmx.net) (213.165.64.20) by a.mx.sunsite.dk with SMTP; 5 Oct 2004 17:30:10 -0000 Received: (qmail 13675 invoked by uid 65534); 5 Oct 2004 17:30:10 -0000 Received: from p508B154E.dip0.t-ipconnect.de (EHLO zitrone.obstwiese) (80.139.21.78) by mail.gmx.net (mp001) with SMTP; 05 Oct 2004 19:30:10 +0200 X-Authenticated: #885628 Received: from luthien by zitrone.obstwiese with local (Exim 3.35 #1 (Debian)) id 1CEprW-00040x-00 for ; Tue, 05 Oct 2004 16:00:18 +0200 Date: Tue, 5 Oct 2004 16:00:08 +0200 From: Dominik Vogt To: Zsh Users Subject: question about setting UIDs Message-ID: <20041005140008.GA12761@gmx.de> Reply-To: dominik.vogt@gmx.de Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline User-Agent: Mutt/1.3.28i X-PGP-Key: http://www.dominikvogt.de/gpg/pubkey.asc Sender: Dominik Vogt X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In zsh, I can overwrite the UID, EUID varaibles to change the user ids under which the script runs. From the man page it is not clear under which circumstances the saved uid is adjusted. I.e. can the script switch back return to the original UID/EUID? When I run a shell or script as root (ruid =3D euid =3D svuid =3D 0), setting the EUID allows me to switch back: $ echo $UID $EUID 0 0 $ EUID=3D1000; echo $UID $EUID 0 1000 $ EUID=3D0; echo $UID $EUID 0 0 but settig UID does not: $ echo $UID $EUID 0 0 $ UID=3D1000; echo $UID $EUID 1000 1000 $ UID=3D0; echo $UID $EUID 1000 1000 (All on linux-2.6). Are there any guarantees that 1) Setting EUID is reversible (at least on systems that have the seteuid() system call)? 2) Setting UID is not reversible (on what kinds of system)? =20 Ciao Dominik ^_^ ^_^ -- Dominik Vogt, dominik.vogt@gmx.de --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFBYqjomeSprTOr4tgRAhB3AJ42w7i7mRpDIOi+aJB7I6LTYauPtwCcC7Xx V3wy7IxxsuJF57gzm/Nact0= =Whnl -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb--