mirror of https://github.com/skeeto/enchive.git
Remove read constraint for directories on key path
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. Closes #28.pull/29/head
parent
b6bbbc56c2
commit
da8de6a647
|
@ -369,15 +369,8 @@ storage_directory(char *file)
|
||||||
s = strchr(path + 1, '/');
|
s = strchr(path + 1, '/');
|
||||||
while (s) {
|
while (s) {
|
||||||
*s = 0;
|
*s = 0;
|
||||||
if (dir_exists(path) || !mkdir(path, 0700)) {
|
if (mkdir(path, 0700) && !dir_exists(path))
|
||||||
DIR *dir = opendir(path);
|
|
||||||
if (dir)
|
|
||||||
closedir(dir);
|
|
||||||
else
|
|
||||||
fatal("opendir(%s) -- %s", path, strerror(errno));
|
|
||||||
} else {
|
|
||||||
fatal("mkdir(%s) -- %s", path, strerror(errno));
|
fatal("mkdir(%s) -- %s", path, strerror(errno));
|
||||||
}
|
|
||||||
*s = '/';
|
*s = '/';
|
||||||
s = strchr(s + 1, '/');
|
s = strchr(s + 1, '/');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue