diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index 6bed3fc..4d02b01 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -26,9 +26,17 @@ int yon_configuration_path_check(const char *path){ data->action_text = homedir_create?CREATE_CONFIG_DIALOG_LABEL_HOMEDIR:CREATE_CONFIG_DIALOG_LABEL; data->title = WARNING_TITLE_LABEL; if (yon_confirmation_dialog_call(NULL,data)==GTK_RESPONSE_ACCEPT){ + char *dir_path = yon_file_get_parent(full_path); + if (access(full_path,F_OK)&&(access(dir_path,W_OK)||access(dir_path,R_OK))){ + if (system(ubconfig_file_create_pkexec(full_path))){ + return 0; + } + } else if (access(full_path,F_OK)){ yon_launch(ubconfig_file_create(full_path)); struct passwd *user = getpwnam(yon_ubl_root_user_get()); if (chown(full_path,user->pw_uid,user->pw_gid)){}; + } + } else { return 0; diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 060edfa..107d78f 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -294,6 +294,7 @@ layout && /description:/ {\ #define get_devices_command "ubinstall show --lsdevices" #define get_parts_for_device_command "ubinstall show --lsparts" #define get_modules_command "ubinstall show --lsmodules" +#define ubconfig_file_create_pkexec(target) yon_char_unite("pkexec ubconfig --target \"",target,"\" create",NULL) #define config_get_command(target) yon_char_unite("ubconfig -ea --conarg --source ", target, " get [autoinstall] AUTOINSTALL[*] -- get [locale] LANG", NULL)