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 1995-11-10 07:06:59 +00:00
parent 8d856664eb
commit 489fa148a1

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