1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-27 23:56:38 +02:00

Add allow::options::sasl (or require-sasl) to require SASL authentication

as suggested in https://bugs.unrealircd.org/view.php?id=5098
The allow block documentation has been updated, including an example at
the end of the page - https://www.unrealircd.org/docs/Allow_block
This commit is contained in:
Bram Matthys
2018-06-11 08:22:29 +02:00
parent 46a60ec795
commit cd6d7a2bb7
3 changed files with 9 additions and 2 deletions
+1
View File
@@ -1024,6 +1024,7 @@ struct _configflag_allow {
unsigned useip :1;
unsigned ssl :1;
unsigned nopasscont :1;
unsigned sasl :1;
};
struct _configitem_allow {
+2
View File
@@ -1712,6 +1712,8 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
continue;
if (aconf->flags.ssl && !IsSecure(cptr))
continue;
if (aconf->flags.sasl && (!*cptr->user->svid || isdigit(*cptr->user->svid)))
continue;
if (hp && hp->h_name)
{
hname = hp->h_name;
+6 -2
View File
@@ -4932,8 +4932,10 @@ int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
allow->flags.noident = 1;
else if (!strcmp(cepp->ce_varname, "useip"))
allow->flags.useip = 1;
else if (!strcmp(cepp->ce_varname, "ssl"))
else if (!strcmp(cepp->ce_varname, "ssl") || !strcmp(cepp->ce_varname, "require-ssl"))
allow->flags.ssl = 1;
else if (!strcmp(cepp->ce_varname, "sasl") || !strcmp(cepp->ce_varname, "require-sasl"))
allow->flags.sasl = 1;
else if (!strcmp(cepp->ce_varname, "nopasscont"))
allow->flags.nopasscont = 1;
}
@@ -5131,7 +5133,9 @@ int _test_allow(ConfigFile *conf, ConfigEntry *ce)
{}
else if (!strcmp(cepp->ce_varname, "useip"))
{}
else if (!strcmp(cepp->ce_varname, "ssl"))
else if (!strcmp(cepp->ce_varname, "ssl") || !strcmp(cepp->ce_varname, "require-ssl"))
{}
else if (!strcmp(cepp->ce_varname, "sasl") || !strcmp(cepp->ce_varname, "require-sasl"))
{}
else if (!strcmp(cepp->ce_varname, "nopasscont"))
{}