From 489fa148a1d61cce8b6fe3f43064161105745d55 Mon Sep 17 00:00:00 2001 From: dima Date: Fri, 10 Nov 1995 07:06:59 +0000 Subject: [PATCH] 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. --- sbin/init/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/init/init.c b/sbin/init/init.c index a149672c495e..6ea623324e88 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:");