int retval = 0;
int result;
+ mode_t old_umask;
tmp = malloc(strlen(path) + 1);
if (tmp == NULL)
/* skip first / */
path_p = path+1;
+ old_umask = umask(0);
for(;;) {
while (*path_p != '/') {
if(*path_p == 0)
}
free(tmp);
+ umask(old_umask);
return retval;
}
/* ENOENT */
int result;
- result = mkdir_p(dir, 0777);
+ /* mkdir mode to 0777 */
+ result = mkdir_p(dir, S_IRWXU | S_IRWXG | S_IRWXO);
if(result != 0) {
ERR("executing in recursive creation of directory %s", dir);
return -1;