[tpop3d-discuss] auth_mysql problem

Jakob Hirsch jh at plonk.de
Sat, 6 Sep 2003 14:48:56 +0200


Tomasz Matuszewski wrote:

> mysql, but hash is of incorrect length 23 (expecting 8 or 16)

wow, seems that nobody ever user mysql password hashes (since I don't think
the code for it has ever changed).
This patch fixes it:

--- tpop3d-1.5.1/password.c     Tue Jul 15 01:31:20 2003
+++ tpop3d-1.5.1-2/password.c   Sat Sep  6 14:45:27 2003
@@ -258,7 +258,7 @@
         mysql_make_scrambled_password(hash, pass);
         /* The MySQL password format changed, and we should accept either a
16-
          * or 8-character long hash. */
-        switch (n = strlen(pwhash)) {
+        switch (n = strlen(realhash)) {
             case 8:
                 return strncmp(hash, realhash, 8) == 0;