diff options
| author | tls <tls@NetBSD.org> | 2010-12-14 13:27:39 +0000 |
|---|---|---|
| committer | tls <tls@NetBSD.org> | 2010-12-14 13:27:39 +0000 |
| commit | ccd96cb0fbf12b9d368d99d93f4981f344aaac8b (patch) | |
| tree | 7fb8f1dc32682983b6858e0118ceaf1d28217e0c /libexec/httpd | |
| parent | d3465daa3ec1e068726aae8afe5237504b57f69f (diff) | |
When invoking a content handler specified via -C, set the REDIRECT_STATUS
CGI variable to "200". This approximates the Apache behavior which is
required by phpcgi in PHP 5.3 (and by some compilations of older PHP
versions).
I have a revolutionary idea. Perhaps instead of imposing bizarre
requirements on other programs in the name of "security", the PHP
developers should make their own code compile with oh, I don't know,
maybe -Wuninitialized. That might have an effect on the security of
systems using PHP rather than on the "security" of such systems...
...excuse me, got to go now, I think my airquotes just wore out.
Diffstat (limited to 'libexec/httpd')
| -rw-r--r-- | libexec/httpd/cgi-bozo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libexec/httpd/cgi-bozo.c b/libexec/httpd/cgi-bozo.c index 7526708d432..db0f00be1b1 100644 --- a/libexec/httpd/cgi-bozo.c +++ b/libexec/httpd/cgi-bozo.c @@ -1,4 +1,4 @@ -/* $NetBSD: cgi-bozo.c,v 1.18 2010/09/20 23:11:38 mrg Exp $ */ +/* $NetBSD: cgi-bozo.c,v 1.19 2010/12/14 13:27:39 tls Exp $ */ /* $eterna: cgi-bozo.c,v 1.38 2010/09/20 22:25:00 mrg Exp $ */ @@ -408,6 +408,12 @@ bozo_process_cgi(bozo_httpreq_t *request) if (request->hr_remoteaddr && *request->hr_remoteaddr) bozo_setenv(httpd, "REMOTE_ADDR", request->hr_remoteaddr, curenvp++); + /* + * XXX Apache does this when invoking content handlers, and PHP + * XXX 5.3 requires it as a "security" measure. + */ + if (cgihandler) + bozo_setenv(httpd, "REDIRECT_STATUS", "200", curenvp++); bozo_auth_cgi_setenv(request, &curenvp); free(file); |
