comparison src/core/ngx_file.c @ 218:1bf60f8c5c9e NGINX_0_3_56

nginx 0.3.56 *) Feature: the "dav_access" directive. *) Feature: the "if" directive supports the "-d", "!-d", "-e", "!-e", "-x", and "!-x" operators. *) Bugfix: a segmentation fault occurred if an request returned an redirect and some sent to client header lines were logged in the access log.
author Igor Sysoev <http://sysoev.ru>
date Fri, 04 Aug 2006 00:00:00 +0400
parents fa32d59d9a15
children fbf2b2f66c9f
comparison
equal deleted inserted replaced
217:a346c23fc94e 218:1bf60f8c5c9e
164 file->name.data[pos] = '\0'; 164 file->name.data[pos] = '\0';
165 165
166 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, 166 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
167 "temp file: \"%s\"", file->name.data); 167 "temp file: \"%s\"", file->name.data);
168 168
169 if (ngx_create_dir(file->name.data) == NGX_FILE_ERROR) { 169 if (ngx_create_dir(file->name.data, 0700) == NGX_FILE_ERROR) {
170 err = ngx_errno; 170 err = ngx_errno;
171 if (err != NGX_EEXIST) { 171 if (err != NGX_EEXIST) {
172 ngx_log_error(NGX_LOG_CRIT, file->log, err, 172 ngx_log_error(NGX_LOG_CRIT, file->log, err,
173 ngx_create_dir_n " \"%s\" failed", 173 ngx_create_dir_n " \"%s\" failed",
174 file->name.data); 174 file->name.data);
182 return NGX_OK; 182 return NGX_OK;
183 } 183 }
184 184
185 185
186 ngx_err_t 186 ngx_err_t
187 ngx_create_full_path(u_char *dir) 187 ngx_create_full_path(u_char *dir, ngx_uint_t access)
188 { 188 {
189 u_char *p, ch; 189 u_char *p, ch;
190 ngx_err_t err; 190 ngx_err_t err;
191 191
192 for (p = dir + 1; *p; p++) { 192 for (p = dir + 1; *p; p++) {
196 continue; 196 continue;
197 } 197 }
198 198
199 *p = '\0'; 199 *p = '\0';
200 200
201 if (ngx_create_dir(dir) == NGX_FILE_ERROR) { 201 if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) {
202 err = ngx_errno; 202 err = ngx_errno;
203 if (err != NGX_EEXIST) { 203 if (err != NGX_EEXIST) {
204 return err; 204 return err;
205 } 205 }
206 } 206 }
368 #endif 368 #endif
369 369
370 path = cycle->pathes.elts; 370 path = cycle->pathes.elts;
371 for (i = 0; i < cycle->pathes.nelts; i++) { 371 for (i = 0; i < cycle->pathes.nelts; i++) {
372 372
373 if (ngx_create_dir(path[i]->name.data) == NGX_FILE_ERROR) { 373 if (ngx_create_dir(path[i]->name.data, 0700) == NGX_FILE_ERROR) {
374 err = ngx_errno; 374 err = ngx_errno;
375 if (err != NGX_EEXIST) { 375 if (err != NGX_EEXIST) {
376 ngx_log_error(NGX_LOG_EMERG, cycle->log, err, 376 ngx_log_error(NGX_LOG_EMERG, cycle->log, err,
377 ngx_create_dir_n " \"%s\" failed", 377 ngx_create_dir_n " \"%s\" failed",
378 path[i]->name.data); 378 path[i]->name.data);