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

  1. Xref: sparky comp.unix.wizards:4801 comp.unix.questions:13639 comp.unix.programmer:5365 comp.unix.internals:1969
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!dog.ee.lbl.gov!horse.ee.lbl.gov!torek
  3. From: torek@horse.ee.lbl.gov (Chris Torek)
  4. Newsgroups: comp.unix.wizards,comp.unix.questions,comp.unix.programmer,comp.unix.internals
  5. Subject: Re: Changing the owner of a process
  6. Date: 19 Nov 1992 20:55:55 GMT
  7. Organization: Lawrence Berkeley Laboratory, Berkeley
  8. Lines: 22
  9. Message-ID: <27551@dog.ee.lbl.gov>
  10. 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>
  11. Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
  12. NNTP-Posting-Host: 128.3.112.15
  13. Keywords: process owner
  14.  
  15. In article <1992Nov17.142837.21252@dale.ksc.nasa.gov>
  16. eposnak@dale.ksc.nasa.gov (Ed Posnak) quotes an unidentified source:
  17. >The uid, in every version of Unix I've seen, is stored in the proc
  18. >structure in the kernel. ...
  19.  
  20. In 4.1BSD, 4.2BSD, and at least some versions of 4.3BSD, the uid was
  21. kept in u.u_uid (i.e., in the `u.' area).  This practice dates back
  22. to Version 7 and 32V Unix.  4.4BSD-alpha no longer has a `u. area'
  23. per se (although the space is still there for the kernel stack, among
  24. other things); but the uid is not in the proc in those Unix variants.
  25.  
  26. In any case, simply reaching into the kernel and rewriting the uid is
  27. not guaranteed to work.  In the current 4.4BSD development system, for
  28. instance, the kernel keeps a count of processes associated with each
  29. uid.  This avoids a linear scan of the process table on each fork()
  30. (the scan is otherwise needed to see if the fork would exceed the
  31. per-user process limit).  If you simply reach in and replace a
  32. process's uid, the kernel will eventually panic when it notices the
  33. inconsistent counts.
  34. -- 
  35. In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
  36. Berkeley, CA        Domain:    torek@ee.lbl.gov
  37.