]>
Commit | Line | Data |
---|---|---|
4185008b JR |
1 | |
2 | Fixes for 2.4 API. | |
3 | ||
4 | --- mod_auth_kerb-5.4/src/mod_auth_kerb.c.httpd24 | |
5 | +++ mod_auth_kerb-5.4/src/mod_auth_kerb.c | |
6 | @@ -179,6 +179,15 @@ static apr_global_mutex_t *s4u2proxy_loc | |
7 | #define PROXYREQ_PROXY STD_PROXY | |
8 | #endif | |
9 | ||
10 | +#if MODULE_MAGIC_NUMBER_MAJOR >= 20100606 | |
11 | +/* 2.4.x or later */ | |
12 | +#define WITH_HTTPD24 1 | |
13 | +#define client_ip(r) ((r)->useragent_ip) | |
14 | +APLOG_USE_MODULE(auth_kerb); | |
15 | +#else | |
16 | +#define client_ip(r) ((r)->connection->remote_ip) | |
17 | +#endif | |
18 | + | |
19 | /*************************************************************************** | |
20 | Auth Configuration Structure | |
21 | ***************************************************************************/ | |
22 | @@ -383,7 +393,11 @@ cmd_delegationlock(cmd_parms *cmd, void | |
23 | } | |
24 | ||
25 | static void | |
26 | -log_rerror(const char *file, int line, int level, int status, | |
27 | +log_rerror(const char *file, int line, | |
28 | +#ifdef WITH_HTTPD24 | |
29 | + int module_index, | |
30 | +#endif | |
31 | + int level, int status, | |
32 | const request_rec *r, const char *fmt, ...) | |
33 | { | |
34 | char errstr[1024]; | |
35 | @@ -394,7 +408,9 @@ log_rerror(const char *file, int line, i | |
36 | va_end(ap); | |
37 | ||
38 | ||
39 | -#ifdef STANDARD20_MODULE_STUFF | |
40 | +#if defined(WITH_HTTPD24) | |
41 | + ap_log_rerror(file, line, module_index, level, status, r, "%s", errstr); | |
42 | +#elif defined(STANDARD20_MODULE_STUFF) | |
43 | ap_log_rerror(file, line, level | APLOG_NOERRNO, status, r, "%s", errstr); | |
44 | #else | |
45 | ap_log_rerror(file, line, level | APLOG_NOERRNO, r, "%s", errstr); | |
46 | @@ -1860,8 +1876,8 @@ already_succeeded(request_rec *r, char * | |
47 | char keyname[1024]; | |
48 | ||
49 | snprintf(keyname, sizeof(keyname) - 1, | |
50 | - "mod_auth_kerb::connection::%s::%ld", r->connection->remote_ip, | |
51 | - r->connection->id); | |
52 | + "mod_auth_kerb::connection::%s::%ld", client_ip(r), | |
53 | + r->connection->id); | |
54 | ||
55 | if (apr_pool_userdata_get((void**)&conn_data, keyname, r->connection->pool) != 0) | |
56 | return NULL; | |
57 | @@ -2014,7 +2030,7 @@ kerb_authenticate_user(request_rec *r) | |
58 | prevauth->last_return = ret; | |
59 | snprintf(keyname, sizeof(keyname) - 1, | |
60 | "mod_auth_kerb::connection::%s::%ld", | |
61 | - r->connection->remote_ip, r->connection->id); | |
62 | + client_ip(r), r->connection->id); | |
63 | apr_pool_userdata_set(prevauth, keyname, NULL, r->connection->pool); | |
64 | } | |
65 |