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

  1. Xref: sparky comp.unix.wizards:4774 comp.unix.questions:13569 comp.unix.programmer:5334 comp.unix.internals:1964
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!chinacat!rpp386!jfh
  3. From: jfh@rpp386.lonestar.org (John F. Haugh II)
  4. Newsgroups: comp.unix.wizards,comp.unix.questions,comp.unix.programmer,comp.unix.internals
  5. Subject: Re: Changing the owner of a process
  6. Message-ID: <21902@rpp386.lonestar.org>
  7. Date: 18 Nov 92 05:38:32 GMT
  8. 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>
  9. Reply-To: jfh@rpp386.cactus.org (John F. Haugh II)
  10. Organization: Los Tejanos SCUBA Club and Beer Joint, Austin, Tejas
  11. Lines: 28
  12.  
  13. In article <1992Nov17.142837.21252@dale.ksc.nasa.gov> eposnak@dale.ksc.nasa.gov (Ed Posnak) writes:
  14.  
  15. [ This is actually one of the answers he quoted.  Mark Buda is the
  16.   writer ... ]
  17.  
  18. >The uid, in every version of Unix I've seen, is stored in the proc
  19. >structure in the kernel. You should be able to fiddle with this at
  20. >will in a device driver, and since it's in the proc structure and not
  21. >the u area, it'll always be there even if the process is swapped out.
  22. >It *should* be just a matter of searching for the entry and changing
  23. >it.
  24.  
  25. The UIDs are stored in the (struct user).  They are u.u_uid and u.u_ruid.
  26. Without giving away too much, that's where the system looks for things
  27. like access() and so on.  For a really bad time, check out the source
  28. to suser().  It will convince you of this fact.
  29.  
  30. >This technique should also serve to implement something like renice()
  31. >under Xenix, which doesn't have it. (The nice value also being stored
  32. >in the proc structure.)
  33.  
  34. Unfortunately, now that we know the data is in the (struct user),
  35. I won't be getting out my source to a XENIX renice ...  This also
  36. means that the device driver idea won't work since the other processes
  37. u-area may be anywheres.
  38. -- 
  39. John F. Haugh II                  [  TSAKC  ] !'s: ...!cs.utexas.edu!rpp386!jfh
  40. Ma Bell: (512) 251-2151           [ DoF #17 ]        @'s: jfh@rpp386.cactus.org
  41.