mirror of
https://github.com/osmarks/ngircd.git
synced 2025-07-06 11:52:50 +00:00
Don't even fork a PAM-subprocess if "NoPAM" option is set
This commit is contained in:
parent
57a2faf4a7
commit
6131822af6
@ -778,6 +778,17 @@ Hello_User(CLIENT * Client)
|
|||||||
assert(Client != NULL);
|
assert(Client != NULL);
|
||||||
conn = Client_Conn(Client);
|
conn = Client_Conn(Client);
|
||||||
|
|
||||||
|
if (Conf_NoPAM) {
|
||||||
|
/* Don't do any PAM authentication at all, instead emulate
|
||||||
|
* the beahiour of the daemon compiled without PAM support:
|
||||||
|
* because there can't be any "server password", all
|
||||||
|
* passwords supplied are classified as "wrong". */
|
||||||
|
if(Client_Password(Client)[0] == '\0')
|
||||||
|
return Hello_User_PostAuth(Client);
|
||||||
|
Reject_Client(Client);
|
||||||
|
return DISCONNECTED;
|
||||||
|
}
|
||||||
|
|
||||||
pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, cb_Read_Auth_Result);
|
pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, cb_Read_Auth_Result);
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
LogDebug("Authenticator for connection %d created (PID %d).",
|
LogDebug("Authenticator for connection %d created (PID %d).",
|
||||||
@ -786,9 +797,6 @@ Hello_User(CLIENT * Client)
|
|||||||
} else {
|
} else {
|
||||||
/* Sub process */
|
/* Sub process */
|
||||||
Log_Init_Subprocess("Auth");
|
Log_Init_Subprocess("Auth");
|
||||||
if (Conf_NoPAM) {
|
|
||||||
result = (Client_Password(Client)[0] == '\0');
|
|
||||||
} else
|
|
||||||
result = PAM_Authenticate(Client);
|
result = PAM_Authenticate(Client);
|
||||||
write(pipefd[1], &result, sizeof(result));
|
write(pipefd[1], &result, sizeof(result));
|
||||||
Log_Exit_Subprocess("Auth");
|
Log_Exit_Subprocess("Auth");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user