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