xfs
[Top] [All Lists]

Re: stress test failures

To: Timothy Shimmin <tes@xxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: stress test failures
From: "Marcelo E. Magallon" <marcelo.magallon@xxxxxxxxxxx>
Date: Tue, 6 Feb 2001 13:59:32 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <200102060200.NAA32442@xxxxxxxxxxxxxxxxxxxxxxx>; from tes@xxxxxxxxxxxxxxxxxxxxxxx on Tue, Feb 06, 2001 at 01:00:42PM +1100
Mail-followup-to: linux-xfs@xxxxxxxxxxx
References: <20010205104330.A1108@xxxxxxxxxxxxxxx> <200102060200.NAA32442@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mutt/1.1.14i
>> Timothy Shimmin <tes@xxxxxxxxxxxxxxxxxxxxxxx> writes:

 > I use a small program, xfstests/src/runas, to set up the 
 > effective uid, e-gid, and supplementary groups for a process. 
 > Could you do the following as root to verify it is working:
 >     [root@sagan src]# runas -u 10001 -g 10002 -s 10003 -s 10004 id
 >     uid=0(root) gid=0(root) euid=10001 egid=10002 groups=10003,10004

 I'm not getting that.  The problem is runas uses system.  It eventually
 executes /bin/sh, which is a symlink to bash, which in turn will reset
 privileges on start up (a patched bash might not do this if called as
 "sh", but the one installed here does).  The attached runas.c solves
 this:

 # ./runas -u 10001 -g 10002 -s 10003 -s 10004 /usr/bin/id
 uid=0(root) gid=0(root) euid=10001 egid=10002 groups=10003,10004

 (I'm using execv, replace with execvp if you want things to be searched
 in the PATH)

--
Marcelo

Attachment: runas.c
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>