Major hackery to get the 1.1 Beta floppies building. Have a special
[unix-history] / etc / security
index 388f4a4..37d7d6e 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh -
 #
 #      @(#)security    5.3 (Berkeley) 5/28/91
 #!/bin/sh -
 #
 #      @(#)security    5.3 (Berkeley) 5/28/91
+#      $Id: security,v 1.5 1993/12/15 06:42:01 rich Exp $
 #
 PATH=/sbin:/bin:/usr/bin
 
 #
 PATH=/sbin:/bin:/usr/bin
 
@@ -10,18 +11,21 @@ echo "Subject: $host security check output"
 LOG=/var/log
 TMP=/tmp/_secure.$$
 
 LOG=/var/log
 TMP=/tmp/_secure.$$
 
-if false; then
+umask 027
+
 echo "checking setuid files and devices:"
 echo "checking setuid files and devices:"
-MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'`
+
+# 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...
+#
+MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $3 }'`
 set $MP
 set $MP
-ls -lgT `while test $# -ge 2; do
-       device=$1
-       shift
+while test $# -ge 1; do
        mount=$1
        shift
        mount=$1
        shift
-       ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \
-           -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort
-done` > $TMP
+       find $mount -xdev -perm -u+s -or -perm -g+s | sort
+done | xargs -n 20 ls -lgTd > $TMP
 
 if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
        echo "$host setuid/device diffs:"
 
 if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
        echo "$host setuid/device diffs:"
@@ -30,7 +34,6 @@ if cmp $LOG/setuid.today $TMP >/dev/null; then :; else
        mv $TMP $LOG/setuid.today
 fi
 rm -f $TMP
        mv $TMP $LOG/setuid.today
 fi
 rm -f $TMP
-fi
 
 echo ""
 echo ""
 
 echo ""
 echo ""