From: Keith Bostic Date: Fri, 17 Jan 1992 06:26:04 +0000 (-0800) Subject: just compare names, then print out the full information for diffs X-Git-Tag: BSD-4_4-Snapshot-Development~8322 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/383148a3112f8dc56eefc100709d4a0426d56a36 just compare names, then print out the full information for diffs SCCS-vsn: etc/security 5.8 --- diff --git a/usr/src/etc/security b/usr/src/etc/security index b4c761ebd4..d844a8805f 100644 --- a/usr/src/etc/security +++ b/usr/src/etc/security @@ -1,28 +1,40 @@ #!/bin/sh - # -# @(#)security 5.7 (Berkeley) %G% +# @(#)security 5.8 (Berkeley) %G% # PATH=/sbin:/bin:/usr/bin host=`hostname` echo "Subject: $host security check output" +umask 22 + LOG=/var/log -TMP=/tmp/_secure.$$ +TMP1=/tmp/_secure1.$$ +TMP2=/tmp/_secure2.$$ echo "" echo "Checking setuid files and devices:" -find / \( ! -fstype local \) -a -prune -o \ - \( -perm -u+s -o -perm -g+s -o ! -type d -a ! -type f -a ! -type l \) \ - -a -exec /bin/ls -cgl {} \; 2>&1 > $TMP - -if cmp $LOG/setuid.today $TMP >/dev/null; then :; else - echo "$host setuid/device diffs:" - diff $LOG/setuid.today $TMP - mv $LOG/setuid.today $LOG/setuid.yesterday - mv $TMP $LOG/setuid.today +(find / \( ! -fstype local \) -a -prune -o \( -perm -u+s -o -perm -g+s \ + -o ! -type d -a ! -type f -a ! -type l \) | sort >$TMP1) 2>$TMP2 + +if [ -s $TMP2 ] ; then + echo "$host setuid/device find errors:" + cat $TMP2 + echo ""; echo "" +fi + +if cmp $LOG/setuid.today $TMP1 >/dev/null; then :; else + echo "$host setuid/device additions:" + ls -lgT `join -v1 $LOG/setuid.today $TMP1` + echo ""; echo "" + echo "$host setuid/device deletions:" + ls -lgT `join -v2 $LOG/setuid.today $TMP1` + + mv $LOG/setuid.current $LOG/setuid.backup + mv $TMP1 $LOG/setuid.current fi -rm -f $TMP +rm -f $TMP1 $TMP2 echo "" echo ""