comparison src/core/ngx_file.c @ 6071:7bdd34cd2711

Core: limited levels of subdirectory hierarchy used for temp files. Similar to ngx_http_file_cache_set_slot(), the last component of file->name with a fixed length of 10 bytes, as generated in ngx_create_temp_path(), is used as a source for the names of intermediate subdirectories with each one taking its own part. Ensure that the sum of specified levels with slashes fits into the length (ticket #731).
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 07 Apr 2015 01:32:08 +0300
parents 3f5465a33fa8
children 6e10518f95d8
comparison
equal deleted inserted replaced
6070:3f5465a33fa8 6071:7bdd34cd2711
368 return "invalid value"; 368 return "invalid value";
369 } 369 }
370 370
371 path->level[i] = level; 371 path->level[i] = level;
372 path->len += level + 1; 372 path->len += level + 1;
373 }
374
375 if (path->len > 10 + i) {
376 return "invalid value";
373 } 377 }
374 378
375 *slot = path; 379 *slot = path;
376 380
377 if (ngx_add_path(cf, slot) == NGX_ERROR) { 381 if (ngx_add_path(cf, slot) == NGX_ERROR) {