Fixed so that it scans for set uid/gid files. From Rich Murphy and NetBSD,

plus some tid bits from me.
This commit is contained in:
rgrimes 1993-09-06 23:12:04 +00:00
parent b7ad91ad93
commit cf1bc54ea7

View File

@ -1,6 +1,7 @@
#!/bin/sh -
#
# @(#)security 5.3 (Berkeley) 5/28/91
# $Id$
#
PATH=/sbin:/bin:/usr/bin
@ -10,18 +11,34 @@ echo "Subject: $host security check output"
LOG=/var/log
TMP=/tmp/_secure.$$
if false; then
umask 027
echo "checking setuid files and devices:"
MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'`
set $MP
ls -lgT `while test $# -ge 2; do
device=$1
shift
mount=$1
shift
ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \
-e "s;[^/]*;$mount;" -e "s;//;/;g" | sort
done` > $TMP
# don't have ncheck, but this does the equivalent of the commented out block.
# note that one of the original problem, the possibility of overrunning
# the args to ls, is still here...
#
# add this after -a when find supports isofs, and you don't want to check
# your cd roms
# \( ! \( -fstype isofs \) -o -prune \) \
# do skip checking cdroms
find / -fstype local -a \
\( -perm -u+s -or -perm -g+s \) | \
sed -e "/\/dev\//d" -e "s;//;/;g" | sort | xargs -n 20 ls -lgT > $TMP
#MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'`
#set $MP
#ls -lgT `while test $# -ge 2; do
# device=$1
# shift
# mount=$1
# shift
# ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \
# -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort
#done` > $TMP
if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
echo "$host setuid/device diffs:"
@ -30,7 +47,6 @@ if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
mv $TMP $LOG/setuid.today
fi
rm -f $TMP
fi
echo ""
echo ""