commit - 3e4ca16dc245727c64f23494636601c29fd07643
commit + b932baab5240d80512406e660efece151add0d9d
blob - 3412e337a75e6e63a1ef03afd098c1e173878814
blob + 75f8594023ff15f49142a2b0a0d319ea3b243c41
--- src/ngircd/login.c
+++ src/ngircd/login.c
/* Don't do any PAM authentication at all if PAM is not
* enabled, instead emulate the behavior of the daemon
* compiled without PAM support. */
- if (strcmp(Conn_Password(conn), Conf_ServerPwd) == 0)
+ if (Conf_ServerPwd[0] == 0 ||
+ strcmp(Conn_Password(conn), Conf_ServerPwd) == 0)
return Login_User_PostAuth(Client);
Client_Reject(Client, "Bad server password", false);
return DISCONNECTED;
} else return CONNECTED;
#else
/* Check global server password ... */
- if (strcmp(Conn_Password(conn), Conf_ServerPwd) != 0) {
+ if (Conf_ServerPwd[0] != 0 &&
+ strcmp(Conn_Password(conn), Conf_ServerPwd) != 0) {
/* Bad password! */
Client_Reject(Client, "Bad server password", false);
return DISCONNECTED;