home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.wizards:4759 comp.unix.internals:1961 comp.unix.programmer:5322
- Organization: Carnegie Mellon, Pittsburgh, PA
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!tm8t+
- Newsgroups: comp.unix.wizards,comp.unix.internals,comp.unix.programmer
- Message-ID: <Uf2Hn7G00WB4MtP4gQ@andrew.cmu.edu>
- Date: Tue, 17 Nov 1992 13:41:11 -0500
- From: Tod McQuillin <tm8t+@andrew.cmu.edu>
- Subject: Re: Changing the owner of a process
- Followup-To: comp.unix.internals
- In-Reply-To: <1992Nov17.142837.21252@dale.ksc.nasa.gov>
- References: <1992Oct29.162445.23551@eng.ufl.edu> <1cpjs4INNn3@early-bird.think.com> <1992Nov5.152833.27744@dale.ksc.nasa.gov>
- <1992Nov17.142837.21252@dale.ksc.nasa.gov>
- Lines: 23
-
- eposnak@dale.ksc.nasa.gov (Ed Posnak) writes:
- > What I was looking for was something along the lines of how to change the
- > effective user id of a process who's source I may not be able to modify, by
- > some other means, e.g. from another process. Many suggested writing a device
- > driver or system call to do this. Here is one answer along those lines.
- > ---
- >
- > I believe it could be done by writing a device driver. Open the device
- > driver and write commands to it, and it does the dirty work. For
- > instance, send it 8 bytes containing the process to change and the uid
- > to change it to.
- >
- > The uid, in every version of Unix I've seen, is stored in the proc
- > structure in the kernel. You should be able to fiddle with this at
- > will in a device driver, and since it's in the proc structure and not
- > the u area, it'll always be there even if the process is swapped out.
- > It *should* be just a matter of searching for the entry and changing
- > it.
-
- Yeah, but you don't need a device driver to do that. Just use
- /dev/kmem, /vmunix, and nlist(3).
-
- At least for 4.3bsd.
-