[BusyBox] httpd setgid support and CGI SERVER_ADDR var

Vladimir N. Oleynik dzo at simtreas.ru
Mon Oct 20 13:05:29 UTC 2003


> httpd supports setting the uid but not the gid after performing
> privileged operations.  I've added a -g switch to do this as it is
> needed by my CGI application.  It is also missing usage text for the -h
> option which I've added as part of the same patch.

 >  #define OPT_SETUID      (1<<(5+OPT_INC_1+OPT_INC_2))
 > +#define OPT_SETGID      (1<<(5+OPT_INC_1+OPT_INC_2))

This part have small mistake, must change 5 to 6.

> httpd does not set the SERVER_ADDR or SERVER_NAME env vars for CGI
> programs.  This breaks a CGI engine I'm using that requires this to
> generate HTTP redirect requests.  With BOA I'm getting both sent as the
> IP addr of the server, but the name is specified in a config. file so
> this should probably be a command line arg. in httpd.  For now I just
> set both to the string representation of the server IP addr from the
> server socket. Oops, that reminds me, I need to do the same in the
> inetd_server_only side as well--that will be in the next patch.

Hmm. Best method: call httpd with setted and exported this environs,
and patch httpd to don`t unset this vars, see saving PATH code.


More information about the busybox mailing list