SERVER_NAME in httpd.c (busybox-1.13.3)

Denys Vlasenko vda.linux at googlemail.com
Wed Mar 18 22:59:30 UTC 2009


On Wednesday 18 March 2009 21:29, Benedikt Hochstrasser wrote:
> Denys,
> 
> it would, but when you run httpd off inet, it's a bit trickier (you'd
> have to set the environment once you run inetd).

Not necessarily:

inetd.conf:

1234 stream tcp nowait root env env - VAR=val /bin/env

testing...

# nc -nvvv 127.0.0.1 1234
127.0.0.1 (127.0.0.1:1234) open
VAR=val
sent 0, rcvd 8

Replace /bin/env above with httpd and you are all set.

> When you look at eg php.ini, variables_order is often set to "GPCS"
> (get, post, cookie, system) and the envrionment variables are left
> out.

In this case, it will discard environment variables set by httpd's as well.
They are no different from those set by httpd's parent.

> Ideally one could make its compilation dependent on #DEFINE
> FULL_CGI_VARS or somesuch...

I tend to use standard tools (env, umask, setlimit...)
instead of coding it in every program anew.
--
vda


More information about the busybox mailing list