ignore EACCES errors for top level directories in ngx_create_full_path()
This commit is contained in:
parent
5371898ba2
commit
832500ff82
1 changed files with 11 additions and 2 deletions
|
@ -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 a new issue