[comp.os.minix] Updated on ST, what about ps?

Michael.Joswig@germany.sun.com (Michael Joswig (Vertriebsunterstuetzung Hamburg)) (01/14/91)

Hello once again!
Thanks for the replies to my last question (good to know people who know...).
After upgrading (Minix ST 1.5.10 plus Patches) I tried the "ps" command,
which failed. (Something about can't read on /dev/kmem). I know there were
more to do than just patching the old Kernel. Can anybody give me a hint?
Ciao,
     Michael.
     

hp@vmars.tuwien.ac.at (Peter Holzer) (01/16/91)

Michael.Joswig@germany.sun.com (Michael Joswig (Vertriebsunterstuetzung Hamburg)) writes:

>Hello once again!
>Thanks for the replies to my last question (good to know people who know...).
>After upgrading (Minix ST 1.5.10 plus Patches) I tried the "ps" command,
>which failed. (Something about can't read on /dev/kmem). I know there were
>more to do than just patching the old Kernel. Can anybody give me a hint?
>Ciao,
>     Michael.
>     

This question should go into a FAQ list.

/dev/kmem is only readable by root. So as a normal user you can't read
it and ps will fail. Three solutions are possible:

1) Set the setuid bit of ps.

2) Create a group mem, chgrp mem /dev/*mem, chgrp mem /usr/bin/ps (and
   every other program that needs to read mem), chmod g+r /dev/*mem. This
   is the setup found on many unix systems.

3) chmod go+r /dev/*mem. This gives all users read access to memory, so
   all processes can read each others data. Therefore not recommended if
   you are not the only user on your system. It is not difficult to write a
   program that constantly looks for login processes to grab passwords
   on such a system. (I know that the minix password encryption is
   reversable, so there are other ways to get the root password, but it
   is a major security whole nontheless).

The REAL SOLUTION(TM) is, however, to add a system call getprocinfo to the 
memory manager. After all, MM does memory and process management and
should provide ALL necessary interfaces. Having programs like ps and
xload (not on Minix) snuffing around in kernel name lists and /dev/*mem
to find out about such data in obscure ways is everything but elegant.
--
|    _  | Peter J. Holzer                       | Think of it   |
| |_|_) | Technical University Vienna           | as evolution  |
| | |   | Dept. for Real-Time Systems           | in action!    |
| __/   | hp@vmars.tuwien.ac.at                 |     Tony Rand |