Mercurial > hg > nginx
comparison src/http/ngx_http_script.c @ 2608:2f4a3a4dfd34
fix plain text values using relative path in ngx_http_complex_value(),
this fixes the auth_basic_user_file bug introduced in r2589
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 27 Mar 2009 06:34:31 +0000 |
parents | 8afc4df77ee8 |
children | ad99a49cd313 |
comparison
equal
deleted
inserted
replaced
2607:cb96a60c8f10 | 2608:2f4a3a4dfd34 |
---|---|
116 if (v->len == 0) { | 116 if (v->len == 0) { |
117 ngx_conf_log_error(NGX_LOG_EMERG, ccv->cf, 0, "empty parameter"); | 117 ngx_conf_log_error(NGX_LOG_EMERG, ccv->cf, 0, "empty parameter"); |
118 return NGX_ERROR; | 118 return NGX_ERROR; |
119 } | 119 } |
120 | 120 |
121 nv = 0; | |
122 nc = 0; | |
123 | |
124 for (i = 0; i < v->len; i++) { | |
125 if (v->data[i] == '$') { | |
126 if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') { | |
127 nc++; | |
128 | |
129 } else { | |
130 nv++; | |
131 } | |
132 } | |
133 } | |
134 | |
135 if (v->data[0] != '$' && (ccv->conf_prefix || ccv->root_prefix)) { | |
136 | |
137 if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) { | |
138 return NGX_ERROR; | |
139 } | |
140 | |
141 ccv->conf_prefix = 0; | |
142 ccv->root_prefix = 0; | |
143 } | |
144 | |
121 ccv->complex_value->value = *v; | 145 ccv->complex_value->value = *v; |
122 ccv->complex_value->flushes = NULL; | 146 ccv->complex_value->flushes = NULL; |
123 ccv->complex_value->lengths = NULL; | 147 ccv->complex_value->lengths = NULL; |
124 ccv->complex_value->values = NULL; | 148 ccv->complex_value->values = NULL; |
125 | |
126 nv = 0; | |
127 nc = 0; | |
128 | |
129 for (i = 0; i < v->len; i++) { | |
130 if (v->data[i] == '$') { | |
131 if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') { | |
132 nc++; | |
133 | |
134 } else { | |
135 nv++; | |
136 } | |
137 } | |
138 } | |
139 | |
140 if (v->data[0] != '$' && (ccv->conf_prefix || ccv->root_prefix)) { | |
141 | |
142 if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) { | |
143 return NGX_ERROR; | |
144 } | |
145 | |
146 ccv->conf_prefix = 0; | |
147 ccv->root_prefix = 0; | |
148 } | |
149 | 149 |
150 if (nv == 0 && nc == 0) { | 150 if (nv == 0 && nc == 0) { |
151 return NGX_OK; | 151 return NGX_OK; |
152 } | 152 } |
153 | 153 |