#!/bin/sh
#
#  This just searches for rhosts with a + in them... needs to be run
# as root to be effective (to access each user's rhosts file; run on
# your NFS server if applicable), but might be plugged into the rest of
# cops if you run things as root normally...

(ypcat passwd; cat /etc/passwd) | awk -F: '{print $1, $(NF-1)}' |
while read user dir ; do
	target="$dir/.rhosts"
	if test -s "$target" ; then
		grep "+" "$target" > /dev/null
		if test "$?" = "0" ; then
			echo "Warning!  A plus ("+") was found in $user's .rhosts file!"
			fi
		fi
	done

