Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally allow WEBIRC blocks to spoof ident responses #344

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion extensions/m_webirc.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, webirc_hfnlist, NULL,
/*
* mr_webirc - webirc message handler
* parv[1] = password
* parv[2] = fake username (we ignore this)
* parv[2] = fake username
* parv[3] = fake hostname
* parv[4] = fake ip
*/
Expand Down Expand Up @@ -171,6 +171,12 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
else
rb_strlcpy(source_p->host, source_p->sockhost, sizeof(source_p->host));

if (aconf->flags & CONF_FLAGS_SPOOF_IDENT)
{
SetGotId(source_p);
rb_strlcpy(source_p->username, parv[2], sizeof(source_p->username));
}

/* Check dlines now, klines will be checked on registration */
if((aconf = find_dline((struct sockaddr *)&source_p->localClient->ip,
GET_SS_FAMILY(&source_p->localClient->ip))))
Expand Down
1 change: 1 addition & 0 deletions include/s_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct ConfItem
#define CONF_FLAGS_EXEMPTKLINE 0x00000040
#define CONF_FLAGS_NOLIMIT 0x00000080
#define CONF_FLAGS_SPOOF_IP 0x00000200
#define CONF_FLAGS_SPOOF_IDENT 0x00000200
jesopo marked this conversation as resolved.
Show resolved Hide resolved
#define CONF_FLAGS_SPOOF_NOTICE 0x00000400
#define CONF_FLAGS_REDIR 0x00000800
#define CONF_FLAGS_EXEMPTRESV 0x00002000 /* exempt from resvs */
Expand Down
2 changes: 1 addition & 1 deletion ircd/authproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ authd_decide_client(struct Client *client_p, const char *ident, const char *host
if(client_p->preClient == NULL || client_p->preClient->auth.cid == 0)
return;

if(*ident != '*')
if(*ident != '*' && !IsGotId(client_p))
{
rb_strlcpy(client_p->username, ident, sizeof(client_p->username));
SetGotId(client_p);
Expand Down
1 change: 1 addition & 0 deletions ircd/newconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ static struct mode_table auth_table[] = {
{"extend_chans", CONF_FLAGS_EXTEND_CHANS },
{"allow_sctp", CONF_FLAGS_ALLOW_SCTP },
{"kline_spoof_ip", CONF_FLAGS_KLINE_SPOOF },
{"spoof_ident", CONF_FLAGS_SPOOF_IDENT },
{NULL, 0}
};

Expand Down