1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 008-make_scrambled_password.dpatch by Joey Schulze <joey@debian.org>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Adjust the buffer size used by make_scrambled_password()
8 diff -urNad mod-auth-mysql~/mod_auth_mysql.c mod-auth-mysql/mod_auth_mysql.c
9 --- mod-auth-mysql~/mod_auth_mysql.c 2008-05-14 18:46:21.000000000 +0200
10 +++ mod-auth-mysql/mod_auth_mysql.c 2008-05-14 22:15:44.000000000 +0200
13 #define SHA1SUM_ENCRYPTION_FLAG 1<<6
15 +/* from include/sha1.h from the mysql-server source distribution */
16 +#define SHA1_HASH_SIZE 20 /* Hash size in bytes */
18 static int check_no_encryption(const char *passwd, char *enc_passwd)
20 return (!strcmp(passwd, enc_passwd));
23 static int check_mysql_encryption(const char *passwd, char *enc_passwd)
25 - char scrambled_passwd[32];
26 + char scrambled_passwd[2*SHA1_HASH_SIZE + 2];
28 make_scrambled_password(scrambled_passwd, passwd);
29 return (!strcmp(scrambled_passwd, enc_passwd));