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

Fixed a bug where an ident in a vhost {} was never sent out to other servers and added user@host support for set::hosts

This commit is contained in:
codemastr
2004-07-06 21:55:34 +00:00
parent 791152587c
commit 3f9d00a84d
5 changed files with 84 additions and 8 deletions
+13 -1
View File
@@ -270,7 +270,19 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
sptr->oflag = aconf->oflags;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(host)) {
iNAH_host(sptr, host);
char *c;
char *vhost = host;
if ((c = strchr(host, '@')))
{
vhost = c+1;
strncpy(sptr->user->username, host, c-host);
sptr->user->username[c-host] = 0;
sendto_serv_butone_token(NULL, sptr->name, MSG_SETIDENT,
TOK_SETIDENT, "%s",
sptr->user->username);
}
iNAH_host(sptr, vhost);
SetHidden(sptr);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
+3 -1
View File
@@ -175,12 +175,14 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (vhost->virtuser) {
strcpy(olduser, sptr->user->username);
strlcpy(sptr->user->username, vhost->virtuser, USERLEN);
sendto_serv_butone_token(cptr, sptr->name, MSG_SETIDENT, TOK_SETIDENT,
"%s", sptr->user->username);
}
sptr->umodes |= UMODE_HIDE;
sptr->umodes |= UMODE_SETHOST;
sendto_serv_butone_token(cptr, sptr->name,
MSG_SETHOST, TOK_SETHOST,
"%s", vhost->virthost);
"%s", sptr->user->virthost);
sendto_one(sptr, ":%s MODE %s :+tx",
sptr->name, sptr->name);
if (vhost->swhois) {
+55
View File
@@ -6489,6 +6489,7 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cep->ce_varname, "hosts")) {
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
char *c, *host;
if (!cepp->ce_vardata)
{
config_error("%s:%i: set::hosts item without value",
@@ -6526,6 +6527,60 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
continue;
}
if ((c = strchr(cepp->ce_vardata, '@')))
{
char *tmp;
if (!(*(c+1)) || (c-cepp->ce_vardata) > USERLEN ||
c == cepp->ce_vardata)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
for (tmp = cepp->ce_vardata; tmp != c; tmp++)
{
if (*tmp == '~' && tmp == cepp->ce_vardata)
continue;
if (!isallowed(*tmp))
break;
}
if (tmp != c)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
host = c+1;
}
else
host = cepp->ce_vardata;
if (strlen(host) > HOSTLEN)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
for (; *host; host++)
{
if (!isallowed(*host) && *host != ':')
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
}
}
}
else if (!strcmp(cep->ce_varname, "cloak-keys"))