>From: Drew Hess <dhess@CS.Stanford.EDU>
[unix-history] / etc / security
CommitLineData
25767e9e
RG
1#!/bin/sh -
2#
3# @(#)security 5.3 (Berkeley) 5/28/91
b7d87264 4# $Id$
25767e9e
RG
5#
6PATH=/sbin:/bin:/usr/bin
7
8host=`hostname -s`
9echo "Subject: $host security check output"
10
11LOG=/var/log
12TMP=/tmp/_secure.$$
13
b7d87264
RG
14umask 027
15
25767e9e 16echo "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
27find / -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
43if 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
48fi
49rm -f $TMP
50
51echo ""
52echo ""
53echo "checking for uids of 0:"
54awk 'BEGIN {FS=":"} $3=="0" {print $1,$3}' /etc/master.passwd