diff options
author | 2014-01-03 22:29:00 +0000 | |
---|---|---|
committer | 2014-01-03 22:29:00 +0000 | |
commit | ec7f310b99a4ac0dc26c439d0aaabad23a5411f5 (patch) | |
tree | 9e93670aad5a0271c35dc5b023ee1c9f1a4b6664 | |
parent | Purging a queue requires it to be non-empty, not empty. (diff) | |
download | wireguard-openbsd-ec7f310b99a4ac0dc26c439d0aaabad23a5411f5.tar.xz wireguard-openbsd-ec7f310b99a4ac0dc26c439d0aaabad23a5411f5.zip |
Do not raise the securelevel when transitioning from catatonia to
multiuser since we are not actually going multiuser. Fixes a problem
where the securelevel was raised for rc.shutdown even when reboot
was run from single user mode. OK deraadt@
-rw-r--r-- | sbin/init/init.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 7f632afd481..b87b2b2a4fd 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.48 2013/02/11 15:52:42 millert Exp $ */ +/* $OpenBSD: init.c,v 1.49 2014/01/03 22:29:00 millert Exp $ */ /* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */ /*- @@ -1165,16 +1165,18 @@ multi_user(void) pid_t pid; session_t *sp; - requested_transition = 0; - /* * If the administrator has not set the security level to -1 * to indicate that the kernel should not run multiuser in secure * mode, and the run script has not set a higher level of security * than level 1, then put the kernel into secure mode. */ - if (getsecuritylevel() == 0) - setsecuritylevel(1); + if (requested_transition != catatonia) { + if (getsecuritylevel() == 0) + setsecuritylevel(1); + } + + requested_transition = 0; for (sp = sessions; sp; sp = sp->se_next) { if (sp->se_process) |