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
Daniel Dumitriu 2021-05-31 14:03:29 +02:00 committed by Christopher Wellons
parent b6bbbc56c2
commit da8de6a647
1 changed files with 1 additions and 8 deletions

View File

@ -369,15 +369,8 @@ 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 {
if (mkdir(path, 0700) && !dir_exists(path))
fatal("mkdir(%s) -- %s", path, strerror(errno));
}
*s = '/';
s = strchr(s + 1, '/');
}