KSHPR: prompt generator for .kshrc

John Macdonald jmm at ecijmm.UUCP
Thu Jun 29 14:42:44 AEST 1989


In article <1045 at midgard.Midgard.MN.ORG> caa at midgard.Midgard.MN.ORG (Charles A Anderson) writes:
|In article <287 at ecijmm.UUCP> jmm at ecijmm.UUCP (John Macdonald) writes:
||...  Anyhow, my method of determining whether I'm su'ed to root
||or not is a simple test "if [ -w /etc/passwd ]".  If that succeeds,
||you're either root or the proud owner of an insecure system.  
|
|Won't work for me, cuz my /etc/passwd is 444.  Meaning I have to do a w!
|to change it in vi but that's ok with me.

My /etc/passwd is 444 too.  The test works anyhow.  Both from sh and ksh.
Try it.  Vi checks for this as a special case, it doesn't just try to
write and see if it fails (you wouldn't - that's part of the special
charm of being root).
-- 
John Macdonald



More information about the Unix-pc.sources mailing list