diff options
-rw-r--r-- | www/lighttpd/Makefile | 8 | ||||
-rw-r--r-- | www/lighttpd/files/extra-patch-remoteuser | 64 |
2 files changed, 71 insertions, 1 deletions
diff --git a/www/lighttpd/Makefile b/www/lighttpd/Makefile index 0a84666e9eb3..99a9b779e6ab 100644 --- a/www/lighttpd/Makefile +++ b/www/lighttpd/Makefile @@ -60,7 +60,8 @@ OPTIONS= BZIP2 "Enable Bzip2 support" off \ OPENSSL "Enable SSL support" on \ SPAWNFCGI "Depend on spawn-fcgi utility" off \ VALGRIND "Enable valgrind support" off \ - WEBDAV "Enable WebDAV support" off + WEBDAV "Enable WebDAV support" off \ + REMOTEUSER "Add remote-user to conditionals" off .if !defined(NOPORTDOCS) DOCS= AUTHORS COPYING INSTALL NEWS README @@ -187,6 +188,11 @@ LIB_DEPENDS+= uuid.1:${PORTSDIR}/misc/e2fsprogs-libuuid \ CONFIGURE_ARGS+= --with-webdav-props --with-webdav-locks .endif +# 3rd party remoteuser patch (lighttpd feature request #2415) +.if defined(WITH_REMOTEUSER) +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-remoteuser +.endif + SUB_LIST+= REQUIRE="${_REQUIRE}" post-patch: diff --git a/www/lighttpd/files/extra-patch-remoteuser b/www/lighttpd/files/extra-patch-remoteuser new file mode 100644 index 000000000000..bf4a323ff0ae --- /dev/null +++ b/www/lighttpd/files/extra-patch-remoteuser @@ -0,0 +1,64 @@ +diff -urN src/array.h src/array.h +--- src/array.h 2010-02-01 18:28:20.000000000 -0500 ++++ src/array.h 2012-04-22 13:25:16.000000000 -0400 +@@ -96,6 +96,7 @@ + COMP_HTTP_QUERY_STRING, + COMP_HTTP_SCHEME, + COMP_HTTP_REQUEST_METHOD, ++ COMP_HTTP_REMOTE_USER, + + COMP_LAST_ELEMENT + } comp_key_t; +diff -urN src/configfile-glue.c src/configfile-glue.c +--- src/configfile-glue.c 2010-08-17 05:04:38.000000000 -0400 ++++ src/configfile-glue.c 2012-04-22 13:25:16.000000000 -0400 +@@ -455,6 +455,14 @@ + } + break; + } ++ case COMP_HTTP_REMOTE_USER: { ++ if (NULL != con->authed_user) { ++ l = con->authed_user; ++ } else { ++ l = srv->empty_string; ++ } ++ break; ++ } + default: + return COND_RESULT_FALSE; + } +diff -urN src/configparser.c src/configparser.c +--- src/configparser.c 2011-12-18 09:54:21.000000000 -0500 ++++ src/configparser.c 2012-04-22 13:25:16.000000000 -0400 +@@ -1221,6 +1221,8 @@ + { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"query-string\"]") }, + { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") }, + { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) }, ++ { COMP_HTTP_REMOTE_USER, CONST_STR_LEN("HTTP[\"remoteuser\"]" ) }, ++ { COMP_HTTP_REMOTE_USER, CONST_STR_LEN("HTTP[\"remote-user\"]" ) }, + { COMP_UNSET, NULL, 0 }, + }; + size_t i; +diff -urN src/configparser.y src/configparser.y +--- src/configparser.y 2010-02-01 18:28:20.000000000 -0500 ++++ src/configparser.y 2012-04-22 13:25:16.000000000 -0400 +@@ -435,6 +435,8 @@ + { COMP_HTTP_QUERY_STRING, CONST_STR_LEN("HTTP[\"query-string\"]") }, + { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") }, + { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) }, ++ { COMP_HTTP_REMOTE_USER, CONST_STR_LEN("HTTP[\"remoteuser\"]" ) }, ++ { COMP_HTTP_REMOTE_USER, CONST_STR_LEN("HTTP[\"remote-user\"]" ) }, + { COMP_UNSET, NULL, 0 }, + }; + size_t i; +diff -urN src/response.c src/response.c +--- src/response.c 2010-08-17 05:04:38.000000000 -0400 ++++ src/response.c 2012-04-22 13:25:30.000000000 -0400 +@@ -280,6 +280,7 @@ + config_patch_connection(srv, con, COMP_HTTP_LANGUAGE); /* Accept-Language: */ + config_patch_connection(srv, con, COMP_HTTP_COOKIE); /* Cookie: */ + config_patch_connection(srv, con, COMP_HTTP_REQUEST_METHOD); /* REQUEST_METHOD */ ++ config_patch_connection(srv, con, COMP_HTTP_REMOTE_USER); /* REMOTE_USER */ + + /** their might be a fragment which has to be cut away */ + if (NULL != (qstr = strchr(con->request.uri->ptr, '#'))) {
\ No newline at end of file |