home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4759 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.9 KB

  1. Xref: sparky comp.unix.wizards:4759 comp.unix.internals:1961 comp.unix.programmer:5322
  2. Organization: Carnegie Mellon, Pittsburgh, PA
  3. 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+
  4. Newsgroups: comp.unix.wizards,comp.unix.internals,comp.unix.programmer
  5. Message-ID: <Uf2Hn7G00WB4MtP4gQ@andrew.cmu.edu>
  6. Date: Tue, 17 Nov 1992 13:41:11 -0500 
  7. From: Tod McQuillin <tm8t+@andrew.cmu.edu>
  8. Subject: Re: Changing the owner of a process
  9. Followup-To: comp.unix.internals
  10. In-Reply-To: <1992Nov17.142837.21252@dale.ksc.nasa.gov>
  11. References: <1992Oct29.162445.23551@eng.ufl.edu> <1cpjs4INNn3@early-bird.think.com> <1992Nov5.152833.27744@dale.ksc.nasa.gov>
  12.     <1992Nov17.142837.21252@dale.ksc.nasa.gov>
  13. Lines: 23
  14.  
  15. eposnak@dale.ksc.nasa.gov (Ed Posnak) writes:
  16. > What I was looking for was something along the lines of how to change the 
  17. > effective user id of a process who's source I may not be able to modify, by 
  18. > some other means, e.g. from another process.  Many suggested writing a device
  19. > driver or system call to do this.  Here is one answer along those lines. 
  20. > ---
  21. > I believe it could be done by writing a device driver. Open the device
  22. > driver and write commands to it, and it does the dirty work. For
  23. > instance, send it 8 bytes containing the process to change and the uid
  24. > to change it to.
  25. > The uid, in every version of Unix I've seen, is stored in the proc
  26. > structure in the kernel. You should be able to fiddle with this at
  27. > will in a device driver, and since it's in the proc structure and not
  28. > the u area, it'll always be there even if the process is swapped out.
  29. > It *should* be just a matter of searching for the entry and changing
  30. > it.
  31.  
  32. Yeah, but you don't need a device driver to do that.  Just use
  33. /dev/kmem, /vmunix, and nlist(3).
  34.  
  35. At least for 4.3bsd.
  36.