just compare names, then print out the full information for diffs
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 17 Jan 1992 06:26:04 +0000 (22:26 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 17 Jan 1992 06:26:04 +0000 (22:26 -0800)
SCCS-vsn: etc/security 5.8

usr/src/etc/security

index b4c761e..d844a88 100644 (file)
@@ -1,28 +1,40 @@
 #!/bin/sh -
 #
 #!/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"
 
 #
 PATH=/sbin:/bin:/usr/bin
 
 host=`hostname`
 echo "Subject: $host security check output"
 
+umask 22
+
 LOG=/var/log
 LOG=/var/log
-TMP=/tmp/_secure.$$
+TMP1=/tmp/_secure1.$$
+TMP2=/tmp/_secure2.$$
 
 echo ""
 echo "Checking setuid files and devices:"
 
 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
 fi
-rm -f $TMP
+rm -f $TMP1 $TMP2
 
 echo ""
 echo ""
 
 echo ""
 echo ""