1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 11:33:13 +02:00

allow channel: Permit multiple channel items in one block again, was broken by patch from #4125.

This commit is contained in:
Bram Matthys
2013-01-11 19:05:36 +01:00
parent e6f9504ded
commit e1ebbf88ed
+13 -6
View File
@@ -5161,20 +5161,27 @@ int _conf_allow_channel(ConfigFile *conf, ConfigEntry *ce)
{
ConfigItem_allow_channel *allow = NULL;
ConfigEntry *cep;
char *class = NULL;
/* First, search for ::class, if any */
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
{
if (!strcmp(cep->ce_varname, "class"))
class = cep->ce_vardata;
}
allow = MyMallocEx(sizeof(ConfigItem_allow_channel));
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
{
if (!strcmp(cep->ce_varname, "channel"))
{
/* This way, we permit multiple ::channel items in one allow block */
allow = MyMallocEx(sizeof(ConfigItem_allow_channel));
ircstrdup(allow->channel, cep->ce_vardata);
}
else if (!strcmp(cep->ce_varname, "class"))
{
ircstrdup(allow->class, cep->ce_vardata);
if (class)
ircstrdup(allow->class, class);
AddListItem(allow, conf_allow_channel);
}
}
AddListItem(allow, conf_allow_channel);
return 1;
}