cvs: php4 /sapi/cgi cgi_main.c
| From: | Sascha Schumann | Date: | Fri, 27 Oct 2000 10:26:57 +0000 |
| Subject: | cvs: php4 /sapi/cgi cgi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2292@lists.php.net to get a copy of this message | ||
sas Fri Oct 27 03:26:57 2000 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
The CGI RFC allows servers to pass Authorization data to the script,
if the server did not use the information contained therein.
See 6.1.5 and 11.2 of the proposed spec.
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.75 php4/sapi/cgi/cgi_main.c:1.76
--- php4/sapi/cgi/cgi_main.c:1.75 Thu Oct 26 16:49:45 2000
+++ php4/sapi/cgi/cgi_main.c Fri Oct 27 03:26:57 2000
@@ -276,6 +276,7 @@
static void init_request_info(SLS_D)
{
char *content_length = getenv("CONTENT_LENGTH");
+ const char *auth;
#if 0
/* SG(request_info).path_translated is always set to NULL at the end of this function
@@ -326,10 +327,14 @@
SG(request_info).content_type = getenv("CONTENT_TYPE");
SG(request_info).content_length = (content_length?atoi(content_length):0);
SG(sapi_headers).http_response_code = 200;
- /* CGI does not support HTTP authentication */
- SG(request_info).auth_user = NULL;
- SG(request_info).auth_password = NULL;
-
+
+ /* The CGI RFC allows servers to pass on unvalidated Authorization data */
+ if ((auth = getenv("HTTP_AUTHORIZATION"))) {
+ php_handle_auth_data(auth SLS_CC);
+ } else {
+ SG(request_info).auth_user = NULL;
+ SG(request_info).auth_password = NULL;
+ }
}