From a1846fd154a41d9fe5b069ec0d39bb5e0735c858 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 21 Oct 2024 14:15:59 +0600 Subject: [PATCH] Added chmod for all file creation functions --- source/libublsettings.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libublsettings.c b/source/libublsettings.c index 0947c61..2fd7cf7 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -2227,6 +2227,7 @@ config_str yon_file_open(char *file_path, int *size){ int yon_file_save(char *file_path, char *text){ FILE *file = fopen(file_path,"w"); + chmod(file_path,0777); if (file){ fputs(text,file); fclose(file); @@ -2240,6 +2241,7 @@ int yon_file_create(char *path, char *name, int rules){ char *full_path = yon_char_unite(path,"/",name,NULL); if (access(full_path,F_OK)){ FILE *fl = fopen(full_path,"w"); + chmod(full_path,0777); if (fl){ chmod(full_path,rules); fclose(fl); @@ -2259,6 +2261,7 @@ int yon_file_create_full_path(char *path, int rules){ if (path){ if (access(path,F_OK)){ FILE *fl = fopen(path,"w"); + chmod(path,0777); if (fl){ chmod(path,rules); fclose(fl);