aboutsummaryrefslogtreecommitdiffstats
path: root/www/mod_auth_mysql_another
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2004-01-12 02:52:38 +0800
committermbr <mbr@FreeBSD.org>2004-01-12 02:52:38 +0800
commitf5bb2b43b7d6492a06021e4fef0adf33702bbb28 (patch)
tree45d8ec07e12e34fec8ea15fbfd5d268a6c70137c /www/mod_auth_mysql_another
parentbdd482d4f759502877b74114f82e815068a2f9c0 (diff)
downloadfreebsd-ports-graphics-f5bb2b43b7d6492a06021e4fef0adf33702bbb28.tar.gz
freebsd-ports-graphics-f5bb2b43b7d6492a06021e4fef0adf33702bbb28.tar.zst
freebsd-ports-graphics-f5bb2b43b7d6492a06021e4fef0adf33702bbb28.zip
Make mod_auth_mysql working with mysqld 4.1.x. Replace make_scrambled_password()
with hash_password(). PR: 54067
Diffstat (limited to 'www/mod_auth_mysql_another')
-rw-r--r--www/mod_auth_mysql_another/files/patch-mod_auth_mysql.c33
1 files changed, 33 insertions, 0 deletions
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 00000000000..d8a75fd7f45
--- /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;
+ }