Browse Source

Use kern.securelevel to determine whether or not we are in single

user mode now that init no longer raises securelevel during reboot.
OK deraadt@
OPENBSD_5_5
millert 10 years ago
parent
commit
05f4462266
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      src/etc/rc

+ 3
- 6
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.418 2013/12/28 01:00:18 deraadt Exp $
# $OpenBSD: rc,v 1.419 2014/01/03 23:24:19 millert Exp $
# System startup script run by init on autoboot # System startup script run by init on autoboot
# or after single-user. # or after single-user.
@ -232,11 +232,8 @@ fi
if [ X"$1" = X"shutdown" ]; then if [ X"$1" = X"shutdown" ]; then
random_seed random_seed
# XXX If root is writeable, assume we are not single user
chmod 600 /etc/random.seed >/dev/null 2>&1
_notsingle=$?
if [ ${_notsingle} -eq 0 ]; then
# If we are in secure level 0, assume single user mode.
if [ `sysctl -n kern.securelevel` -ne 0 ]; then
if [ -n "${pkg_scripts}" ]; then if [ -n "${pkg_scripts}" ]; then
echo -n 'stopping package daemons:' echo -n 'stopping package daemons:'
while [ -n "${pkg_scripts}" ]; do while [ -n "${pkg_scripts}" ]; do


Loading…
Cancel
Save