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 3e4820447621d9f7dca5dc2d2348516f14c345cb (commit)
from a791bdd3ea36d1916dd80d813d8e6d85fbd70bb6 (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 3e4820447621d9f7dca5dc2d2348516f14c345cb
Author: Michael Poole <[email protected]>
Date: Wed Jan 4 23:43:50 2017 -0500
s_auth: Fix prepending ~ to long idents.
This was touched in commits 5dd977c1dc9f33ddfbca5eb11fb8f3b95c7e5359 and
c2ad630afaab5353b2656f6cd5d591f8a2488692, but still had a bug. We can
rewrite the loop to make it clearer, simpler, and harder to mess up.
Thanks to Hidden for reporting the bug and Scot for finding the cause.
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index ebbe745..2daf18b 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -453,15 +453,11 @@ static int check_auth_finished(struct AuthRequest *auth,
int bitclr)
{
/* Prepend ~ to user->username. */
char *s = user->username;
- char last, ch;
+ int ii;
+ for (ii = USERLEN-1; ii > 0; ii--)
+ s[ii] = s[ii-1];
+ s[0] = '~';
s[USERLEN] = '\0';
- for (last = '~'; (ch = *s) != '\0'; )
- {
- *s++ = last;
- last = ch;
- }
- *s++ = last;
- *s = '\0';
} /* else cleaned version of client-provided name is in place */
/* Check for K- or G-line. */
-----------------------------------------------------------------------
Summary of changes:
ircd/s_auth.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches