This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".
The branch, u2_10_12_branch has been updated
via a9ea6536ced4428fa8614a19b7e870561bed61a6 (commit)
from ac4bb6a039f0f6d32f125332c655c6bf99e5a87c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a9ea6536ced4428fa8614a19b7e870561bed61a6
Author: Michael Poole <[email protected]>
Date: Tue Feb 21 22:22:43 2017 -0500
m_webirc: Don't use the "username" parameter for the client.
At least most of the time, this is apparently meant as the name of the
WebIRC service rather than the user or client, but various WebIRC specs
describe it as a client or user name.
diff --git a/include/client.h b/include/client.h
index 31dc294..971a928 100644
--- a/include/client.h
+++ b/include/client.h
@@ -496,7 +496,7 @@ struct Client {
* user port. */
#define IsUserPort(x) (cli_status(x) == STAT_UNKNOWN_USER )
/** Return non-zero if the client is an unregistered connection on a
- * WebIRC port. */
+ * WebIRC port that has not yet sent WEBIRC. */
#define IsWebircPort(x) (cli_status(x) == STAT_WEBIRC)
/** Return non-zero if the client is a real client connection. */
#define IsClient(x) (cli_status(x) & \
diff --git a/ircd/m_webirc.c b/ircd/m_webirc.c
index 700c6fd..34e5255 100644
--- a/ircd/m_webirc.c
+++ b/ircd/m_webirc.c
@@ -104,9 +104,7 @@
int m_webirc(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
{
const struct wline *wline;
- char mod_ident[USERLEN+1];
const char *passwd;
- const char *ident;
const char *hostname;
const char *ip;
@@ -117,7 +115,6 @@ int m_webirc(struct Client *cptr, struct Client *sptr, int
parc, char *parv[])
return need_more_params(sptr, "WEBIRC");
passwd = parv[1];
- ident = parv[2];
hostname = parv[3];
ip = parv[4];
@@ -131,15 +128,7 @@ int m_webirc(struct Client *cptr, struct Client *sptr, int
parc, char *parv[])
/* Treat client as a normally connecting user from now on. */
cli_status(sptr) = STAT_UNKNOWN_USER;
- /* If FEAT_HIS_WEBIRC is off, prefix ident with ^. */
- if (!feature_bool(FEAT_HIS_WEBIRC)) {
- mod_ident[0] = '^';
- strncpy(mod_ident + 1, ident, sizeof(mod_ident) - 1);
- mod_ident[sizeof(mod_ident) - 1] = '\0';
- ident = mod_ident;
- }
-
- int res = auth_spoof_user(cli_auth(cptr), ident, hostname, ip);
+ int res = auth_spoof_user(cli_auth(cptr), NULL, hostname, ip);
if (res > 0)
return exit_client(cptr, cptr, &me, "WEBIRC invalid spoof");
return res;
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index 11be3bc..8fe68da 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -431,7 +431,8 @@ static int check_auth_finished(struct AuthRequest *auth,
int bitclr)
/* Bail out until we have DNS and ident. */
if (FlagHas(&auth->flags, AR_AUTH_PENDING)
- || FlagHas(&auth->flags, AR_DNS_PENDING))
+ || FlagHas(&auth->flags, AR_DNS_PENDING)
+ || FlagHas(&auth->flags, AR_NEEDS_USER))
return 0;
/* If appropriate, do preliminary assignment to Client block. */
@@ -452,7 +453,8 @@ static int check_auth_finished(struct AuthRequest *auth,
int bitclr)
int ii;
for (ii = USERLEN-1; ii > 0; ii--)
s[ii] = s[ii-1];
- s[0] = '~';
+ s[0] = (cli_wline(sptr) && !feature_bool(FEAT_HIS_WEBIRC))
+ ? '^' : '~';
s[USERLEN] = '\0';
} /* else cleaned version of client-provided name is in place */
@@ -467,12 +469,11 @@ static int check_auth_finished(struct AuthRequest *auth,
int bitclr)
}
/* Tell IAuth about the client. */
- iauth_notify(auth, AR_DNS_PENDING);
- iauth_notify(auth, AR_AUTH_PENDING);
- if (!FlagHas(&auth->flags, AR_NEEDS_USER))
- iauth_notify(auth, AR_NEEDS_USER);
- if (!FlagHas(&auth->flags, AR_NEEDS_NICK))
- iauth_notify(auth, AR_NEEDS_NICK);
+ for (flag = 1; flag <= AR_LAST_SCAN; ++flag)
+ {
+ if (!FlagHas(&auth->flags, flag))
+ iauth_notify(auth, flag);
+ }
}
/* Check non-iauth registration blocking flags. */
@@ -1281,7 +1282,7 @@ int auth_cap_done(struct AuthRequest *auth)
* (The spoofed values should be from a trusted source.)
*
* @param[in] auth Authorization request for client.
- * @param[in] username Requested username.
+ * @param[in] username Requested username (possibly null).
* @param[in] hostname Requested hostname.
* @param[in] ip Requested IP address.
* @return Zero if client should be kept, negative if killed if rejected.
@@ -1290,7 +1291,6 @@ int auth_spoof_user(struct AuthRequest *auth, const char
*username, const char *
{
struct Client *sptr = auth->client;
time_t next_target = 0;
- int killreason;
if (!auth_verify_hostname(hostname, HOSTLEN))
return 1;
@@ -1306,21 +1306,14 @@ int auth_spoof_user(struct AuthRequest *auth, const
char *username, const char *
cli_nexttarget(sptr) = next_target;
ircd_strncpy(cli_sock_ip(sptr), ip, SOCKIPLEN);
ircd_strncpy(cli_sockhost(sptr), hostname, HOSTLEN);
- ircd_strncpy(cli_username(sptr), username, USERLEN);
- SetGotId(sptr);
-
- killreason = find_kill(sptr);
- if (killreason) {
- ++ServerStats->is_ref;
- return exit_client(sptr, sptr, &me,
- (killreason == -1 ? "K-lined" : "G-lined"));
+ if (username) {
+ ircd_strncpy(cli_username(sptr), username, USERLEN);
+ SetGotId(sptr);
+ } else {
+ SetFlag(sptr, FLAG_DOID);
}
- FlagSet(&auth->flags, AR_GLINE_CHECKED);
- if (preregister_user(auth->client))
- return CPTR_KILLED;
start_iauth_query(auth);
- sendto_iauth(sptr, "N %s", hostname);
if (IAuthHas(iauth, IAUTH_UNDERNET))
sendto_iauth(sptr, "u %s", cli_username(sptr));
-----------------------------------------------------------------------
Summary of changes:
include/client.h | 2 +-
ircd/m_webirc.c | 13 +------------
ircd/s_auth.c | 37 +++++++++++++++----------------------
3 files changed, 17 insertions(+), 35 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches