From 949ea7d73af2d50123114b4a682f3470febd9258 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 25 Oct 2024 10:13:38 +0600 Subject: [PATCH] Added own changing to all file access functions --- source/libublsettings-gtk3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index cdd8dfe..adc26ee 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -293,6 +293,8 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi if (!access(path,0)){ __yon_window_config_file = g_key_file_new(); __yon_window_config_path=yon_char_new(path); + struct passwd *user = getpwnam(yon_ubl_root_user_get()); + chown(__yon_window_config_path,user->pw_uid,user->pw_gid); chmod(__yon_window_config_path,0777); if (!g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL)){ struct stat st; @@ -304,6 +306,8 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi } FILE *fp; fp=fopen(__yon_window_config_path,"w"); + struct passwd *user = getpwnam(yon_ubl_root_user_get()); + chown(__yon_window_config_path,user->pw_uid,user->pw_gid); chmod(__yon_window_config_path,0777); fclose(fp); g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL);