4.2 programs which need to read kmem

lepreau%utah-cs at sri-unix.UUCP lepreau%utah-cs at sri-unix.UUCP
Fri Nov 25 15:12:26 AEST 1983


From:  Jay Lepreau <lepreau at utah-cs>

I seem to remember doing this about a year ago too.  Well, we
run with 600 kmem/mem here, and here's the list of pgms which need
to read it.  We make them setgid.  Note that if you have a 4.1 or
below system setgid pgms are not safe, and they should be setuid
something: try to avoid root.

Note: rogue should be included (in order to get the load avg),
but is not cause as distributed with 4.2 it doesn't work anyway,
cause rogue resets the gid right after opening the score file, and
never again.

#! /bin/csh -f
set d = /usr/ucb
set pgms = (/etc/dmesg /etc/pstat /etc/trpt /bin/ps /usr/bin/iostat \
 /usr/new/dbid /usr/local/filepos /usr/local/lib/emacs/loadst \
 $d/gcore $d/gprof $d/netstat $d/sysline $d/w $d/vmstat)
/etc/chown root $pgms
chgrp MEM $pgms
chmod 2755 $pgms
chgrp MEM /dev/mem /dev/kmem
chmod 640 /dev/mem /dev/kmem
ls -lg /dev/mem /dev/kmem $pgms

================================
Here's the complete list. Those preceded by '-' we didn't make setgid
cause only root needs to run them.  kgmon is questionable.
==== /etc
dmesg:
-ethermap:
-kgmon:
pstat:
-route:
-routed:
-rwhod:
-savecore:
trpt:
==== /bin
ps:
==== /usr/bin
iostat:
==== /usr/ucb
gcore:
gprof:
netstat:
sysline:
uptime/w:
vmstat:
==== /usr/local
filepos:
-setuid:
==== /usr/new
dbid:
==== /usr/local/lib/emacs
loadst:
==== /usr/games
rogue



More information about the Comp.unix.wizards mailing list