Who's in my Directory ?

Marc Unangst mju at mudos.ann-arbor.mi.us
Mon Nov 26 08:40:37 AEST 1990


wmark at wb3ffv.ampr.org (Mark Winsor) writes:
> The /etc/fuser -u command will tell you who is in a file, but it reads
> /dev/kmem so it requires root access.

Not necessarily.  How do you think ps(1) and friends work?  Try this:

# chown bin /etc/fuser /dev/kmem
# chgrp kmem /etc/fuser /dev/kmem
# chmod 2111 /etc/fuser
# chmod 040 /dev/kmem

Presto, fuser can read /dev/kmem, but ordinary users can't.  You may
need to do this to /{vmunix,unix} (whatever your kernel is called),
since a lot of those sort of utilities read the kernel namelist to
find out where the stuff is in /dev/kmem.  (Caveat: I don't have
fuser, so I don't know if this opens up any security holes.  Check
closely; if it required root access before, there might have been a
reason.)

--
Marc Unangst               |
mju at mudos.ann-arbor.mi.us  | "Bus error: passengers dumped"
...!umich!leebai!mudos!mju | 



More information about the Comp.unix.misc mailing list