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