Xref: utzoo comp.unix.questions:25551 comp.unix.internals:313 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!agate!linus!nixbur!nixpbe!peun11!josef From: josef@nixpbe.UUCP (Moellers) Newsgroups: comp.unix.questions,comp.unix.internals Subject: Re: ps and wall; How do they work? Message-ID: Date: 17 Sep 90 06:56:43 GMT References: <27773@pasteur.Berkeley.EDU> Sender: news@nixpbe.nixdorf.de Followup-To: comp.unix.questions Lines: 42 In <27773@pasteur.Berkeley.EDU> achoi@cory.Berkeley.EDU (CHOI ANDREW MAN-TAT) writes: >Hello world. This is my first posting to this newsgroup, please >accept my apology in advance if I have inadvertently violated any >netiquette. >I have the following 2 questions about command 'ps' and 'wall': >1) How does 'ps' work? Where does it get the information about all > the processes running on the system? I suspect it may have > something to do with /dev/kmem (Kernel Memory); however, since > I don't have read/write permission on /dev/kmem, how can > 'ps' acquire the permission to read /dev/kmem? Is there a > setuid program exec by 'ps' to get root access? It depends very much on your system: - the "classical" way is to give "ps" setuid root an have it access /dev/kmem, as You suspect. - on more "secure" systems, or distributed systems where there are more than one "kernel memories", there usually is some kind of server or a special system call to get process information. >2) Even after I do 'mesg n' or 'chmod og-rx /dev/tty?', other > users can still send me message through command 'wall', > how come? Is there anyway to prevent 'wall' from sending the > message? Hmm, maybe "wall" is setuid root? After all, "wall" sould only be used to alert users e.g. when the system goes down (if there is any time left B-{) >Thank you very much for your time and effort in answering these >questions. Much obliged, sir! -- | Josef Moellers | c/o Nixdorf Computer AG | | USA: mollers.pad@nixdorf.com | Abt. PXD-S14 | | !USA: mollers.pad@nixdorf.de | Heinz-Nixdorf-Ring | | Phone: (+49) 5251 104662 | D-4790 Paderborn |