Made vhost {} use from {} for hosts

This commit is contained in:
codemastr 2001-01-21 19:04:36 +00:00
parent 8228a15f14
commit 42a9e91f1b
3 changed files with 40 additions and 8 deletions

View file

@ -110,3 +110,4 @@
- Fixed a #undef USE_SSL problem found by codemastr.. caused by
Sts(TM)coding
- Added set {} (unrealircd.conf/network file replacement)
- Made vhost {} use from {} for hosts

View file

@ -1051,7 +1051,7 @@ struct _configitem_vhost {
ConfigFlag flag;
ConfigItem *prev;
ConfigItem *next;
char *userhost;
ConfigItem *from;
char *login;
char *password;
char *virthost;

View file

@ -1356,10 +1356,10 @@ int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
*/
int _conf_vhost(ConfigFile *conf, ConfigEntry *ce)
{
ConfigEntry *cep;
ConfigEntry *cep, *cepp;
ConfigItem_vhost *vhost;
unsigned char isnew = 0;
ConfigItem_oper_from *from;
vhost = (ConfigItem_vhost *) MyMallocEx(sizeof(ConfigItem_vhost));
isnew = 1;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
@ -1379,11 +1379,42 @@ int _conf_vhost(ConfigFile *conf, ConfigEntry *ce)
if (!strcmp(cep->ce_varname, "vhost"))
{
vhost->virthost = strdup(cep->ce_vardata);
} else
if (!strcmp(cep->ce_varname, "userhost"))
{
vhost->userhost = strdup(cep->ce_vardata);
} else
}
else if (!strcmp(cep->ce_varname, "from"))
{
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
if (!cepp->ce_varname)
{
config_error("%s:%i: vhost::from item without variable name",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
continue;
}
if (!cepp->ce_vardata)
{
config_error("%s:%i: vhost::from::%s without parameter",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
continue;
}
if (!strcmp(cepp->ce_varname, "userhost"))
{
from = (ConfigItem_oper_from *)MyMallocEx(sizeof(ConfigItem_oper_from));
ircstrdup(from->name, cepp->ce_vardata);
add_ConfigItem((ConfigItem *) from, (ConfigItem **)&vhost->from);
}
else
{
config_error("%s:%i: unknown directive vhost::from::%s",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
cepp->ce_varname);
continue;
}
}
continue;
}
else
if (!strcmp(cep->ce_varname, "login"))
{
vhost->login = strdup(cep->ce_vardata);