Patch from Stephane Billiart:
authorEric Andersen <andersen@codepoet.org>
Fri, 19 Dec 2003 11:23:47 +0000 (11:23 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 19 Dec 2003 11:23:47 +0000 (11:23 -0000)
This removes references to config->remoteuser when
CONFIG_FEATURE_HTTPD_CGI=y but CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set

networking/httpd.c

index 1a3f5f94f3a26d96b1c3ce7b75903f47695c5fe0..a02b63a381c1ffcbbeb0fa92a20509df47942d64 100644 (file)
@@ -1148,10 +1148,12 @@ static int sendCgi(const char *url,
        addEnv("HTTP", "COOKIE", cookie);
       if(content_type)
        addEnv("CONTENT", "TYPE", content_type);
+#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
       if(config->remoteuser) {
        addEnv("REMOTE", "USER", config->remoteuser);
        addEnv("AUTH_TYPE", "", "Basic");
       }
+#endif
       if(config->referer)
        addEnv("HTTP", "REFERER", config->referer);
 
@@ -1707,8 +1709,10 @@ FORBIDDEN:      /* protect listing /cgi-bin */
 # ifdef CONFIG_FEATURE_HTTPD_CGI
   free(cookie);
   free(content_type);
-  free(config->remoteuser);
   free(config->referer);
+#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
+  free(config->remoteuser);
+#endif
 # endif
   shutdown(a_c_w, SHUT_WR);
   shutdown(a_c_r, SHUT_RD);