Commit | Line | Data |
---|---|---|
25767e9e RG |
1 | #!/bin/sh - |
2 | # | |
3 | # @(#)security 5.3 (Berkeley) 5/28/91 | |
b7d87264 | 4 | # $Id$ |
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 | ||
b7d87264 RG |
14 | umask 027 |
15 | ||
25767e9e | 16 | echo "checking setuid files and devices:" |
b7d87264 RG |
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 | # add this after -a when find supports isofs, and you don't want to check | |
23 | # your cd roms | |
24 | # \( ! \( -fstype isofs \) -o -prune \) \ | |
25 | # do skip checking cdroms | |
26 | ||
27 | find / -fstype local -a \ | |
28 | \( -perm -u+s -or -perm -g+s \) | \ | |
29 | sed -e "/\/dev\//d" -e "s;//;/;g" | sort | xargs -n 20 ls -lgT > $TMP | |
30 | ||
31 | ||
32 | #MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $1 " " $3 }'` | |
33 | #set $MP | |
34 | #ls -lgT `while test $# -ge 2; do | |
35 | # device=$1 | |
36 | # shift | |
37 | # mount=$1 | |
38 | # shift | |
39 | # ncheck -s $device | sed -e "/:$/d" -e "/\/dev\//d" \ | |
40 | # -e "s;[^/]*;$mount;" -e "s;//;/;g" | sort | |
41 | #done` > $TMP | |
25767e9e RG |
42 | |
43 | if cmp $LOG/setuid.today $TMP >/dev/null; then :; else | |
44 | echo "$host setuid/device diffs:" | |
45 | diff $LOG/setuid.today $TMP | |
46 | mv $LOG/setuid.today $LOG/setuid.yesterday | |
47 | mv $TMP $LOG/setuid.today | |
48 | fi | |
49 | rm -f $TMP | |
50 | ||
51 | echo "" | |
52 | echo "" | |
53 | echo "checking for uids of 0:" | |
54 | awk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd |