diff options
Diffstat (limited to 'www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch')
-rw-r--r-- | www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch new file mode 100644 index 000000000000..e7f6eb31ef3f --- /dev/null +++ b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch @@ -0,0 +1,35 @@ +Index: mod_auth_mysql-3.0.0/mod_auth_mysql.c +=================================================================== +--- mod_auth_mysql-3.0.0.orig/mod_auth_mysql.c ++++ mod_auth_mysql-3.0.0/mod_auth_mysql.c +@@ -288,6 +288,7 @@ static short pw_crypted(POOL * pool, con + static short pw_aes(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt); + #endif + static short pw_sha1(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt); ++static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt); + static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt); + + static char * format_remote_host(request_rec * r, char ** parm); +@@ -318,7 +319,8 @@ static encryption encryptions[] = {{"cry + #if _AES + {"aes", SALT_REQUIRED, pw_aes}, + #endif +- {"sha1", NO_SALT, pw_sha1}}; ++ {"sha1", NO_SALT, pw_sha1}, ++ {"apr", NO_SALT, pw_apr}}; + typedef struct { /* User formatting patterns */ + char pattern; /* Pattern to match */ + char * (*func)(request_rec * r, char ** parm); +@@ -856,6 +858,12 @@ static short pw_sha1(POOL * pool, const + return strcasecmp(bin2hex(pool, scrambled_sent_pw, enc_len), real_pw) == 0; + } + ++/* checks passwords from htpasswd */ ++static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) { ++ /* apr_password_validate will do the job */ ++ return apr_password_validate(sent_pw, real_pw) == APR_SUCCESS; ++} ++ + /* checks plain text passwords */ + static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) { + return strcmp(real_pw, sent_pw) == 0; |