pkgsrc/www/ap24-authnz-external/patches/patch-aa
2018-01-13 08:59:44 +00:00

50 lines
1.7 KiB
Text

$NetBSD: patch-aa,v 1.2 2018/01/13 08:59:44 jperkin Exp $
- Build fix for apache 2.4
- Add HTTP method in environement
Submitted upstream as https://github.com/phokz/mod-auth-external/issues/24
--- mod_authnz_external.c.orig 2011-10-12 16:55:14.000000000 +0200
+++ mod_authnz_external.c 2016-04-04 09:51:14.000000000 +0200
@@ -91,9 +91,12 @@
#define ENV_USER "USER"
#define ENV_PASS "PASS"
#define ENV_GROUP "GROUP"
#define ENV_URI "URI"
+#define ENV_METHOD "METHOD"
#define ENV_IP "IP"
+#define ENV_CLIENT_IP "CLIENT_IP"
+#define ENV_USERAGENT_IP "USERAGENT_IP"
#define ENV_HOST "HOST" /* Remote Host */
#define ENV_HTTP_HOST "HTTP_HOST" /* Local Host */
#define ENV_CONTEXT "CONTEXT" /* Arbitrary Data from Config */
/* Undefine this if you do not want cookies passed to the script */
@@ -442,14 +445,25 @@
remote_host= ap_get_remote_host(c, r->per_dir_config, REMOTE_HOST,NULL);
if (remote_host != NULL)
child_env[i++]= apr_pstrcat(p, ENV_HOST"=", remote_host,NULL);
- if (c->remote_ip)
- child_env[i++]= apr_pstrcat(p, ENV_IP"=", c->remote_ip, NULL);
+ if (c->client_ip) {
+ child_env[i++]= apr_pstrcat(p, ENV_CLIENT_IP"=",
+ c->client_ip, NULL);
+ child_env[i++]= apr_pstrcat(p, ENV_IP"=", c->client_ip, NULL);
+ }
+
+ if (r->useragent_ip)
+ child_env[i++]= apr_pstrcat(p, ENV_USERAGENT_IP"=",
+ r->useragent_ip, NULL);
if (r->uri)
child_env[i++]= apr_pstrcat(p, ENV_URI"=", r->uri, NULL);
+ if (r->method)
+ child_env[i++]= apr_pstrcat(r->pool, ENV_METHOD"=",
+ r->method, NULL);
+
if ((host= apr_table_get(r->headers_in, "Host")) != NULL)
child_env[i++]= apr_pstrcat(p, ENV_HTTP_HOST"=", host, NULL);
if (dir->context)