xref: /csrg-svn/etc/security (revision 42328)
1*42328Sbostic#!/bin/sh -
2*42328Sbostic#
3*42328Sbostic#	@(#)security	5.1 (Berkeley) 05/24/90
4*42328Sbostic#
5*42328SbosticPATH=/sbin:/bin:/usr/bin
6*42328Sbostic
7*42328Sbostichost=`hostname -s`
8*42328Sbosticecho "Subject: $host security check output"
9*42328Sbostic
10*42328SbosticLOG=/var/log
11*42328SbosticTMP=/tmp/_secure.$$
12*42328Sbostic
13*42328Sbosticecho "checking setuid files and devices:"
14*42328SbosticMP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'`
15*42328Sbosticset $MP
16*42328Sbosticls -l `while test $# -ge 2; do
17*42328Sbostic	device=$1
18*42328Sbostic	shift
19*42328Sbostic	mount=$1
20*42328Sbostic	shift
21*42328Sbostic	ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \
22*42328Sbostic	    -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort
23*42328Sbosticdone` > $TMP
24*42328Sbostic
25*42328Sbosticif cmp $LOG/setuid.today $TMP >/dev/null; then :; else
26*42328Sbostic	echo "$host setuid/device diffs:"
27*42328Sbostic	diff $LOG/setuid.today $TMP
28*42328Sbostic	mv $LOG/setuid.today $LOG/setuid.yesterday
29*42328Sbostic	mv $TMP $LOG/setuid.today
30*42328Sbosticfi
31*42328Sbosticrm -f $TMP
32*42328Sbostic
33*42328Sbosticecho ""
34*42328Sbosticecho ""
35*42328Sbosticecho "checking for uids of 0:"
36*42328Sbosticawk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd
37