Add a menu entry to sushi to deal with editing the /etc/security.conf file.

This commit is contained in:
garbled 2001-03-06 21:24:12 +00:00
parent a3e0c8a6d8
commit 2544d3c650
7 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2001/03/06 21:24:12 garbled Exp $
FILES= form help
FILESDIR=${BINDIR}/sushi/system/securityconf
SCRIPTS= script script1 script2 script3
SCRIPTSDIR=${BINDIR}/sushi/system/securityconf
MKOBJ= no
.include "../../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -0,0 +1,17 @@
# $NetBSD: form,v 1.1 2001/03/06 21:24:12 garbled Exp $
script:script1,check_passwd Check the passwd file for inconsistancies?
script:script1,check_group Check the group file for inconsistancies?
script:script1,check_rootdotfiles Check root users for sane $PATH/umask?
script:script1,check_ftpusers Check the ftpusers file?
script:script1,check_aliases Check the sendmail aliases file?
script:script1,check_rhosts Check for users with a '+' in .rhosts?
script:script1,check_homes Check ownership of home directories?
script:script1,check_varmail Check the ownership of /var/mail?
script:script1,check_nfs Check that filesystems aren't exported to world?
script:script1,check_devices Check for changes to devices and setuid files?
script:script1,check_mtree Check all system binaries?
script:script1,check_disklabels Backup disklabels and display changes?
script:script1,check_changelist Backup config files and display changes?
script:script1,run_skeyaudit Check for expiring S/Keys?
iscript:2,1,99,script2,max_loginlen Maximum permitted length of login names:

View File

@ -0,0 +1,7 @@
The security.conf file specifies which of the standard /etc/security
services are performed. The /etc/security script is run, by default,
every night from /etc/daily, on a NetBSD system, if configured do to so
from /etc/daily.conf. See the security.conf(5) manpage for details on the
options.
$NetBSD: help,v 1.1 2001/03/06 21:24:12 garbled Exp $

View File

@ -0,0 +1,27 @@
#!/bin/sh
# $NetBSD: script,v 1.1 2001/03/06 21:24:13 garbled Exp $
. /etc/defaults/security.conf
pwd
CONFFILE="/etc/security.conf"
echo -n "#Generated by sushi on " >$CONFFILE
date >>$CONFFILE
echo "if [ -r /etc/defaults/security.conf ]; then" >>$CONFFILE
echo " . /etc/defaults/security.conf" >>$CONFFILE
echo "fi" >>$CONFFILE
a=1
IFS="
"
for i in `/usr/share/sushi/system/securityconf/script3`
do
ANS=$(echo `eval echo \\$${a}` | sed -e 's/ $//' | sed -e 's/^0*//')
if [ "$ANS" != "`eval echo \\$${i}`" ]; then
if [ "$ANS" = "YES" -o "$ANS" = "NO" ]; then
echo "$i=$ANS" >>$CONFFILE
else
echo "$i=\"$ANS\"" >>$CONFFILE
fi
fi
a=`expr $a + 1`
done
echo "successfully wrote a new $CONFFILE"
cat $CONFFILE

View File

@ -0,0 +1,10 @@
#!/bin/sh
# $NetBSD: script1,v 1.1 2001/03/06 21:24:13 garbled Exp $
. /etc/security.conf
CONF=`eval echo \\$${1}`
echo $CONF
if [ "$CONF" = "YES" ]; then
echo "NO"
else
echo "YES"
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
# $NetBSD: script2,v 1.1 2001/03/06 21:24:13 garbled Exp $
. /etc/security.conf
echo `eval echo \\$${1}` | sed -e 's/^0*//'

View File

@ -0,0 +1,6 @@
#!/bin/sh
# $NetBSD: script3,v 1.1 2001/03/06 21:24:13 garbled Exp $
sh -x /etc/defaults/security.conf 2>&1 | sed -e 's/^+ //' | \
sed -e 's/\([EN][SO]\) /\1\
/' | sed -e 's/=.*//'
# the newline above is there for a reason