Minor cleanup.
This commit is contained in:
parent
4a0848acd9
commit
df1a64b9f5
20
etc/security
20
etc/security
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $NetBSD: security,v 1.19 1997/04/21 11:14:41 mycroft Exp $
|
||||
# $NetBSD: security,v 1.20 1997/04/21 11:19:57 mycroft Exp $
|
||||
# from: @(#)security 8.1 (Berkeley) 6/9/93
|
||||
#
|
||||
|
||||
|
@ -35,7 +35,7 @@ trap 'rm -rf $SECUREDIR' 0
|
|||
MP=/etc/master.passwd
|
||||
|
||||
# this is used several times.
|
||||
awk -F: '{ print $1 " " $3 }' $MP | sort -n +1 > $TMP1
|
||||
awk -F: '{ print $1 " " $3 }' $MP | sort -k2n > $TMP1
|
||||
|
||||
# Check the master password file syntax.
|
||||
if [ "$check_passwd" = YES ]; then
|
||||
|
@ -254,7 +254,7 @@ if [ "$check_rhosts" = YES ]; then
|
|||
# have .rhosts files. Also, .rhosts files should not have plus signs.
|
||||
awk -F: '$1 != "root" && $1 != "toor" && \
|
||||
($3 < 100 || $1 == "ftp" || $1 == "uucp") \
|
||||
{ print $1 " " $9 }' /etc/master.passwd |
|
||||
{ print $1 " " $9 }' $MP |
|
||||
sort -k2 |
|
||||
while read uid homedir; do
|
||||
if [ -f ${homedir}/.rhosts ] ; then
|
||||
|
@ -267,7 +267,7 @@ if [ "$check_rhosts" = YES ]; then
|
|||
cat $OUTPUT
|
||||
fi
|
||||
|
||||
awk -F: '{ print $1 " " $9 }' /etc/master.passwd |
|
||||
awk -F: '{ print $1 " " $9 }' $MP |
|
||||
sort -k2 |
|
||||
while read uid homedir; do
|
||||
if [ -f ${homedir}/.rhosts ] && \
|
||||
|
@ -284,7 +284,7 @@ fi
|
|||
# Check home directories. Directories should not be owned by someone else
|
||||
# or writeable.
|
||||
if [ "$check_homes" = YES ]; then
|
||||
awk -F: '{ print $1 " " $9 }' /etc/master.passwd |
|
||||
awk -F: '{ print $1 " " $9 }' $MP |
|
||||
sort -k2 |
|
||||
while read uid homedir; do
|
||||
if [ -d ${homedir}/ ] ; then
|
||||
|
@ -305,7 +305,7 @@ if [ "$check_homes" = YES ]; then
|
|||
|
||||
# Files that should not be owned by someone else or readable.
|
||||
list=".Xauthority .netrc .rhosts"
|
||||
awk -F: '{ print $1 " " $9 }' /etc/master.passwd |
|
||||
awk -F: '{ print $1 " " $9 }' $MP |
|
||||
sort -k2 |
|
||||
while read uid homedir; do
|
||||
for f in $list ; do
|
||||
|
@ -330,7 +330,7 @@ if [ "$check_homes" = YES ]; then
|
|||
list=".bash_history .bash_login .bash_logout .bash_profile .bashrc \
|
||||
.cshrc .emacs .exrc .forward .history .klogin .login .logout \
|
||||
.profile .qmail .rc_history .tcshrc .twmrc .xinitrc .xsession"
|
||||
awk -F: '{ print $1 " " $9 }' /etc/master.passwd |
|
||||
awk -F: '{ print $1 " " $9 }' $MP |
|
||||
sort -k2 |
|
||||
while read uid homedir; do
|
||||
for f in $list ; do
|
||||
|
@ -435,7 +435,7 @@ if [ "$check_devices" = YES ]; then
|
|||
printf "\n"
|
||||
fi
|
||||
|
||||
sort +9 $TMP2 $CUR $TMP1 | \
|
||||
sort -k10 $TMP2 $CUR $TMP1 | \
|
||||
sed -e 's/[ ][ ]*/ /g' | uniq -u > $OUTPUT
|
||||
if [ -s $OUTPUT ] ; then
|
||||
printf "Setuid changes:\n"
|
||||
|
@ -473,7 +473,7 @@ if [ "$check_devices" = YES ]; then
|
|||
fi
|
||||
|
||||
# Display any changes in the device file list.
|
||||
egrep '^[bc]' $LIST | sort +10 > $TMP1
|
||||
egrep '^[bc]' $LIST | sort -k11 > $TMP1
|
||||
if [ -s $TMP1 ] ; then
|
||||
CUR=/var/backups/device.current
|
||||
BACK=/var/backups/device.backup
|
||||
|
@ -501,7 +501,7 @@ if [ "$check_devices" = YES ]; then
|
|||
# devices, only the name is significant.
|
||||
cat $TMP2 $CUR $TMP1 | \
|
||||
sed -e '/^c/d' | \
|
||||
sort +10 | \
|
||||
sort -k11 | \
|
||||
sed -e 's/[ ][ ]*/ /g' | \
|
||||
uniq -u > $OUTPUT
|
||||
if [ -s $OUTPUT ] ; then
|
||||
|
|
Loading…
Reference in New Issue