mirror of https://github.com/skeeto/enchive.git
Fix 'access denied' on when intermediate directories are not readable.
On Unix, do not check whether all directories on the path to storage_dir are readable; in corporate environments this is often not the case.pull/28/head
parent
b6bbbc56c2
commit
4162fe73d6
|
@ -369,15 +369,9 @@ storage_directory(char *file)
|
|||
s = strchr(path + 1, '/');
|
||||
while (s) {
|
||||
*s = 0;
|
||||
if (dir_exists(path) || !mkdir(path, 0700)) {
|
||||
DIR *dir = opendir(path);
|
||||
if (dir)
|
||||
closedir(dir);
|
||||
else
|
||||
fatal("opendir(%s) -- %s", path, strerror(errno));
|
||||
} else {
|
||||
fatal("mkdir(%s) -- %s", path, strerror(errno));
|
||||
}
|
||||
if (!dir_exists(path))
|
||||
if (mkdir(path, 0700))
|
||||
fatal("mkdir(%s) -- %s", path, strerror(errno));
|
||||
*s = '/';
|
||||
s = strchr(s + 1, '/');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue