From 381f9919d2b5a84bb72b1dec33623c5e6bbf1f6e Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sat, 30 Oct 2010 10:43:26 +0200 Subject: [PATCH] call*cgi: Added the REMOTE_USER CGI variable, as a mapping from X-Ash-Remote-User. --- src/callcgi.c | 2 ++ src/callfcgi.c | 2 ++ src/callscgi.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/callcgi.c b/src/callcgi.c index c29edd4..528219a 100644 --- a/src/callcgi.c +++ b/src/callcgi.c @@ -127,6 +127,8 @@ static pid_t forkchild(int inpath, char *prog, char *file, char *method, char *u putenv("HTTPS=on"); if(getenv("REQ_X_ASH_ADDRESS")) putenv(sprintf2("REMOTE_ADDR=%s", getenv("REQ_X_ASH_ADDRESS"))); + if(getenv("REQ_X_ASH_REMOTE_USER")) + putenv(sprintf2("REMOTE_USER=%s", getenv("REQ_X_ASH_REMOTE_USER"))); if(getenv("REQ_CONTENT_TYPE")) putenv(sprintf2("CONTENT_TYPE=%s", getenv("REQ_CONTENT_TYPE"))); if(getenv("REQ_CONTENT_LENGTH")) diff --git a/src/callfcgi.c b/src/callfcgi.c index a394a42..d36e98c 100644 --- a/src/callfcgi.c +++ b/src/callfcgi.c @@ -465,6 +465,8 @@ static void mkcgienv(struct hthead *req, struct charbuf *dst) bufaddenv(dst, "SERVER_NAME", "%s", h); if((h = getheader(req, "X-Ash-Server-Port")) != NULL) bufaddenv(dst, "SERVER_PORT", "%s", h); + if((h = getheader(req, "X-Ash-Remote-User")) != NULL) + bufaddenv(dst, "REMOTE_USER", "%s", h); if(((h = getheader(req, "X-Ash-Protocol")) != NULL) && !strcmp(h, "https")) bufaddenv(dst, "HTTPS", "on"); if((h = getheader(req, "X-Ash-Address")) != NULL) diff --git a/src/callscgi.c b/src/callscgi.c index af84a9a..ba598fd 100644 --- a/src/callscgi.c +++ b/src/callscgi.c @@ -428,6 +428,8 @@ static void mkcgienv(struct hthead *req, struct charbuf *dst) bufaddenv(dst, "SERVER_NAME", "%s", h); if((h = getheader(req, "X-Ash-Server-Port")) != NULL) bufaddenv(dst, "SERVER_PORT", "%s", h); + if((h = getheader(req, "X-Ash-Remote-User")) != NULL) + bufaddenv(dst, "REMOTE_USER", "%s", h); if(((h = getheader(req, "X-Ash-Protocol")) != NULL) && !strcmp(h, "https")) bufaddenv(dst, "HTTPS", "on"); if((h = getheader(req, "X-Ash-Address")) != NULL) -- 2.11.0