Provide an Apache authentication method
authorJoey Schulze <joey@infodrom.org>
Thu, 15 May 2008 07:51:49 +0000 (07:51 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 15 May 2008 07:51:49 +0000 (07:51 +0000)
Thanks to Andreas Barth <aba@not.so.argh.org>

debian/changelog
debian/patches/00list
debian/patches/010-enctype-apache.dpatch [new file with mode: 0644]

index 8de35e7..548d3cd 100644 (file)
@@ -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 <lehel@pmc-services.hu> [009-port-int.dpatch] (closes: Bug#356147)
+  * Provide an Apache authentication method, thanks to Andreas Barth
+    <aba@not.so.argh.org> [010-enctype-apache.dpatch] (closes: Bug#287547)
 
  --
 
index fec947d..ce27fbd 100644 (file)
@@ -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 (file)
index 0000000..86b1149
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 010-enctype-apache.dpatch by Andreas Barth <aba@not.so.argh.org>
+##
+## 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 <type_list>
+       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 }
+ };