summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordima <dima@FreeBSD.org>1995-11-10 07:06:59 +0000
committerdima <dima@FreeBSD.org>1995-11-10 07:06:59 +0000
commitb6116933b0882aad18d1aaf801bb6875acf65ae4 (patch)
treea80f5c2652b581e5e6457364b84c9a2f367ef78e /sbin
parent70c7dfce61eae3c610b0b2617125216903fff67f (diff)
downloadFreeBSD-src-b6116933b0882aad18d1aaf801bb6875acf65ae4.zip
FreeBSD-src-b6116933b0882aad18d1aaf801bb6875acf65ae4.tar.gz
If root does not have a password, `init' should not ask to enter it.
otherwise it's not possible to get into single-user mode, if root does not have password and console insecure.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/init/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index a149672..6ea6233 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -593,7 +593,7 @@ single_user()
*/
typ = getttynam("console");
pp = getpwnam("root");
- if (typ && (typ->ty_status & TTY_SECURE) == 0 && pp) {
+ if (typ && (typ->ty_status & TTY_SECURE) == 0 && pp && *pp->pw_passwd) {
write(2, banner, sizeof banner - 1);
for (;;) {
clear = getpass("Password:");
OpenPOWER on IntegriCloud