call*cgi: Added the REMOTE_USER CGI variable, as a mapping from X-Ash-Remote-User.
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 30 Oct 2010 08:43:26 +0000 (10:43 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 30 Oct 2010 08:43:26 +0000 (10:43 +0200)
src/callcgi.c
src/callfcgi.c
src/callscgi.c

index c29edd4..528219a 100644 (file)
@@ -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"))
index a394a42..d36e98c 100644 (file)
@@ -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)
index af84a9a..ba598fd 100644 (file)
@@ -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)