From 276cbb36175a9efac09b98c988e4e4337a517ef3 Mon Sep 17 00:00:00 2001 From: Martin Blapp Date: Sun, 11 Jan 2004 18:52:38 +0000 Subject: Make mod_auth_mysql working with mysqld 4.1.x. Replace make_scrambled_password() with hash_password(). PR: 54067 --- .../files/patch-mod_auth_mysql.c | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 www/mod_auth_mysql_another/files/patch-mod_auth_mysql.c (limited to 'www/mod_auth_mysql_another') diff --git a/www/mod_auth_mysql_another/files/patch-mod_auth_mysql.c b/www/mod_auth_mysql_another/files/patch-mod_auth_mysql.c new file mode 100644 index 000000000000..d8a75fd7f455 --- /dev/null +++ b/www/mod_auth_mysql_another/files/patch-mod_auth_mysql.c @@ -0,0 +1,33 @@ +--- mod_auth_mysql.c Sat May 10 16:12:34 2003 ++++ mod_auth_mysql.c Sun Jan 11 13:16:47 2004 +@@ -97,6 +97,7 @@ + * MODULE-DEFINITION-END + */ + ++#define MYSQL_CRYPT_LEN 17U + + #ifdef APACHE2 + #define PCALLOC apr_pcalloc +@@ -617,7 +618,8 @@ + conn_rec *c = r->connection; + const char *sent_pw, *real_pw; + int res; +- char *scrambled_sent_pw; ++ unsigned long hash_res[2]; ++ char scrambled_sent_pw[MYSQL_CRYPT_LEN]; + + if ((res = ap_get_basic_auth_pw (r, &sent_pw))) + return res; +@@ -658,8 +660,10 @@ + + /* if AuthMySQLScrambledPassword is On, compare the scrambled password */ + if(sec->mysqlScrambled) { +- scrambled_sent_pw = PCALLOC(r->pool, 33); +- make_scrambled_password(scrambled_sent_pw, sent_pw); ++ /* make_scrambled_password(scrambled_sent_pw, sent_pw); */ ++ hash_password(hash_res, sent_pw); ++ snprintf(scrambled_sent_pw, sizeof scrambled_sent_pw, "%08lx%08lx", ++ hash_res[0], hash_res[1]); + if(strcmp(real_pw, scrambled_sent_pw)) { + passwords_match = 0; + } -- cgit v1.2.3