Commit | Line | Data |
---|---|---|
25767e9e RG |
1 | #!/bin/sh - |
2 | # | |
3 | # @(#)security 5.3 (Berkeley) 5/28/91 | |
2326e072 | 4 | # $Id: security,v 1.5 1993/12/15 06:42:01 rich 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 | ||
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 | # | |
43d152a3 RG |
22 | MP=`mount -t ufs | sed 's;/dev/;&r;' | awk '{ print $3 }'` |
23 | set $MP | |
2326e072 | 24 | while test $# -ge 1; do |
43d152a3 RG |
25 | mount=$1 |
26 | shift | |
27 | find $mount -xdev -perm -u+s -or -perm -g+s | sort | |
2326e072 | 28 | done | xargs -n 20 ls -lgTd > $TMP |
25767e9e RG |
29 | |
30 | if cmp $LOG/setuid.today $TMP >/dev/null; then :; else | |
31 | echo "$host setuid/device diffs:" | |
32 | diff $LOG/setuid.today $TMP | |
33 | mv $LOG/setuid.today $LOG/setuid.yesterday | |
34 | mv $TMP $LOG/setuid.today | |
35 | fi | |
36 | rm -f $TMP | |
37 | ||
38 | echo "" | |
39 | echo "" | |
40 | echo "checking for uids of 0:" | |
41 | awk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd |