From: David Presotto <presotto@closedmind.org>
To: dvd@davidashen.net, 9fans@cse.psu.edu
Subject: Re: [9fans] Novice question - run as other
Date: Wed, 17 Mar 2004 07:43:53 -0500 [thread overview]
Message-ID: <e6fbf68d5042caadea2aae35a8f07901@plan9.bell-labs.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 102 bytes --]
It worked, I believe you just didn't notice. The echo process became
none and then immediately died.
[-- Attachment #2: Type: message/rfc822, Size: 2997 bytes --]
From: David Tolpin <dvd@davidashen.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Novice question - run as other
Date: Wed, 17 Mar 2004 12:54:46 +0400 (AMT)
Message-ID: <200403170854.i2H8sk2J083766@adat.davidashen.net>
> >> > 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?
Dav id
next reply other threads:[~2004-03-17 12:43 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-17 12:43 David Presotto [this message]
2004-03-17 17:03 ` ron minnich
2004-03-17 17:13 ` rog
2004-03-17 17:13 ` David Presotto
2004-03-17 18:00 ` David Tolpin
2004-03-17 18:12 ` ron minnich
2004-03-17 18:14 ` David Presotto
2004-03-17 19:34 ` rog
2004-03-17 19:43 ` [9fans] unsuscribe Jose timofonic
2004-03-17 19:52 ` [9fans] Novice question - run as other Russ Cox
2004-03-17 19:58 ` rog
2004-03-18 4:21 ` Martin C.Atkins
-- strict thread matches above, loose matches on Subject: below --
2004-03-17 18:29 plan9fans
[not found] <200403170948.i2H9mi3W084127@adat.davidashen.net>
2004-03-17 18:24 ` 9nut
2004-03-18 7:38 ` boyd, rounin
[not found] <200403161953.i2GJrNMv080779@adat.davidashen.net>
2004-03-16 22:54 ` 9nut
2004-03-17 7:18 ` David Tolpin
2004-03-17 8:10 ` Geoff Collyer
2004-03-17 8:24 ` David Tolpin
2004-03-17 8:55 ` Geoff Collyer
2004-03-17 9:04 ` David Tolpin
2004-03-17 9:19 ` Bruce Ellis
2004-03-17 10:31 ` boyd, rounin
2004-03-17 14:01 ` Dave Lukes
2004-03-17 9:33 ` 9nut
2004-03-17 8:54 ` David Tolpin
2004-03-17 8:56 ` Charles Forsyth
2004-03-17 9:07 ` David Tolpin
2004-03-17 9:17 ` Charles Forsyth
2004-03-17 9:28 ` David Tolpin
2004-03-17 10:08 ` 9nut
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=e6fbf68d5042caadea2aae35a8f07901@plan9.bell-labs.com \
--to=presotto@closedmind.org \
--cc=9fans@cse.psu.edu \
--cc=dvd@davidashen.net \
/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.
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).