comparison src/core/ngx_file.c @ 320:95183808f549 NGINX_0_6_4

nginx 0.6.4 *) Security: the "msie_refresh" directive allowed XSS. Thanks to Maxim Boguk. *) Change: the "proxy_store" and "fastcgi_store" directives were changed. *) Feature: the "proxy_store_access" and "fastcgi_store_access" directives. *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun Studio. Thanks to Andrei Nigmatulin. *) Workaround: for Sun Studio 12. Thanks to Jiang Hong.
author Igor Sysoev <http://sysoev.ru>
date Tue, 17 Jul 2007 00:00:00 +0400
parents fc223117327f
children d16d691432c9
comparison
equal deleted inserted replaced
319:6ccd0af7f704 320:95183808f549
301 u_char *p; 301 u_char *p;
302 ngx_str_t *value; 302 ngx_str_t *value;
303 ngx_uint_t i, right, shift, *access; 303 ngx_uint_t i, right, shift, *access;
304 304
305 access = (ngx_uint_t *) (confp + cmd->offset); 305 access = (ngx_uint_t *) (confp + cmd->offset);
306 306
307 if (*access != NGX_CONF_UNSET_UINT) { 307 if (*access != NGX_CONF_UNSET_UINT) {
308 return "is duplicate"; 308 return "is duplicate";
309 } 309 }
310 310
311 value = cf->args->elts; 311 value = cf->args->elts;
312 312
313 *access = 0600; 313 *access = 0600;
314 314
315 for (i = 1; i < cf->args->nelts; i++) { 315 for (i = 1; i < cf->args->nelts; i++) {
326 326
327 } else if (ngx_strncmp(p, "all:", sizeof("all:") - 1) == 0) { 327 } else if (ngx_strncmp(p, "all:", sizeof("all:") - 1) == 0) {
328 shift = 0; 328 shift = 0;
329 p += sizeof("all:") - 1; 329 p += sizeof("all:") - 1;
330 330
331 } else if (ngx_strncmp(p, "off", sizeof("off") - 1) == 0) {
332 *access = 0;
333 return NGX_CONF_OK;
334
335 } else { 331 } else {
336 goto invalid; 332 goto invalid;
337 } 333 }
338 334
339 if (ngx_strcmp(p, "rw") == 0) { 335 if (ngx_strcmp(p, "rw") == 0) {
346 goto invalid; 342 goto invalid;
347 } 343 }
348 344
349 *access |= right << shift; 345 *access |= right << shift;
350 } 346 }
351 347
352 return NGX_CONF_OK; 348 return NGX_CONF_OK;
353 349
354 invalid: 350 invalid:
355 351
356 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid value \"%V\"", &value[i]); 352 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid value \"%V\"", &value[i]);