mirror of
https://github.com/nginx/nginx.git
synced 2024-12-03 04:39:00 +08:00
ignore EACCES errors for top level directories in ngx_create_full_path()
This commit is contained in:
parent
d0188e09af
commit
3f438068eb
@ -183,6 +183,8 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
|
|||||||
u_char *p, ch;
|
u_char *p, ch;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
|
|
||||||
|
err = 0;
|
||||||
|
|
||||||
#if (NGX_WIN32)
|
#if (NGX_WIN32)
|
||||||
p = dir + 3;
|
p = dir + 3;
|
||||||
#else
|
#else
|
||||||
@ -200,7 +202,14 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
|
|||||||
|
|
||||||
if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) {
|
if (ngx_create_dir(dir, access) == NGX_FILE_ERROR) {
|
||||||
err = ngx_errno;
|
err = ngx_errno;
|
||||||
if (err != NGX_EEXIST) {
|
|
||||||
|
switch (err) {
|
||||||
|
case NGX_EEXIST:
|
||||||
|
err = 0;
|
||||||
|
case NGX_EACCES:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,7 +217,7 @@ ngx_create_full_path(u_char *dir, ngx_uint_t access)
|
|||||||
*p = '/';
|
*p = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user