]>
Commit | Line | Data |
---|---|---|
d39a6d5a | 1 | diff -urN php-4.1.1.orig/main/SAPI.c php-4.1.1/main/SAPI.c |
2 | --- php-4.1.1.orig/main/SAPI.c Mon Feb 4 13:07:01 2002 | |
3 | +++ php-4.1.1/main/SAPI.c Mon Feb 4 13:29:44 2002 | |
4 | @@ -25,9 +25,6 @@ | |
5 | #include "SAPI.h" | |
6 | #include "ext/standard/php_string.h" | |
7 | #include "ext/standard/pageinfo.h" | |
8 | -#if HAVE_PCRE || HAVE_BUNDLED_PCRE | |
9 | -#include "ext/pcre/php_pcre.h" | |
10 | -#endif | |
11 | #ifdef ZTS | |
12 | #include "TSRM.h" | |
13 | #endif | |
14 | @@ -448,64 +445,8 @@ | |
15 | } else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */ | |
16 | int newlen; | |
17 | char *result, *newheader; | |
18 | -#if HAVE_PCRE || HAVE_BUNDLED_PCRE | |
19 | - zval *repl_temp; | |
20 | - char *ptr = colon_offset+1; | |
21 | - int ptr_len=0, result_len = 0; | |
22 | -#endif | |
23 | ||
24 | SG(sapi_headers).http_response_code = 401; /* authentication-required */ | |
25 | -#if HAVE_PCRE || HAVE_BUNDLED_PCRE | |
26 | - if(PG(safe_mode)) { | |
27 | - myuid = php_getuid(); | |
28 | - | |
29 | - ptr_len = strlen(ptr); | |
30 | - MAKE_STD_ZVAL(repl_temp); | |
31 | - Z_STRVAL_P(repl_temp) = emalloc(32); | |
32 | - Z_STRLEN_P(repl_temp) = sprintf(Z_STRVAL_P(repl_temp), "realm=\"\\1-%ld\"", myuid); | |
33 | - /* Modify quoted realm value */ | |
34 | - result = php_pcre_replace("/realm=\"(.*?)\"/i", 16, | |
35 | - ptr, ptr_len, | |
36 | - repl_temp, | |
37 | - 0, &result_len, -1 TSRMLS_CC); | |
38 | - if(result_len==ptr_len) { | |
39 | - efree(result); | |
40 | - sprintf(Z_STRVAL_P(repl_temp), "realm=\\1-%ld\\2", myuid); | |
41 | - /* modify unquoted realm value */ | |
42 | - result = php_pcre_replace("/realm=([^\\s]+)(.*)/i", 21, | |
43 | - ptr, ptr_len, | |
44 | - repl_temp, | |
45 | - 0, &result_len, -1 TSRMLS_CC); | |
46 | - if(result_len==ptr_len) { | |
47 | - char *lower_temp = estrdup(ptr); | |
48 | - char conv_temp[32]; | |
49 | - int conv_len; | |
50 | - | |
51 | - php_strtolower(lower_temp,strlen(lower_temp)); | |
52 | - /* If there is no realm string at all, append one */ | |
53 | - if(!strstr(lower_temp,"realm")) { | |
54 | - efree(result); | |
55 | - conv_len = sprintf(conv_temp," realm=\"%ld\"",myuid); | |
56 | - result = emalloc(ptr_len+conv_len+1); | |
57 | - result_len = ptr_len + conv_len; | |
58 | - memcpy(result, ptr, ptr_len); | |
59 | - memcpy(result+ptr_len, conv_temp, conv_len); | |
60 | - *(result+ptr_len+conv_len) = '\0'; | |
61 | - } | |
62 | - efree(lower_temp); | |
63 | - } | |
64 | - } | |
65 | - newlen = sizeof("WWW-Authenticate: ") + result_len; | |
66 | - newheader = emalloc(newlen+1); | |
67 | - sprintf(newheader,"WWW-Authenticate: %s", result); | |
68 | - efree(header_line); | |
69 | - sapi_header.header = newheader; | |
70 | - sapi_header.header_len = newlen; | |
71 | - efree(result); | |
72 | - efree(Z_STRVAL_P(repl_temp)); | |
73 | - efree(repl_temp); | |
74 | - } | |
75 | -#else | |
76 | if(PG(safe_mode)) { | |
77 | myuid = php_getuid(); | |
78 | result = emalloc(32); | |
79 | @@ -516,7 +457,6 @@ | |
80 | sapi_header.header_len = newlen; | |
81 | efree(result); | |
82 | } | |
83 | -#endif | |
84 | } | |
85 | if (sapi_header.header==header_line) { | |
86 | *colon_offset = ':'; |