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:
parent
8d856664eb
commit
489fa148a1
@ -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:");
|
||||
|
Loading…
Reference in New Issue
Block a user