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:
Rodney W. Grimes 1993-09-06 23:12:04 +00:00
parent 6968118048
commit f45e18ea60
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=401

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 ""