comparison src/core/ngx_file.c @ 318:fc223117327f NGINX_0_6_3

nginx 0.6.3 *) Feature: the "proxy_store" and "fastcgi_store" directives. *) Bugfix: a segmentation fault might occur in worker process if the "auth_http_header" directive was used. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault occurred in worker process if the CRAM-MD5 authentication method was used, but it was not enabled. *) Bugfix: a segmentation fault might occur in worker process when the HTTPS protocol was used in the "proxy_pass" directive. *) Bugfix: a segmentation fault might occur in worker process if the eventport method was used. *) Bugfix: the "proxy_ignore_client_abort" and "fastcgi_ignore_client_abort" directives did not work; bug appeared in 0.5.13.
author Igor Sysoev <http://sysoev.ru>
date Thu, 12 Jul 2007 00:00:00 +0400
parents 675a39fd14cd
children 95183808f549
comparison
equal deleted inserted replaced
317:fcdf0e42c859 318:fc223117327f
288 if (ngx_add_path(cf, slot) == NGX_ERROR) { 288 if (ngx_add_path(cf, slot) == NGX_ERROR) {
289 return NGX_CONF_ERROR; 289 return NGX_CONF_ERROR;
290 } 290 }
291 291
292 return NGX_CONF_OK; 292 return NGX_CONF_OK;
293 }
294
295
296 char *
297 ngx_conf_set_access_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
298 {
299 char *confp = conf;
300
301 u_char *p;
302 ngx_str_t *value;
303 ngx_uint_t i, right, shift, *access;
304
305 access = (ngx_uint_t *) (confp + cmd->offset);
306
307 if (*access != NGX_CONF_UNSET_UINT) {
308 return "is duplicate";
309 }
310
311 value = cf->args->elts;
312
313 *access = 0600;
314
315 for (i = 1; i < cf->args->nelts; i++) {
316
317 p = value[i].data;
318
319 if (ngx_strncmp(p, "user:", sizeof("user:") - 1) == 0) {
320 shift = 6;
321 p += sizeof("user:") - 1;
322
323 } else if (ngx_strncmp(p, "group:", sizeof("group:") - 1) == 0) {
324 shift = 3;
325 p += sizeof("group:") - 1;
326
327 } else if (ngx_strncmp(p, "all:", sizeof("all:") - 1) == 0) {
328 shift = 0;
329 p += sizeof("all:") - 1;
330
331 } else if (ngx_strncmp(p, "off", sizeof("off") - 1) == 0) {
332 *access = 0;
333 return NGX_CONF_OK;
334
335 } else {
336 goto invalid;
337 }
338
339 if (ngx_strcmp(p, "rw") == 0) {
340 right = 6;
341
342 } else if (ngx_strcmp(p, "r") == 0) {
343 right = 4;
344
345 } else {
346 goto invalid;
347 }
348
349 *access |= right << shift;
350 }
351
352 return NGX_CONF_OK;
353
354 invalid:
355
356 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid value \"%V\"", &value[i]);
357
358 return NGX_CONF_ERROR;
293 } 359 }
294 360
295 361
296 ngx_int_t 362 ngx_int_t
297 ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot) 363 ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)