SERVER_NAME in httpd.c (busybox-1.13.3)

Benedikt Hochstrasser tictactux at gmail.com
Wed Mar 11 22:04:40 UTC 2009


Folks,

an absurdly simple patch for httpd.c that provides the often-needed
SERVER_NAME cgi environment variable.

Dunno if I did everything right (eg checking the dependencies), but it
appears to be working.

--- httpd.c     2009-02-26 12:46:24.000000000 +0100
+++ httpd-new.c 2009-03-11 22:52:44.000000000 +0100
@@ -1388,6 +1388,7 @@
               }
       }
       setenv1("HTTP_USER_AGENT", user_agent);
+       setenv1("SERVER_NAME", safe_gethostname());
       if (http_accept)
               setenv1("HTTP_ACCEPT", http_accept);
       if (http_accept_language)


--
Ben
-------------- next part --------------
--- httpd.c	2009-02-26 12:46:24.000000000 +0100
+++ httpd-new.c	2009-03-11 22:52:44.000000000 +0100
@@ -1388,6 +1388,7 @@
 		}
 	}
 	setenv1("HTTP_USER_AGENT", user_agent);
+	setenv1("SERVER_NAME", safe_gethostname());
 	if (http_accept)
 		setenv1("HTTP_ACCEPT", http_accept);
 	if (http_accept_language)


More information about the busybox mailing list