[PATCH 01/07] Enable retrieving REMOTE_USER environment variable

The Ranger ranger at risk.ee
Fri Nov 27 21:46:19 CET 2015


---
 cgit.c | 1 +
 cgit.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/cgit.c b/cgit.c
index 05e5d57..50f7abb 100644
--- a/cgit.c
+++ b/cgit.c
@@ -401,6 +401,7 @@ static void prepare_context(void)
 	ctx.env.server_port = getenv("SERVER_PORT");
 	ctx.env.http_cookie = getenv("HTTP_COOKIE");
 	ctx.env.http_referer = getenv("HTTP_REFERER");
+	ctx.env.remote_user = getenv("REMOTE_USER");
 	ctx.env.content_length = getenv("CONTENT_LENGTH") ? strtoul(getenv("CONTENT_LENGTH"), NULL, 10) : 0;
 	ctx.env.authenticated = 0;
 	ctx.page.mimetype = "text/html";
diff --git a/cgit.h b/cgit.h
index b7eccdd..b5eecb6 100644
--- a/cgit.h
+++ b/cgit.h
@@ -297,6 +297,7 @@ struct cgit_environment {
 	const char *server_port;
 	const char *http_cookie;
 	const char *http_referer;
+	const char *remote_user;
 	unsigned int content_length;
 	int authenticated;
 };
-- 
2.1.4



More information about the CGit mailing list