m_webirc: Blow away ident if we've got it
Previously, anyone on the WEBIRC gateway would get its ident if it advertised one, which seems wrong to me. This allows ident to be used with WEBIRC while still letting users send their own ~username in band.
This commit is contained in:
parent
05e3afc87e
commit
861a544541
2 changed files with 12 additions and 2 deletions
|
@ -75,8 +75,8 @@ DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, webirc_hfnlist, NULL,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mr_webirc - webirc message handler
|
* mr_webirc - webirc message handler
|
||||||
* parv[1] = password
|
* parv[1] = password
|
||||||
* parv[2] = fake username (we ignore this)
|
* parv[2] = fake username (we ignore this)
|
||||||
* parv[3] = fake hostname
|
* parv[3] = fake hostname
|
||||||
* parv[4] = fake ip
|
* parv[4] = fake ip
|
||||||
*/
|
*/
|
||||||
|
@ -89,13 +89,20 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
|
||||||
|
|
||||||
int secure = 0;
|
int secure = 0;
|
||||||
|
|
||||||
|
if (source_p->flags & FLAGS_SENTUSER || !EmptyString(source_p->name))
|
||||||
|
{
|
||||||
|
exit_client(client_p, source_p, &me, "WEBIRC may not follow NICK/USER");
|
||||||
|
}
|
||||||
|
|
||||||
aconf = find_address_conf(client_p->host, client_p->sockhost,
|
aconf = find_address_conf(client_p->host, client_p->sockhost,
|
||||||
IsGotId(client_p) ? client_p->username : "webirc",
|
IsGotId(client_p) ? client_p->username : "webirc",
|
||||||
IsGotId(client_p) ? client_p->username : "webirc",
|
IsGotId(client_p) ? client_p->username : "webirc",
|
||||||
(struct sockaddr *) &client_p->localClient->ip,
|
(struct sockaddr *) &client_p->localClient->ip,
|
||||||
GET_SS_FAMILY(&client_p->localClient->ip), NULL);
|
GET_SS_FAMILY(&client_p->localClient->ip), NULL);
|
||||||
|
|
||||||
if (aconf == NULL || !(aconf->status & CONF_CLIENT))
|
if (aconf == NULL || !(aconf->status & CONF_CLIENT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc."))
|
if (!IsConfDoSpoofIp(aconf) || irccmp(aconf->info.name, "webirc."))
|
||||||
{
|
{
|
||||||
/* XXX */
|
/* XXX */
|
||||||
|
@ -133,6 +140,8 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
|
||||||
}
|
}
|
||||||
|
|
||||||
source_p->localClient->ip = addr;
|
source_p->localClient->ip = addr;
|
||||||
|
source_p->username[0] = '\0';
|
||||||
|
ClearGotId(source_p);
|
||||||
|
|
||||||
if (parc >= 6)
|
if (parc >= 6)
|
||||||
{
|
{
|
||||||
|
|
|
@ -539,6 +539,7 @@ struct ListClient
|
||||||
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
||||||
|
|
||||||
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
||||||
|
#define ClearGotId(x) ((x)->flags &= ~FLAGS_GOTID)
|
||||||
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
||||||
|
|
||||||
#define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE)
|
#define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE)
|
||||||
|
|
Loading…
Reference in a new issue