Author: Alex Badea <vamposdecampos@gmail.com>
authorAlex Badea <vamposdecampos@gmail.com>
Fri, 17 Feb 2006 10:34:59 +0000 (10:34 +0000)
committerAlex Badea <vamposdecampos@gmail.com>
Fri, 17 Feb 2006 10:34:59 +0000 (10:34 +0000)
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

ChangeLog
ircd/m_pong.c
ircd/s_auth.c

index 4183937a562f17478a71f611f5fcc47eca0b5ebe..af92b251d8478f98a54098a1f0ddb43c2df2e707 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-17  Alex Badea <vamposdecampos@gmail.com>
+
+       * 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 <mdpoole@troilus.org>
 
        * include/res.h (NXDOMAIN): Define.
index 9e433958c31c761d342d2fcc7122d29906936622..f107552eec1c47b44f7e03aab3da9c74d345e352 100644 (file)
@@ -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;
 }
 
 /*
index 15ccb1335b649a133a626301c9fcc12b8fcd9ee7..6dd7b2d709a9abd725f8bc9198262eff90ef9115 100644 (file)
@@ -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;
   }