1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 14:53:12 +02:00

Make allow {} block always continue when there were no password or wrong password was specified.

This commit is contained in:
i
2019-07-18 18:47:05 +03:00
parent c9908a55c9
commit 8c11ebd0e7
4 changed files with 4 additions and 13 deletions
-1
View File
@@ -156,7 +156,6 @@ struct zConfiguration {
long handshake_timeout;
long handshake_delay;
int ban_include_username;
char *reject_message_password_mismatch;
char *reject_message_too_many_connections;
char *reject_message_server_full;
char *reject_message_unauthorized;
-1
View File
@@ -1091,7 +1091,6 @@ struct _configflag_allow {
unsigned noident :1;
unsigned useip :1;
unsigned ssl :1;
unsigned nopasscont :1;
};
struct _configitem_allow {
+3 -2
View File
@@ -1711,7 +1711,7 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
{
if (!aconf->hostname || !aconf->ip)
goto attach;
if (aconf->auth && !cptr->local->passwd && aconf->flags.nopasscont)
if (aconf->auth && !cptr->local->passwd)
continue;
if (aconf->flags.ssl && !IsSecure(cptr))
continue;
@@ -1800,7 +1800,8 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
}
if ((i = Auth_Check(cptr, aconf->auth, cptr->local->passwd)) == -1)
{
return exit_client(cptr, cptr, &me, NULL, iConf.reject_message_password_mismatch);
/* Always do continue if password was wrong. */
continue;
}
if ((i == 2) && (cptr->local->passwd))
{
+1 -9
View File
@@ -1464,7 +1464,6 @@ void free_iConf(aConfiguration *i)
safefree(i->link_bindip);
safefree(i->outdated_tls_policy_user_message);
safefree(i->outdated_tls_policy_oper_message);
safefree(i->reject_message_password_mismatch);
safefree(i->reject_message_too_many_connections);
safefree(i->reject_message_server_full);
safefree(i->reject_message_unauthorized);
@@ -1553,7 +1552,6 @@ void config_setdefaultsettings(aConfiguration *i)
i->outdated_tls_policy_oper = POLICY_DENY;
i->outdated_tls_policy_server = POLICY_DENY;
i->reject_message_password_mismatch = strdup("Password mismatch");
i->reject_message_too_many_connections = strdup("Too many connections from your IP");
i->reject_message_server_full = strdup("This server is full");
i->reject_message_unauthorized = strdup("You are not authorized to connect to this server");
@@ -5084,8 +5082,6 @@ int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
allow->flags.useip = 1;
else if (!strcmp(cepp->ce_varname, "ssl"))
allow->flags.ssl = 1;
else if (!strcmp(cepp->ce_varname, "nopasscont"))
allow->flags.nopasscont = 1;
}
}
}
@@ -5292,8 +5288,6 @@ int _test_allow(ConfigFile *conf, ConfigEntry *ce)
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
errors++;
}
else if (!strcmp(cepp->ce_varname, "nopasscont"))
{}
else
{
config_error_unknownopt(cepp->ce_fileptr->cf_filename,
@@ -7818,9 +7812,7 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
{
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
if (!strcmp(cepp->ce_varname, "password-mismatch"))
safestrdup(tempiConf.reject_message_password_mismatch, cepp->ce_vardata);
else if (!strcmp(cepp->ce_varname, "too-many-connections"))
if (!strcmp(cepp->ce_varname, "too-many-connections"))
safestrdup(tempiConf.reject_message_too_many_connections, cepp->ce_vardata);
else if (!strcmp(cepp->ce_varname, "server-full"))
safestrdup(tempiConf.reject_message_server_full, cepp->ce_vardata);