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.
This commit is contained in:
Dima Ruban 1995-11-10 07:06:59 +00:00
parent cf01259085
commit 28b2e97b28

View File

@ -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:");