diff --git a/source/libublsettings.c b/source/libublsettings.c index 9aa99b7..86b6a84 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -2263,22 +2263,33 @@ int yon_file_create(char *path, char *name, int rules){ int yon_file_create_full_path(char *path, int rules){ if (path){ if (access(path,F_OK)){ - FILE *fl = fopen(path,"w"); - if (fl){ - struct passwd *user = getpwnam(yon_ubl_root_user_get()); - chown(path,user->pw_uid,user->pw_gid); - chmod(path,rules); - fclose(fl); - return 1; - } else { - return 0; + int size; + config_str parsed = yon_char_parse(path,&size,"/"); + char *current = ""; + for (int i=0;ipw_uid,user->pw_gid); + int chmod_success = chmod(temp,rules); + } + } + if (!yon_char_is_empty(current)) free(current); + current = temp; } + + return 1; } else { - return -1; + return 0; } - } else { - return 0; } + return 0; } config_str yon_file_list_dirs (char *path, int *size){