aboutsummaryrefslogtreecommitdiffstats
path: root/main/apache-mod-auth-kerb/mod_auth_kerb-5.4-httpd24.patch
blob: 673eaa8ceae82e04755da06463f0266d289e309c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- a/src/mod_auth_kerb.c
+++ b/src/mod_auth_kerb.c
@@ -147,6 +147,16 @@
 #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
  ***************************************************************************/
@@ -348,7 +358,11 @@
 }
 
 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];
@@ -359,7 +373,9 @@
    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);
@@ -1555,8 +1571,8 @@
    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;
@@ -1709,7 +1725,7 @@
        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);
    }