check sshd uid/gid, as well as /var/empty

This commit is contained in:
itojun 2002-05-14 23:35:35 +00:00
parent d6f9a400fe
commit 2d4044e40b
1 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: postinstall,v 1.13 2002/05/14 22:41:36 thorpej Exp $
# $NetBSD: postinstall,v 1.14 2002/05/14 23:35:35 itojun Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
@ -379,6 +379,11 @@ do_ssh()
fi
fi
if [ ! -d /var/empty ]; then
msg "/var/empty has to be present."
failed=1
fi
if rcconf_isset sshd sshd_conf_dir ; then
failed=1
fi
@ -424,6 +429,7 @@ do_uid()
_named=0
_ntpd=0
_sshd=0
while read _name _junk; do
if [ "$_name" = "named" ]; then
_named=1
@ -431,6 +437,9 @@ do_uid()
if [ "$_name" = "ntpd" ]; then
_ntpd=1
fi
if [ "$_name" = "sshd" ]; then
_sshd=1
fi
done < ${DEST_DIR}/etc/passwd
if [ "$_named" = "0" ]; then
@ -441,6 +450,10 @@ do_uid()
msg "Required UID ntpd is not found."
failed=1
fi
if [ "$_sshd" = "0" ]; then
msg "Required UID sshd is not found."
failed=1
fi
IFS="$_oIFS"
return ${failed}
@ -461,6 +474,7 @@ do_gid()
_named=0
_ntpd=0
_sshd=0
while read _name _junk; do
if [ "$_name" = "named" ]; then
_named=1
@ -468,6 +482,9 @@ do_gid()
if [ "$_name" = "ntpd" ]; then
_ntpd=1
fi
if [ "$_name" = "sshd" ]; then
_sshd=1
fi
done < ${DEST_DIR}/etc/group
if [ "$_named" = "0" ]; then
@ -478,6 +495,10 @@ do_gid()
msg "Required GID ntpd is not found."
failed=1
fi
if [ "$_sshd" = "0" ]; then
msg "Required GID sshd is not found."
failed=1
fi
IFS="$_oIFS"
return ${failed}