[mod_auth_kerb] adapt for 2.4 API

jorton jorton at fedoraproject.org
Fri Mar 9 16:33:56 UTC 2012


commit bf506e74d7bcc2da08b7ce67957fc881e6d6d89f
Author: Joe Orton <jorton at brian.manyfish.co.uk>
Date:   Fri Mar 9 16:33:50 2012 +0000

    adapt for 2.4 API

 mod_auth_kerb-5.4-httpd24.patch |   75 +++++++++++++++++++++++++++++++++++++++
 mod_auth_kerb.spec              |    7 +++-
 2 files changed, 81 insertions(+), 1 deletions(-)
---
diff --git a/mod_auth_kerb-5.4-httpd24.patch b/mod_auth_kerb-5.4-httpd24.patch
new file mode 100644
index 0000000..86c9b47
--- /dev/null
+++ b/mod_auth_kerb-5.4-httpd24.patch
@@ -0,0 +1,75 @@
+
+Fixes for 2.4 API.
+
+--- mod_auth_kerb-5.4/src/mod_auth_kerb.c.httpd24
++++ mod_auth_kerb-5.4/src/mod_auth_kerb.c
+@@ -179,6 +179,16 @@ static apr_global_mutex_t *s4u2proxy_loc
+ #define PROXYREQ_PROXY STD_PROXY
+ #endif
+ 
++#if MODULE_MAGIC_NUMBER_MAJOR >= 20100606
++/* 2.4.x or later */
++#define WITH_HTTPD24 1
++#define client_ip(r) ((r)->useragent_ip)
++APLOG_USE_MODULE(auth_kerb);
++#else
++#define client_ip(r) ((r)->connection->remote_ip)
++#define ap_unixd_set_global_mutex_perms unixd_set_global_mutex_perms
++#endif
++
+ /*************************************************************************** 
+  Auth Configuration Structure
+  ***************************************************************************/
+@@ -383,7 +393,11 @@ cmd_delegationlock(cmd_parms *cmd, void
+ }
+ 
+ static void
+-log_rerror(const char *file, int line, int level, int status,
++log_rerror(const char *file, int line, 
++#ifdef WITH_HTTPD24
++	   int module_index,
++#endif
++	   int level, int status,
+            const request_rec *r, const char *fmt, ...)
+ {
+    char errstr[1024];
+@@ -394,7 +408,9 @@ log_rerror(const char *file, int line, i
+    va_end(ap);
+ 
+    
+-#ifdef STANDARD20_MODULE_STUFF
++#if defined(WITH_HTTPD24)
++   ap_log_rerror(file, line, module_index, level, status, r, "%s", errstr);
++#elif defined(STANDARD20_MODULE_STUFF)
+    ap_log_rerror(file, line, level | APLOG_NOERRNO, status, r, "%s", errstr);
+ #else
+    ap_log_rerror(file, line, level | APLOG_NOERRNO, r, "%s", errstr);
+@@ -1860,8 +1876,8 @@ already_succeeded(request_rec *r, char *
+    char keyname[1024];
+ 
+    snprintf(keyname, sizeof(keyname) - 1,
+-	"mod_auth_kerb::connection::%s::%ld", r->connection->remote_ip, 
+-	r->connection->id);
++	    "mod_auth_kerb::connection::%s::%ld", client_ip(r), 
++	    r->connection->id);
+ 
+    if (apr_pool_userdata_get((void**)&conn_data, keyname, r->connection->pool) != 0)
+ 	return NULL;
+@@ -2014,7 +2030,7 @@ kerb_authenticate_user(request_rec *r)
+        prevauth->last_return = ret;
+        snprintf(keyname, sizeof(keyname) - 1,
+            "mod_auth_kerb::connection::%s::%ld", 
+-	   r->connection->remote_ip, r->connection->id);
++		client_ip(r), r->connection->id);
+        apr_pool_userdata_set(prevauth, keyname, NULL, r->connection->pool);
+    }
+ 
+@@ -2073,7 +2089,7 @@ s4u2proxylock_create(server_rec *s, apr_
+     }
+ 
+ #ifdef AP_NEED_SET_MUTEX_PERMS
+-    rc = unixd_set_global_mutex_perms(s4u2proxy_lock);
++    rc = ap_unixd_set_global_mutex_perms(s4u2proxy_lock);
+     if (rc != APR_SUCCESS) {
+         ap_log_error(APLOG_MARK, APLOG_CRIT, rc, s,
+                      "mod_auth_kerb: Parent could not set permissions "
diff --git a/mod_auth_kerb.spec b/mod_auth_kerb.spec
index f06fe92..e26bfe8 100644
--- a/mod_auth_kerb.spec
+++ b/mod_auth_kerb.spec
@@ -2,7 +2,7 @@
 Summary: Kerberos authentication module for HTTP
 Name: mod_auth_kerb
 Version: 5.4
-Release: 10%{?dist}
+Release: 11%{?dist}
 License: BSD and MIT and ASL 2.0
 Group: System Environment/Daemons
 URL: http://modauthkerb.sourceforge.net/
@@ -12,6 +12,7 @@ Source2: LICENSE.ASL
 Patch1: mod_auth_kerb-5.4-rcopshack.patch
 Patch2: mod_auth_kerb-5.4-fixes.patch
 Patch3: mod_auth_kerb-5.4-s4u2proxy.patch
+Patch4: mod_auth_kerb-5.4-httpd24.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: httpd-devel, krb5-devel
 Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)
@@ -27,6 +28,7 @@ authentication based on ticket exchanges.
 %patch1 -p1 -b .rcopshack
 %patch2 -p1 -b .fixes
 %patch3 -p1 -b .s4u2proxy
+%patch4 -p1 -b .httpd24
 
 %build
 %configure --without-krb4 --with-krb5=%{_prefix} \
@@ -55,6 +57,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/httpd/modules/*.so
 
 %changelog
+* Fri Mar  9 2012 Joe Orton <jorton at brian.manyfish.co.uk> - 5.4-11
+- adapt for 2.4 API
+
 * Thu Mar  1 2012 Rob Crittenden <rcritten at redhat.com> - 5.4-10
 - Updated s4u2proxy patch to add missing braces around conditional.
 


More information about the scm-commits mailing list