security revision 1.7
1#!/bin/sh -
2#
3#	@(#)security	5.3 (Berkeley) 5/28/91
4#
5PATH=/sbin:/bin:/usr/bin
6
7host=`hostname -s`
8echo "Subject: $host security check output"
9
10LOG=/var/log
11TMP=/tmp/_secure.$$
12
13umask 027
14
15echo "checking setuid files and devices:"
16
17# don't have ncheck, but this does the equivalent of the commented out block.
18
19MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $3 }'`
20set $MP
21ls -lgT `while test $# -ge 1; do
22	mount=$1
23	shift
24	find $mount -xdev \( \( -type f \( -perm -u+s -or -perm -g+s \) \) -or -type b -or -type c \) | sort
25done` > $TMP
26
27#MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'`
28#set $MP
29#ls -lgT `while test $# -ge 2; do
30#	device=$1
31#	shift
32#	mount=$1
33#	shift
34#	ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \
35#	    -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort
36#done` > $TMP
37
38if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
39	echo "$host setuid/device diffs:"
40	diff -w $LOG/setuid.today $TMP
41	mv $LOG/setuid.today $LOG/setuid.yesterday
42	mv $TMP $LOG/setuid.today
43fi
44rm -f $TMP
45
46echo ""
47echo ""
48echo "checking for uids of 0:"
49awk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd
50