Handle case where the root user for testing PAM has no password https://github.com/webmin/webmin/issues/1911

This commit is contained in:
Jamie Cameron
2023-05-20 16:26:54 -07:00
parent ab44aa8023
commit 3996ff205f

View File

@@ -154,8 +154,9 @@ elsif (!$config{'no_pam'}) {
$pam_conv_func_called = 0;
$pam_username = "test";
$pam_password = "test";
$pamh->pam_authenticate();
if ($pam_conv_func_called) {
my $pam_ret = $pamh->pam_authenticate();
if ($pam_conv_func_called ||
$pam_ret == PAM_SUCCESS()) {
push(@startup_msg,
"PAM authentication enabled");
$use_pam = 1;