From: Alex Badea Date: Fri, 17 Feb 2006 10:34:59 +0000 (+0000) Subject: Author: Alex Badea X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=2c4bbc2ac2ec38fc06b5d81827856b5d952d92b4;p=ircu2.10.12-pk.git Author: Alex Badea Log message: Fix mr_pong failing for cookies larger than 0x7fffffff. Fix auth_set_username always returning "invalid username". git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1622 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 4183937..af92b25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-02-17 Alex Badea + + * ircd/s_auth.c (auth_set_username): Check if the last + character of the username is alphanumeric, instead of the + '\0' terminator. + + * ircd/m_pong.c (mr_pong): Parse cookie with strtoul(), + since atol() causes signedness problems. + 2006-02-15 Michael Poole * include/res.h (NXDOMAIN): Define. diff --git a/ircd/m_pong.c b/ircd/m_pong.c index 9e43395..f107552 100644 --- a/ircd/m_pong.c +++ b/ircd/m_pong.c @@ -164,7 +164,7 @@ int mr_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) ClrFlag(cptr, FLAG_PINGSENT); cli_lasttime(cptr) = CurrentTime; - return (parc > 1) ? auth_set_pong(cli_auth(sptr), atol(parv[parc - 1])) : 0; + return (parc > 1) ? auth_set_pong(cli_auth(sptr), strtoul(parv[parc - 1], NULL, 10)) : 0; } /* diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 15ccb13..6dd7b2d 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -322,7 +322,7 @@ static int auth_set_username(struct AuthRequest *auth) if (!lower && !upper) goto badid; /* Final character must not be punctuation. */ - if (!IsAlnum(ch)) + if (!IsAlnum(last)) goto badid; }