From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Tolpin Message-Id: <200403170854.i2H8sk2J083766@adat.davidashen.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] Novice question - run as other In-Reply-To: Date: Wed, 17 Mar 2004 12:54:46 +0400 Topicbox-Message-UUID: 32b625f8-eacd-11e9-9e20-41e7f4b1d025 > >> > a program from a shell script and change the user it runs as. > >> > >> The security model doesn't allow this. Perhaps by running it as a service > >> on a cpu. Check /sys/src/cmd/auth/cron.c and cap(3). For somethings > >> you can cpu over and change to a different uid: > > > > The following works: > ... > > fd>=0 && (write(fd,"none",strlen("none"))!=-1) > > That's not what you asked. > ? Is none not user? cpu% grep none /adm/users 0:none:adm cpu% none cat /env/user none I want a program to run as a different user. From C, it means opening '#c/user' and writing the user's name there. The security model is a separate issue, the call either succeeds or fails, but it is a consequence of security limitations, and not of the API. My question was how to do the same from rc. @{echo -n none > '#c/user' ; while() {sleep 1} } succeeds but does not change the owner of the process. Why? David