Commit | Line | Data |
---|---|---|
25767e9e RG |
1 | #!/bin/sh - |
2 | # | |
3 | # @(#)security 5.3 (Berkeley) 5/28/91 | |
78ed81a3 | 4 | # $Id: security,v 1.3 1993/09/06 23:12:04 rgrimes Exp $ |
25767e9e RG |
5 | # |
6 | PATH=/sbin:/bin:/usr/bin | |
7 | ||
8 | host=`hostname -s` | |
9 | echo "Subject: $host security check output" | |
10 | ||
11 | LOG=/var/log | |
12 | TMP=/tmp/_secure.$$ | |
13 | ||
78ed81a3 | 14 | umask 027 |
15 | ||
25767e9e | 16 | echo "checking setuid files and devices:" |
78ed81a3 | 17 | |
18 | # don't have ncheck, but this does the equivalent of the commented out block. | |
19 | # note that one of the original problem, the possibility of overrunning | |
20 | # the args to ls, is still here... | |
21 | # | |
22 | MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $3 }'` | |
25767e9e | 23 | set $MP |
78ed81a3 | 24 | ls -lgT `while test $# -ge 1; do |
25767e9e RG |
25 | mount=$1 |
26 | shift | |
78ed81a3 | 27 | find $mount -xdev -perm -u+s -or -perm -g+s | sort |
25767e9e RG |
28 | done` > $TMP |
29 | ||
78ed81a3 | 30 | #MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'` |
31 | #set $MP | |
32 | #ls -lgT `while test $# -ge 2; do | |
33 | # device=$1 | |
34 | # shift | |
35 | # mount=$1 | |
36 | # shift | |
37 | # ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \ | |
38 | # -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort | |
39 | #done` > $TMP | |
40 | ||
25767e9e RG |
41 | if cmp $LOG/setuid.today $TMP >/dev/null; then :; else |
42 | echo "$host setuid/device diffs:" | |
43 | diff $LOG/setuid.today $TMP | |
44 | mv $LOG/setuid.today $LOG/setuid.yesterday | |
45 | mv $TMP $LOG/setuid.today | |
46 | fi | |
47 | rm -f $TMP | |
48 | ||
49 | echo "" | |
50 | echo "" | |
51 | echo "checking for uids of 0:" | |
52 | awk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd |