From bf87703bcf8c9ae9079b4b1c6c98fd05ec856ee8 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Thu, 15 May 2008 07:51:49 +0000 Subject: [PATCH] Provide an Apache authentication method Thanks to Andreas Barth --- debian/changelog | 2 + debian/patches/00list | 1 + debian/patches/010-enctype-apache.dpatch | 52 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 debian/patches/010-enctype-apache.dpatch diff --git a/debian/changelog b/debian/changelog index 8de35e7..548d3cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ mod-auth-mysql (4.3.9-8) unstable; urgency=low [008-make_scrambled_password.dpatch] (closes: Bug#356064, Bug#346192, Bug#346194) * Adjust config parser data type for _Port to int, thanks to Lehel Bernadt [009-port-int.dpatch] (closes: Bug#356147) + * Provide an Apache authentication method, thanks to Andreas Barth + [010-enctype-apache.dpatch] (closes: Bug#287547) -- diff --git a/debian/patches/00list b/debian/patches/00list index fec947d..ce27fbd 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -6,3 +6,4 @@ 007-unify_namespace 008-make_scrambled_password 009-port-int +010-enctype-apache diff --git a/debian/patches/010-enctype-apache.dpatch b/debian/patches/010-enctype-apache.dpatch new file mode 100644 index 0000000..86b1149 --- /dev/null +++ b/debian/patches/010-enctype-apache.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 010-enctype-apache.dpatch by Andreas Barth +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Provide an Apache authentication method + +@DPATCH@ +diff -urNad mod-auth-mysql~/DIRECTIVES mod-auth-mysql/DIRECTIVES +--- mod-auth-mysql~/DIRECTIVES 2008-05-14 16:59:28.000000000 +0200 ++++ mod-auth-mysql/DIRECTIVES 2008-05-15 09:49:06.000000000 +0200 +@@ -203,6 +203,10 @@ + + MySQL + The hashing scheme used by the MySQL PASSWORD() function. ++ ++ Apache ++ The hashing scheme used by htpasswd utility. Compatible to ++ authuserfile. + + AuthMySQL_Encryption_Types + Synonym for Auth_MySQL_Encryption_Types. +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-15 09:49:06.000000000 +0200 +@@ -102,6 +102,7 @@ + #define CRYPT_ENCRYPTION_FLAG 1<<5 + #endif + #define SHA1SUM_ENCRYPTION_FLAG 1<<6 ++#define APACHE_ENCRYPTION_FLAG 1<<7 + + static int check_no_encryption(const char *passwd, char *enc_passwd) + { +@@ -235,6 +236,11 @@ + return (!strcmp(scrambled_passwd, enc_passwd)); + } + ++static int check_apache_encryption(const char *passwd, char *enc_passwd) ++{ ++ return (!ap_validate_password(passwd, enc_passwd)); ++} ++ + typedef struct { + char *name; + int (*check_function)(const char *passwd, char *enc_passwd); +@@ -253,6 +259,7 @@ + { "Crypt", check_crypt_encryption, CRYPT_ENCRYPTION_FLAG }, + { "PHP_MD5", check_PHP_MD5_encryption, PHP_MD5_ENCRYPTION_FLAG }, + { "SHA1Sum", check_SHA1Sum_encryption, SHA1SUM_ENCRYPTION_FLAG}, ++ { "Apache", check_apache_encryption, APACHE_ENCRYPTION_FLAG }, + /* add additional encryption types below */ + { NULL, NULL, 0 } + }; -- 2.20.1