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 b71fd1ea4c3cd884fe813aaa945d27f3bf4f80f2 (commit)
via e8c07912cb42a9749451b55db1d14c445190a260 (commit)
via c59e22b2636a1fcb8d9453dae5df638a8ddebb65 (commit)
from b1803b7637d52aed03c7b08d3146dcffa4893c07 (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 b71fd1ea4c3cd884fe813aaa945d27f3bf4f80f2
Author: Michael Poole <[email protected]>
Date: Sun Feb 24 20:23:45 2019 -0500
iauth: Emit "? config" and "? stats" for /stats iauth[conf] * get.
Also report the IAuth program's version in /stats iauthconf.
diff --git a/doc/readme.iauth b/doc/readme.iauth
index 450bd4dc..ad057f25 100644
--- a/doc/readme.iauth
+++ b/doc/readme.iauth
@@ -261,6 +261,17 @@ Comments: Used to indicate to the iauth instance that the
server
Compatibility: This is an Undernet extension and ircd does not send
it.
+? - Information Request
+Syntax: <id> ? <type>
+Example: -1 ? config
+States: N/A
+Next State: -
+Comments: Request that the iauth program send a particular type of
+ information to the server. The predefined values for <type> are:
+ config - iauth should send an "a", followed by all current "A" lines
+ stats - iauth should send an "s", followed by all current "S" lines
+Compatibility: This is an Undernet extension and ircd does not send it.
+
IAUTH MESSAGES
==============
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index a61d333b..87f015ee 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -2492,13 +2492,22 @@ static void iauth_stderr_callback(struct Event *ev)
*/
void report_iauth_conf(struct Client *cptr, const struct StatDesc *sd, char
*param)
{
- struct SLink *link;
+ struct SLink *link;
- if (iauth) for (link = iauth->i_config; link; link = link->next)
- {
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
- link->value.cp);
- }
+ if (!iauth)
+ return;
+
+ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, " :%s",
+ iauth->i_version ? iauth->i_version : "IAuth did not report a version");
+ for (link = iauth->i_config; link; link = link->next)
+ {
+ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s", link->value.cp);
+ }
+
+ if (param && !strcmp(param, "get"))
+ {
+ sendto_iauth(NULL, "? config");
+ }
}
/** Report active iauth's statistics to \a cptr.
@@ -2508,11 +2517,18 @@ void report_iauth_conf(struct Client *cptr, const
struct StatDesc *sd, char *par
*/
void report_iauth_stats(struct Client *cptr, const struct StatDesc *sd, char
*param)
{
- struct SLink *link;
+ struct SLink *link;
- if (iauth) for (link = iauth->i_stats; link; link = link->next)
- {
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
- link->value.cp);
- }
+ if (!iauth)
+ return;
+
+ for (link = iauth->i_stats; link; link = link->next)
+ {
+ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s", link->value.cp);
+ }
+
+ if (param && !strcmp(param, "get"))
+ {
+ sendto_iauth(NULL, "? stats");
+ }
}
diff --git a/ircd/s_stats.c b/ircd/s_stats.c
index 4fd64a61..0a35b820 100644
--- a/ircd/s_stats.c
+++ b/ircd/s_stats.c
@@ -652,10 +652,10 @@ struct StatDesc statsinfo[] = {
{ 'z', "memory", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_z,
count_memory, 0,
"Memory/Structure allocation information." },
- { ' ', "iauth", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH,
+ { ' ', "iauth", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM),
FEAT_HIS_STATS_IAUTH,
report_iauth_stats, 0,
"IAuth statistics." },
- { ' ', "iauthconf", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH,
+ { ' ', "iauthconf", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM),
FEAT_HIS_STATS_IAUTH,
report_iauth_conf, 0,
"IAuth configuration." },
{ '*', "help", STAT_FLAG_CASESENS, FEAT_LAST_F,
commit e8c07912cb42a9749451b55db1d14c445190a260
Author: Michael Poole <[email protected]>
Date: Tue Feb 19 07:44:35 2019 -0500
iauth_read: Improve checking for EOL and stray control characters.
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index e1745f3b..a61d333b 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -2343,17 +2343,26 @@ static void iauth_read(struct IAuth *iauth)
memcpy(readbuf, iauth->i_buffer, length);
if (IO_SUCCESS != os_recv_nonb(s_fd(i_socket(iauth)),
readbuf + length,
- sizeof(readbuf) - length - 1,
+ sizeof(readbuf) - length,
&count))
return;
length += count;
- readbuf[length] = '\0';
/* Parse each complete line. */
- for (sol = readbuf; (eol = strchr(sol, '\n')) != NULL; sol = eol + 1) {
- *eol = '\0';
- if (*(eol - 1) == '\r') /* take out carriage returns, too... */
- *(eol - 1) = '\0';
+ for (sol = readbuf; 1; sol = eol + 1) {
+ for (eol = sol; eol != readbuf+length && !IsEol(*eol) && *eol != '\0';
eol++) {}
+ if (eol == readbuf+length) {
+ break;
+ } else if (*eol == '\n') {
+ *eol = '\0';
+ } else if (*eol == '\r' && eol[1] == '\n') {
+ *eol = '\0';
+ *++eol = '\0';
+ } else {
+ log_write(LS_IAUTH, L_WARNING, 0,
+ "Illegal control character from IAuth: \\x%02x", (int)*eol);
+ continue;
+ }
/* If spammy debug, send the message to opers. */
if (i_debug(iauth) > 1)
@@ -2364,7 +2373,7 @@ static void iauth_read(struct IAuth *iauth)
}
/* Put unused data back into connection's buffer. */
- iauth->i_count = strlen(sol);
+ iauth->i_count = readbuf + length - sol;
if (iauth->i_count > BUFSIZE)
iauth->i_count = BUFSIZE;
memcpy(iauth->i_buffer, sol, iauth->i_count);
commit c59e22b2636a1fcb8d9453dae5df638a8ddebb65
Author: Michael Poole <[email protected]>
Date: Tue Feb 19 07:44:51 2019 -0500
vdebug: Use the caller-provided level for logging.
diff --git a/ircd/s_debug.c b/ircd/s_debug.c
index 18a327ea..490ca751 100644
--- a/ircd/s_debug.c
+++ b/ircd/s_debug.c
@@ -153,7 +153,7 @@ void vdebug(int level, const char *form, va_list vl)
if (!loop && (debuglevel >= 0) && (level <= debuglevel))
{
loop = 1;
- log_vwrite(LS_DEBUG, L_DEBUG, 0, form, vl);
+ log_vwrite(LS_DEBUG, level, 0, form, vl);
loop = 0;
}
errno = err;
-----------------------------------------------------------------------
Summary of changes:
doc/readme.iauth | 11 ++++++++++
ircd/s_auth.c | 63 +++++++++++++++++++++++++++++++++++++++-----------------
ircd/s_debug.c | 2 +-
ircd/s_stats.c | 4 ++--
4 files changed, 58 insertions(+), 22 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches