From 833e6620fa8313211c7b25d450e7f544b7efb367 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 09:44:03 +0600 Subject: [PATCH 01/33] Fixed user window's uid parsing --- source/ubl-settings-usergroups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 529b412..3394f51 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -2029,7 +2029,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(window->userUserNameEntry), parsed_size>0?parameters[0]:""); window->old_username=name; if (parsed_size>1){ - if (parsed_size>1&&!strcmp(parameters[1],"x")||parsed_size<=1||strcmp(parameters[1],"")){ + if (parsed_size>1&&!strcmp(parameters[1],"x")&&!strcmp(parameters[1],"")||parsed_size<=1){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0); gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry), parsed_size>1?parameters[1]:""); } -- 2.35.1 From 569bba63c7d5dc8a0998ef73f64f339f5e9d39c1 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 10:29:08 +0600 Subject: [PATCH 02/33] Fixed user with default password hasn't been blocking --- source/ubl-settings-usergroups.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 3394f51..296a74c 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1511,17 +1511,17 @@ void on_user_save(GtkWidget *self, dictionary *dict){ yon_ubl_status_highlight_incorrect(window->userPasswordEntry); return; } - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck))){ - if (password[0]=='%'&&password[1]=='%'){ - char *temp = yon_char_replace(password,"%%","!!"); - password = yon_char_replace(temp,"!!","%%!*"); - } else { - password = yon_char_append("!*",password); - } - } } else { password=""; } + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck))){ + if (strlen(password)>1&&password[0]=='%'&&password[1]=='%'){ + char *temp = yon_char_replace(password,"%%","!!"); + password = yon_char_replace(temp,"!!","%%!*"); + } else { + password = yon_char_append("!*",password); + } + } username = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUserNameEntry)); if (yon_char_is_empty(username)){ @@ -1607,9 +1607,6 @@ void on_user_save(GtkWidget *self, dictionary *dict){ yon_samba_sync_remove(login); } - int deactivate_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck)); - if (deactivate_active); - extra_options=(char*)gtk_entry_get_text(GTK_ENTRY(window->userExtraOptionsEntry)); if (!window->old_password||window->old_password&&strcmp(window->old_password,password)){ @@ -2049,7 +2046,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ } } - if (parsed_size>4&&!yon_char_is_empty(parameters[4])){ + if (parsed_size>4&&!yon_char_is_empty(parameters[4])&&strcmp(parameters[4],"")&&strcmp(parameters[4],"x")){ int params_size; config_str parameters_substring = yon_char_parse(parameters[4],¶ms_size," "); for (int i=0;i Date: Mon, 26 Feb 2024 10:58:07 +0600 Subject: [PATCH 03/33] Removed 'Automatic' at user table's UID column --- source/ubl-settings-usergroups.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 296a74c..77de2b3 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1514,7 +1514,9 @@ void on_user_save(GtkWidget *self, dictionary *dict){ } else { password=""; } - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck))){ + + deactivate = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck)); + if (deactivate){ if (strlen(password)>1&&password[0]=='%'&&password[1]=='%'){ char *temp = yon_char_replace(password,"%%","!!"); password = yon_char_replace(temp,"!!","%%!*"); @@ -1706,7 +1708,8 @@ void on_user_save(GtkWidget *self, dictionary *dict){ if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->UsersTree)),&model,&iter)) gtk_list_store_append(widgets->UsersList,&iter); gtk_list_store_set(widgets->UsersList,&iter, - 1,yon_char_return_if_exist(uid_string,AUTOMATICALLY_LABEL), + 0,deactivate, + 1,yon_char_return_if_exist(uid_string,""), 2,yon_char_return_if_exist(login,""), 3,yon_char_return_if_exist(username,""), 4,yon_char_return_if_exist(main_group,login), @@ -2085,8 +2088,10 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userDeactivatedCheck),1); } yon_char_divide(strstr(parameters[5],"!*"),1); - gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),parameters[5]); - gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2); + if (!yon_char_is_empty(parameters[5])){ + gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry),parameters[5]); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->userPasswordCombo),2); + } } } int samba_sync = yon_samba_sync_get(name); -- 2.35.1 From cb16328de20378313d7ff4464a71f7ba78bb741e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 10:58:43 +0600 Subject: [PATCH 04/33] XFCE categories added for system section --- ubl-settings-usergroups.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubl-settings-usergroups.desktop b/ubl-settings-usergroups.desktop index 527e73d..5e3efa3 100644 --- a/ubl-settings-usergroups.desktop +++ b/ubl-settings-usergroups.desktop @@ -12,4 +12,4 @@ Icon=com.ublinux.ubl-settings-usergroups Terminal=false X-XfcePluggable=true X-UBLPluggable=true -Categories=X-UBL-SettingsManager;X-UBL-SystemSettings +Categories=X-UBL-SettingsManager;X-UBL-SystemSettings;SystemSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;Settings;DesktopSettings -- 2.35.1 From 4084807e2d36e680ec7158c8e588a842a970e389 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 10:59:09 +0600 Subject: [PATCH 05/33] Remved modal status of system users and groups window --- ubl-settings-usergroups-system.glade | 1 - 1 file changed, 1 deletion(-) diff --git a/ubl-settings-usergroups-system.glade b/ubl-settings-usergroups-system.glade index f7cf5ac..47747a6 100644 --- a/ubl-settings-usergroups-system.glade +++ b/ubl-settings-usergroups-system.glade @@ -59,7 +59,6 @@ 800 600 False - True com.ublinux.ubl-settings-usergroups -- 2.35.1 From 6f79008b1fd5a9ab395670548195d0006af9f1b1 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 10:59:49 +0600 Subject: [PATCH 06/33] fixed wrong render for 'Locked' column --- ubl-settings-usergroups.glade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubl-settings-usergroups.glade b/ubl-settings-usergroups.glade index 60b4421..535d785 100644 --- a/ubl-settings-usergroups.glade +++ b/ubl-settings-usergroups.glade @@ -333,6 +333,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0 + + 0 + -- 2.35.1 From db8e1fab036f25fba13d4c5715c9c0b64926c2f5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 11:35:16 +0600 Subject: [PATCH 07/33] Fixed home folder saving --- source/ubl-settings-usergroups.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 77de2b3..66da497 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1623,6 +1623,8 @@ void on_user_save(GtkWidget *self, dictionary *dict){ day=yon_char_append("0",day); } password_changed_date = yon_char_unite(yon_char_from_int(1900+tm.tm_year),"-",month,"-",day,NULL); + } else { + password_changed_date = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordChangedEntry)); } int force_at_next_login_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userForceChangeCheck)); @@ -1815,7 +1817,10 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w int user_home_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userHomeCombo)); if (user_home_active==2){ - user_home=yon_char_unite("--home-dir ",(char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)),NULL); + char *path = (char*)gtk_entry_get_text(GTK_ENTRY(window->userHomeEntry)); + if (!yon_char_is_empty(path)) + user_home=yon_char_unite("--home-dir ",path,NULL); + else user_home = ""; } else if (user_home_active==1){ user_home="--no-create-home"; } else user_home = ""; @@ -1837,7 +1842,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w main_group = ""; } char *final_string = user_home; - final_string = yon_char_unite(!yon_char_is_empty(final_string)?" ":"", + final_string = yon_char_unite(user_home,!yon_char_is_empty(final_string)?" ":"", yon_char_return_if_exist(user_shell,""), !yon_char_is_empty(user_shell)?" ":"", yon_char_return_if_exist(create_system_user,""), -- 2.35.1 From 5b04f3b3386c21fb2874d564718673d5b8246895 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 14:05:21 +0600 Subject: [PATCH 08/33] Added sorting for system users and groups window --- ubl-settings-usergroups-system.glade | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ubl-settings-usergroups-system.glade b/ubl-settings-usergroups-system.glade index 47747a6..1dfbd92 100644 --- a/ubl-settings-usergroups-system.glade +++ b/ubl-settings-usergroups-system.glade @@ -167,6 +167,7 @@ fixed 50 Login + 2 @@ -181,6 +182,7 @@ fixed 50 Username + 3 @@ -196,6 +198,7 @@ 50 Primary group + 4 @@ -211,6 +214,7 @@ group 50 Additional groups + 5 150 @@ -226,6 +230,7 @@ groups 50 Home directory + 6 @@ -238,6 +243,7 @@ directory Shell path + 7 @@ -250,6 +256,7 @@ path Password has been changed + 8 @@ -262,6 +269,7 @@ been changed Expiration date + 9 @@ -274,6 +282,7 @@ date Password change interval (min) + 10 @@ -286,6 +295,7 @@ interval (min) Password change interval (max) + 11 @@ -298,6 +308,7 @@ interval (max) Days until warning + 12 @@ -310,6 +321,7 @@ warning Days without activity + 13 -- 2.35.1 From eb06453aaa096a9dc45e748b512ca18f3ee778be Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 15:17:25 +0600 Subject: [PATCH 09/33] Localisation for hash descriptions --- csv/hash_list.csv | 30 ++-- source/ubl-settings-usergroups.c | 2 +- source/ubl-strings.h | 15 ++ ubl-settings-usergroups.pot | 246 +++++++++++++++++++------------ ubl-settings-usergroups_ru.po | 244 ++++++++++++++++++------------ 5 files changed, 338 insertions(+), 199 deletions(-) diff --git a/csv/hash_list.csv b/csv/hash_list.csv index 31f9bae..e193915 100644 --- a/csv/hash_list.csv +++ b/csv/hash_list.csv @@ -1,16 +1,16 @@ hash_algoritm;hash_description -des;DES (Алгоритм для симметричного шифрования) -md5;MD5 (128-битный алгоритм хеширования) -yescrypt;yescrypt (Криптографическая хэш-функция) -gost-yescrypt;GOST-YESCRYPT (Конструкция согласно ГОСТ Р 34.11─2012) -scrypt;scrypt (Адаптивная криптографическая функция формирования ключа) -bf;Blowfish (Алгоритм блочного симметричного шифрования) -bcrypt;bcrypt (Адаптивная хеш-функция из семейства алгоритмов Blowfish) -bcrypt-a;bcrypt-a (Адаптивная хеш-функция из семейства алгоритмов Blowfish) -sha512crypt;SHA512 (Хеш-функция из семейства алгоритмов SHA-2) -sha256crypt;SHA256 (Хеш-функция из семейства алгоритмов SHA-2) -!sunmd5;Sun MD5 (Хеш-алгоритм от Sun Microsystems) -md5crypt;MD5 Unix (Хэш-алгоритм вызывает тысячу раз стандартный MD5) -!bsdicrypt;Extended DES Crypt (Хеш-функция из семейства алгоритмов DES от BSDi) -descrypt;descrypt (Хеш-функция из семейства алгоритмов DES) -!nt;NTHash (Хеш-функция из семейства алгоритмов NT Windows) \ No newline at end of file +des;DES (Algorithm for Symmetric Encryption) +md5;MD5 (128-bit hashing algorithm) +yescrypt;yescrypt (Cryptographic hash function) +gost-yescrypt;GOST-YESCRYPT (Design according to GOST R 34.11─2012) +scrypt;scrypt (Adaptive cryptographic key generation function) +bf;Blowfish (Symmetric Block Cipher Algorithm) +bcrypt;bcrypt (Adaptive hash function from the Blowfish family of algorithms) +bcrypt-a;bcrypt-a (Adaptive hash function from the Blowfish family of algorithms) +sha512crypt;SHA512 (Hash function from the SHA-2 family of algorithms) +sha256crypt;SHA256 (Hash function from the SHA-2 family of algorithms) +!sunmd5;Sun MD5 (Hash algorithm from Sun Microsystems) +md5crypt;MD5 Unix (Hash algorithm calls standard MD5 thousand times) +!bsdicrypt;Extended DES Crypt (Hash function from the BSDi family of DES algorithms) +descrypt;descrypt (Hash function from the DES family of algorithms) +!nt;NTHash (Hash function from the NT Windows family of algorithms) \ No newline at end of file diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 66da497..ce944f8 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -796,7 +796,7 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ if (hash_algos[i][strlen(hash_algos[i])-1]=='\n') hash_algos[i][strlen(hash_algos[i])-1]='\0'; int parsed_size; config_str parsed = yon_char_parse(hash_algos[i],&parsed_size,";"); - gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->PasswordHashCombo),parsed[0],parsed[1]); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->PasswordHashCombo),parsed[0],_(parsed[1])); gtk_widget_set_tooltip_text(window->PasswordHashCombo,parsed[1]); yon_char_parsed_free(parsed,parsed_size); } diff --git a/source/ubl-strings.h b/source/ubl-strings.h index e48cd47..cf85c5b 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -74,6 +74,21 @@ #define ACCEPT_LABEL _("Accept") #define ENCRYPT_SURE_LABEL _("Are you sure want to encrypt all passwords?\nThis action can't be undone.") #define ENCRYPT_TOOLTIP_LABEL _("Encrypt all unencrypted passwords at global configuration") +#define DES_DESCRIPTION_LABEL _("DES (Algorithm for Symmetric Encryption)") +#define MD5_DESCRIPTION_LABEL _("MD5 (128-bit hashing algorithm)") +#define YESCRYPT_DESCRIPTION_LABEL _("yescrypt (Cryptographic hash function)") +#define GOST_YESCRYPT_DESCRIPTION_LABEL _("GOST-YESCRYPT (Design according to GOST R 34.11─2012)") +#define SCRYPT_DESCRIPTION_LABEL _("scrypt (Adaptive cryptographic key generation function)") +#define BLOWFISH_DESCRIPTION_LABEL _("Blowfish (Symmetric Block Cipher Algorithm)") +#define BCRYPT_DESCRIPTION_LABEL _("bcrypt (Adaptive hash function from the Blowfish family of algorithms)") +#define BCRYPT_A_DESCRIPTION_LABEL _("bcrypt-a (Adaptive hash function from the Blowfish family of algorithms)") +#define SHA512_DESCRIPTION_LABEL _("SHA512 (Hash function from the SHA-2 family of algorithms)") +#define SHA256_DESCRIPTION_LABEL _("SHA256 (Hash function from the SHA-2 family of algorithms)") +#define SUN_MD5_DESCRIPTION_LABEL _("Sun MD5 (Hash algorithm from Sun Microsystems)") +#define MD5_UNIX_DESCRIPTION_LABEL _("MD5 Unix (Hash algorithm calls standard MD5 thousand times)") +#define EXTENDED_DES_DESCRIPTION_LABEL _("Extended DES Crypt (Hash function from the BSDi family of DES algorithms)") +#define DESCRYPT_DESCRIPTION_LABEL _("descrypt (Hash function from the DES family of algorithms)") +#define NTHASH_DESCRIPTION_LABEL _("NTHash (Hash function from the NT Windows family of algorithms)") //ubl-settings-usergroups-group-creation.glade #define CONFIGURE_GROUP_TITLE_LABEL _("Configure group") diff --git a/ubl-settings-usergroups.pot b/ubl-settings-usergroups.pot index 3356d69..24a4631 100644 --- a/ubl-settings-usergroups.pot +++ b/ubl-settings-usergroups.pot @@ -53,7 +53,7 @@ msgstr "" msgid "UID" msgstr "" -#: source/ubl-strings.h:14 source/ubl-strings.h:85 +#: source/ubl-strings.h:14 source/ubl-strings.h:100 msgid "Login" msgstr "" @@ -211,7 +211,7 @@ msgstr "" msgid "Set a password" msgstr "" -#: source/ubl-strings.h:60 source/ubl-strings.h:88 +#: source/ubl-strings.h:60 source/ubl-strings.h:103 msgid "Encrypted" msgstr "" @@ -233,387 +233,449 @@ msgstr "" msgid "Encrypt all unencrypted passwords at global configuration" msgstr "" +#: source/ubl-strings.h:77 +msgid "DES (Algorithm for Symmetric Encryption)" +msgstr "" + +#: source/ubl-strings.h:78 +msgid "MD5 (128-bit hashing algorithm)" +msgstr "" + #: source/ubl-strings.h:79 -msgid "Configure group" +msgid "yescrypt (Cryptographic hash function)" msgstr "" #: source/ubl-strings.h:80 -msgid "Add group" +msgid "GOST-YESCRYPT (Design according to GOST R 34.11─2012)" msgstr "" #: source/ubl-strings.h:81 -msgid "Group id:" +msgid "scrypt (Adaptive cryptographic key generation function)" msgstr "" #: source/ubl-strings.h:82 -msgid "Group name:" +msgid "Blowfish (Symmetric Block Cipher Algorithm)" msgstr "" #: source/ubl-strings.h:83 -msgid "Group users:" +msgid "bcrypt (Adaptive hash function from the Blowfish family of algorithms)" msgstr "" #: source/ubl-strings.h:84 -msgid "Automatically" +msgid "" +"bcrypt-a (Adaptive hash function from the Blowfish family of algorithms)" +msgstr "" + +#: source/ubl-strings.h:85 +msgid "SHA512 (Hash function from the SHA-2 family of algorithms)" msgstr "" #: source/ubl-strings.h:86 -msgid "Create group with ununique GID" +msgid "SHA256 (Hash function from the SHA-2 family of algorithms)" msgstr "" #: source/ubl-strings.h:87 -msgid "Create system group" +msgid "Sun MD5 (Hash algorithm from Sun Microsystems)" +msgstr "" + +#: source/ubl-strings.h:88 +msgid "MD5 Unix (Hash algorithm calls standard MD5 thousand times)" msgstr "" #: source/ubl-strings.h:89 -msgid "Additional configuration" +msgid "" +"Extended DES Crypt (Hash function from the BSDi family of DES algorithms)" msgstr "" #: source/ubl-strings.h:90 -msgid "Group configuration synchronization" +msgid "descrypt (Hash function from the DES family of algorithms)" msgstr "" #: source/ubl-strings.h:91 +msgid "NTHash (Hash function from the NT Windows family of algorithms)" +msgstr "" + +#: source/ubl-strings.h:94 +msgid "Configure group" +msgstr "" + +#: source/ubl-strings.h:95 +msgid "Add group" +msgstr "" + +#: source/ubl-strings.h:96 +msgid "Group id:" +msgstr "" + +#: source/ubl-strings.h:97 +msgid "Group name:" +msgstr "" + +#: source/ubl-strings.h:98 +msgid "Group users:" +msgstr "" + +#: source/ubl-strings.h:99 +msgid "Automatically" +msgstr "" + +#: source/ubl-strings.h:101 +msgid "Create group with ununique GID" +msgstr "" + +#: source/ubl-strings.h:102 +msgid "Create system group" +msgstr "" + +#: source/ubl-strings.h:104 +msgid "Additional configuration" +msgstr "" + +#: source/ubl-strings.h:105 +msgid "Group configuration synchronization" +msgstr "" + +#: source/ubl-strings.h:106 msgid "When shutting down the system, save the group into the configuration" msgstr "" -#: source/ubl-strings.h:92 +#: source/ubl-strings.h:107 msgid "Group administrators:" msgstr "" -#: source/ubl-strings.h:93 +#: source/ubl-strings.h:108 msgid "Group name must not start with digit" msgstr "" -#: source/ubl-strings.h:96 +#: source/ubl-strings.h:111 msgid "Default groups" msgstr "" -#: source/ubl-strings.h:97 +#: source/ubl-strings.h:112 msgid "Main group" msgstr "" -#: source/ubl-strings.h:98 +#: source/ubl-strings.h:113 msgid "Additional groups" msgstr "" -#: source/ubl-strings.h:99 +#: source/ubl-strings.h:114 msgid "Choose groups" msgstr "" -#: source/ubl-strings.h:100 +#: source/ubl-strings.h:115 msgid "Choose users" msgstr "" -#: source/ubl-strings.h:103 +#: source/ubl-strings.h:118 msgid "System users and groups" msgstr "" -#: source/ubl-strings.h:104 +#: source/ubl-strings.h:119 msgid "Disabled" msgstr "" -#: source/ubl-strings.h:105 +#: source/ubl-strings.h:120 msgid "Username" msgstr "" -#: source/ubl-strings.h:106 +#: source/ubl-strings.h:121 msgid "" "Primary\n" "group" msgstr "" -#: source/ubl-strings.h:107 +#: source/ubl-strings.h:122 msgid "" "Home\n" "directory" msgstr "" -#: source/ubl-strings.h:108 source/ubl-strings.h:114 +#: source/ubl-strings.h:123 source/ubl-strings.h:129 msgid "Group" msgstr "" -#: source/ubl-strings.h:109 +#: source/ubl-strings.h:124 msgid "Update the system users and groups list" msgstr "" -#: source/ubl-strings.h:110 +#: source/ubl-strings.h:125 msgid "Toggle system groups and users" msgstr "" -#: source/ubl-strings.h:112 +#: source/ubl-strings.h:127 msgid "Password mismatch" msgstr "" -#: source/ubl-strings.h:113 +#: source/ubl-strings.h:128 msgid "Password must be at least" msgstr "" -#: source/ubl-strings.h:113 +#: source/ubl-strings.h:128 msgid "characters" msgstr "" -#: source/ubl-strings.h:115 +#: source/ubl-strings.h:130 msgid "" "Days until\n" "warning" msgstr "" -#: source/ubl-strings.h:116 +#: source/ubl-strings.h:131 msgid "" "Days\n" "without activity" msgstr "" -#: source/ubl-strings.h:117 +#: source/ubl-strings.h:132 msgid "" "Shell\n" "path" msgstr "" -#: source/ubl-strings.h:118 +#: source/ubl-strings.h:133 msgid "" "Password has\n" "been changed" msgstr "" -#: source/ubl-strings.h:119 +#: source/ubl-strings.h:134 msgid "" "Expiration\n" "date" msgstr "" -#: source/ubl-strings.h:120 +#: source/ubl-strings.h:135 msgid "" "Password change\n" "interval (min)" msgstr "" -#: source/ubl-strings.h:121 +#: source/ubl-strings.h:136 msgid "" "Password change\n" "interval (max)" msgstr "" -#: source/ubl-strings.h:124 +#: source/ubl-strings.h:139 msgid "Add user" msgstr "" -#: source/ubl-strings.h:125 +#: source/ubl-strings.h:140 msgid "Configure user" msgstr "" -#: source/ubl-strings.h:126 +#: source/ubl-strings.h:141 msgid "Set" msgstr "" -#: source/ubl-strings.h:127 +#: source/ubl-strings.h:142 msgid "Empty important field" msgstr "" -#: source/ubl-strings.h:128 +#: source/ubl-strings.h:143 msgid "Login must not start with digit" msgstr "" -#: source/ubl-strings.h:129 +#: source/ubl-strings.h:144 msgid "Loading has failed" msgstr "" -#: source/ubl-strings.h:130 +#: source/ubl-strings.h:145 msgid "Login name" msgstr "" -#: source/ubl-strings.h:131 +#: source/ubl-strings.h:146 msgid "Additional groups:" msgstr "" -#: source/ubl-strings.h:132 +#: source/ubl-strings.h:147 msgid "Password configuration" msgstr "" -#: source/ubl-strings.h:133 +#: source/ubl-strings.h:148 msgid "Password has been changed:" msgstr "" -#: source/ubl-strings.h:134 +#: source/ubl-strings.h:149 msgid "expiration date:" msgstr "" -#: source/ubl-strings.h:135 +#: source/ubl-strings.h:150 msgid "Password change interval: minimum" msgstr "" -#: source/ubl-strings.h:136 +#: source/ubl-strings.h:151 msgid "days, maximum" msgstr "" -#: source/ubl-strings.h:137 +#: source/ubl-strings.h:152 msgid "days" msgstr "" -#: source/ubl-strings.h:138 +#: source/ubl-strings.h:153 msgid "Days until warning:" msgstr "" -#: source/ubl-strings.h:139 +#: source/ubl-strings.h:154 msgid "Days without activity:" msgstr "" -#: source/ubl-strings.h:140 +#: source/ubl-strings.h:155 msgid "Force change at next login" msgstr "" -#: source/ubl-strings.h:141 +#: source/ubl-strings.h:156 msgid "User shell:" msgstr "" -#: source/ubl-strings.h:142 +#: source/ubl-strings.h:157 msgid "Home directory:" msgstr "" -#: source/ubl-strings.h:143 +#: source/ubl-strings.h:158 msgid "Don't set" msgstr "" -#: source/ubl-strings.h:144 +#: source/ubl-strings.h:159 msgid "Create system user" msgstr "" -#: source/ubl-strings.h:145 +#: source/ubl-strings.h:160 msgid "Create user with ununique (repeating) UID" msgstr "" -#: source/ubl-strings.h:146 +#: source/ubl-strings.h:161 msgid "Do not check login for compliance with character rules" msgstr "" -#: source/ubl-strings.h:147 +#: source/ubl-strings.h:162 msgid "Temporary deactivation" msgstr "" -#: source/ubl-strings.h:148 +#: source/ubl-strings.h:163 msgid "Save" msgstr "" -#: source/ubl-strings.h:149 +#: source/ubl-strings.h:164 msgid "login_name" msgstr "" -#: source/ubl-strings.h:150 +#: source/ubl-strings.h:165 msgid "group_name" msgstr "" -#: source/ubl-strings.h:151 +#: source/ubl-strings.h:166 msgid "User name" msgstr "" -#: source/ubl-strings.h:152 +#: source/ubl-strings.h:167 msgid "Sync user" msgstr "" -#: source/ubl-strings.h:153 +#: source/ubl-strings.h:168 msgid "Sync user with password" msgstr "" -#: source/ubl-strings.h:154 +#: source/ubl-strings.h:169 msgid "Encrypt all passwords" msgstr "" -#: source/ubl-strings.h:156 +#: source/ubl-strings.h:171 msgid "User configuration" msgstr "" -#: source/ubl-strings.h:157 +#: source/ubl-strings.h:172 msgid "User configuration synchronization" msgstr "" -#: source/ubl-strings.h:158 +#: source/ubl-strings.h:173 msgid "During system startup, load the user from the configuration" msgstr "" -#: source/ubl-strings.h:159 +#: source/ubl-strings.h:174 msgid "When shutting down the system, save the user into the configuration" msgstr "" -#: source/ubl-strings.h:160 +#: source/ubl-strings.h:175 msgid "User password configuration syncronization" msgstr "" -#: source/ubl-strings.h:161 +#: source/ubl-strings.h:176 msgid "" "During system startup, load the user's parameters from the configuration" msgstr "" -#: source/ubl-strings.h:162 +#: source/ubl-strings.h:177 msgid "" "When shutting down the system, save the user's parameters into the " "configuration" msgstr "" -#: source/ubl-strings.h:164 +#: source/ubl-strings.h:179 msgid "Main" msgstr "" -#: source/ubl-strings.h:165 +#: source/ubl-strings.h:180 msgid "Additional" msgstr "" -#: source/ubl-strings.h:166 +#: source/ubl-strings.h:181 msgid "Syncronization" msgstr "" -#: source/ubl-strings.h:169 +#: source/ubl-strings.h:184 msgid "Repeat password:" msgstr "" -#: source/ubl-strings.h:170 +#: source/ubl-strings.h:185 msgid "Password hash:" msgstr "" -#: source/ubl-strings.h:171 +#: source/ubl-strings.h:186 msgid "Do not encrypt password" msgstr "" -#: source/ubl-strings.h:174 +#: source/ubl-strings.h:189 msgid "Additional configuration of service parameter saving" msgstr "" -#: source/ubl-strings.h:175 +#: source/ubl-strings.h:190 msgid "" "At every system shutdown save changes of (root)/var/lib/samba\n" "into (hd)/ublinux-data/rootcopy" msgstr "" -#: source/ubl-strings.h:176 +#: source/ubl-strings.h:191 msgid "For system save mode \"Sandbox\"" msgstr "" -#: source/ubl-strings.h:179 +#: source/ubl-strings.h:194 msgid "User deletion" msgstr "" -#: source/ubl-strings.h:180 +#: source/ubl-strings.h:195 msgid "Confirm user(-s) deletion:" msgstr "" -#: source/ubl-strings.h:181 +#: source/ubl-strings.h:196 msgid "Chosen" msgstr "" -#: source/ubl-strings.h:182 +#: source/ubl-strings.h:197 msgid "User" msgstr "" -#: source/ubl-strings.h:183 +#: source/ubl-strings.h:198 msgid "Home directory" msgstr "" -#: source/ubl-strings.h:184 +#: source/ubl-strings.h:199 msgid "Delete home directory" msgstr "" msgid "Are you sure want to delete group" -msgstr "Вы уверены, что хотите удалить группу" +msgstr "" msgid "Are you sure want to delete user" -msgstr "Вы уверены, что хотите удалить пользователя" \ No newline at end of file +msgstr "" \ No newline at end of file diff --git a/ubl-settings-usergroups_ru.po b/ubl-settings-usergroups_ru.po index 7e4f282..6edb3d7 100644 --- a/ubl-settings-usergroups_ru.po +++ b/ubl-settings-usergroups_ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ubl-ubl-settings-usergroups 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 16:12+0600\n" +"POT-Creation-Date: 2024-02-26 14:59+0600\n" "PO-Revision-Date: 2023-01-01 00:00+0600\n" "Last-Translator: UBLinux Team \n" "Language-Team: Russian - UBLinux Team \n" @@ -53,7 +53,7 @@ msgstr "Алгоритм хэширования пароля:" msgid "UID" msgstr "UID" -#: source/ubl-strings.h:14 source/ubl-strings.h:85 +#: source/ubl-strings.h:14 source/ubl-strings.h:100 msgid "Login" msgstr "Логин" @@ -225,7 +225,7 @@ msgstr "Пароль не требуется" msgid "Set a password" msgstr "Задать пароль" -#: source/ubl-strings.h:60 source/ubl-strings.h:88 +#: source/ubl-strings.h:60 source/ubl-strings.h:103 msgid "Encrypted" msgstr "Зашифрован" @@ -249,91 +249,153 @@ msgstr "" msgid "Encrypt all unencrypted passwords at global configuration" msgstr "Зашифровать все незашифрованные пароли в глобальной конфигурации" +#: source/ubl-strings.h:77 +msgid "DES (Algorithm for Symmetric Encryption)" +msgstr "DES (Алгоритм для симметричного шифрования)" + +#: source/ubl-strings.h:78 +msgid "MD5 (128-bit hashing algorithm)" +msgstr "MD5 (128-битный алгоритм хеширования)" + #: source/ubl-strings.h:79 +msgid "yescrypt (Cryptographic hash function)" +msgstr "yescrypt (Криптографическая хэш-функция)" + +#: source/ubl-strings.h:80 +msgid "GOST-YESCRYPT (Design according to GOST R 34.11─2012)" +msgstr "GOST-YESCRYPT (Конструкция согласно ГОСТ Р 34.11─2012)" + +#: source/ubl-strings.h:81 +msgid "scrypt (Adaptive cryptographic key generation function)" +msgstr "scrypt (Адаптивная криптографическая функция формирования ключа)" + +#: source/ubl-strings.h:82 +msgid "Blowfish (Symmetric Block Cipher Algorithm)" +msgstr "Blowfish (Алгоритм блочного симметричного шифрования)" + +#: source/ubl-strings.h:83 +msgid "bcrypt (Adaptive hash function from the Blowfish family of algorithms)" +msgstr "bcrypt (Адаптивная хеш-функция из семейства алгоритмов Blowfish)" + +#: source/ubl-strings.h:84 +msgid "" +"bcrypt-a (Adaptive hash function from the Blowfish family of algorithms)" +msgstr "bcrypt-a (Адаптивная хеш-функция из семейства алгоритмов Blowfish)" + +#: source/ubl-strings.h:85 +msgid "SHA512 (Hash function from the SHA-2 family of algorithms)" +msgstr "SHA512 (Хеш-функция из семейства алгоритмов SHA-2)" + +#: source/ubl-strings.h:86 +msgid "SHA256 (Hash function from the SHA-2 family of algorithms)" +msgstr "SHA256 (Хеш-функция из семейства алгоритмов SHA-2)" + +#: source/ubl-strings.h:87 +msgid "Sun MD5 (Hash algorithm from Sun Microsystems)" +msgstr "Sun MD5 (Хеш-алгоритм от Sun Microsystems)" + +#: source/ubl-strings.h:88 +msgid "MD5 Unix (Hash algorithm calls standard MD5 thousand times)" +msgstr "MD5 Unix (Хэш-алгоритм вызывает тысячу раз стандартный MD5)" + +#: source/ubl-strings.h:89 +msgid "" +"Extended DES Crypt (Hash function from the BSDi family of DES algorithms)" +msgstr "Extended DES Crypt (Хеш-функция из семейства алгоритмов DES от BSDi)" + +#: source/ubl-strings.h:90 +msgid "descrypt (Hash function from the DES family of algorithms)" +msgstr "descrypt (Хеш-функция из семейства алгоритмов DES)" + +#: source/ubl-strings.h:91 +msgid "NTHash (Hash function from the NT Windows family of algorithms)" +msgstr "NTHash (Хеш-функция из семейства алгоритмов NT Windows)" + +#: source/ubl-strings.h:94 msgid "Configure group" msgstr "Редактировать группу" -#: source/ubl-strings.h:80 +#: source/ubl-strings.h:95 msgid "Add group" msgstr "Добавить группу" -#: source/ubl-strings.h:81 +#: source/ubl-strings.h:96 msgid "Group id:" msgstr "ID Группы:" -#: source/ubl-strings.h:82 +#: source/ubl-strings.h:97 msgid "Group name:" msgstr "Имя группы:" -#: source/ubl-strings.h:83 +#: source/ubl-strings.h:98 msgid "Group users:" msgstr "Пользователи группы:" -#: source/ubl-strings.h:84 +#: source/ubl-strings.h:99 msgid "Automatically" msgstr "Автоматически" -#: source/ubl-strings.h:86 +#: source/ubl-strings.h:101 msgid "Create group with ununique GID" msgstr "Создать группу с повторяющимися (не уникальными) GID" -#: source/ubl-strings.h:87 +#: source/ubl-strings.h:102 msgid "Create system group" msgstr "Создать системную группу" -#: source/ubl-strings.h:89 +#: source/ubl-strings.h:104 msgid "Additional configuration" msgstr "Дополнительные настройки" -#: source/ubl-strings.h:90 +#: source/ubl-strings.h:105 msgid "Group configuration synchronization" msgstr "Синхронизация настроек группы" -#: source/ubl-strings.h:91 +#: source/ubl-strings.h:106 msgid "When shutting down the system, save the group into the configuration" msgstr "При завершении работы системы сохранить группу в конфигурацию" -#: source/ubl-strings.h:92 +#: source/ubl-strings.h:107 msgid "Group administrators:" msgstr "Администраторы группы:" -#: source/ubl-strings.h:93 +#: source/ubl-strings.h:108 msgid "Group name must not start with digit" msgstr "Имя группы не должно начинаться с цифры" -#: source/ubl-strings.h:96 +#: source/ubl-strings.h:111 msgid "Default groups" msgstr "Группы пользователей по умолчанию" -#: source/ubl-strings.h:97 +#: source/ubl-strings.h:112 msgid "Main group" msgstr "Основная группа" -#: source/ubl-strings.h:98 +#: source/ubl-strings.h:113 msgid "Additional groups" msgstr "Дополнительные группы" -#: source/ubl-strings.h:99 +#: source/ubl-strings.h:114 msgid "Choose groups" msgstr "Выбрать группы" -#: source/ubl-strings.h:100 +#: source/ubl-strings.h:115 msgid "Choose users" msgstr "Выбрать пользователей" -#: source/ubl-strings.h:103 +#: source/ubl-strings.h:118 msgid "System users and groups" msgstr "Пользователи и группы в системе" -#: source/ubl-strings.h:104 +#: source/ubl-strings.h:119 msgid "Disabled" msgstr "Отключен" -#: source/ubl-strings.h:105 +#: source/ubl-strings.h:120 msgid "Username" msgstr "Имя пользователя" -#: source/ubl-strings.h:106 +#: source/ubl-strings.h:121 msgid "" "Primary\n" "group" @@ -341,7 +403,7 @@ msgstr "" "Основная\n" "группа" -#: source/ubl-strings.h:107 +#: source/ubl-strings.h:122 msgid "" "Home\n" "directory" @@ -349,31 +411,31 @@ msgstr "" "Домашний\n" "каталог" -#: source/ubl-strings.h:108 source/ubl-strings.h:114 +#: source/ubl-strings.h:123 source/ubl-strings.h:129 msgid "Group" msgstr "Группа" -#: source/ubl-strings.h:109 +#: source/ubl-strings.h:124 msgid "Update the system users and groups list" msgstr "Обновить список пользователей и групп системы" -#: source/ubl-strings.h:110 +#: source/ubl-strings.h:125 msgid "Toggle system groups and users" msgstr "Переключить видимость системных пользователей и групп" -#: source/ubl-strings.h:112 +#: source/ubl-strings.h:127 msgid "Password mismatch" msgstr "Несовпадение паролей" -#: source/ubl-strings.h:113 +#: source/ubl-strings.h:128 msgid "Password must be at least" msgstr "Пароль должен состоять из как минимум" -#: source/ubl-strings.h:113 +#: source/ubl-strings.h:128 msgid "characters" msgstr "символов" -#: source/ubl-strings.h:115 +#: source/ubl-strings.h:130 msgid "" "Days until\n" "warning" @@ -381,7 +443,7 @@ msgstr "" "Дней до\n" "предупреждения" -#: source/ubl-strings.h:116 +#: source/ubl-strings.h:131 msgid "" "Days\n" "without activity" @@ -389,7 +451,7 @@ msgstr "" "Дней без\n" "активности" -#: source/ubl-strings.h:117 +#: source/ubl-strings.h:132 msgid "" "Shell\n" "path" @@ -397,7 +459,7 @@ msgstr "" "Путь до\n" "оболочки" -#: source/ubl-strings.h:118 +#: source/ubl-strings.h:133 msgid "" "Password has\n" "been changed" @@ -405,7 +467,7 @@ msgstr "" "Пароль\n" "изменён" -#: source/ubl-strings.h:119 +#: source/ubl-strings.h:134 msgid "" "Expiration\n" "date" @@ -413,7 +475,7 @@ msgstr "" "Дата\n" "устаревания" -#: source/ubl-strings.h:120 +#: source/ubl-strings.h:135 msgid "" "Password change\n" "interval (min)" @@ -421,7 +483,7 @@ msgstr "" "Интервал смены\n" "пароля (мин.)" -#: source/ubl-strings.h:121 +#: source/ubl-strings.h:136 msgid "" "Password change\n" "interval (max)" @@ -429,195 +491,195 @@ msgstr "" "Интервал смены\n" "пароля (макс.)" -#: source/ubl-strings.h:124 +#: source/ubl-strings.h:139 msgid "Add user" msgstr "Добавить пользователя" -#: source/ubl-strings.h:125 +#: source/ubl-strings.h:140 msgid "Configure user" msgstr "Редактировать пользователя" -#: source/ubl-strings.h:126 +#: source/ubl-strings.h:141 msgid "Set" msgstr "Задать" -#: source/ubl-strings.h:127 +#: source/ubl-strings.h:142 msgid "Empty important field" msgstr "Пустое важное поле" -#: source/ubl-strings.h:128 +#: source/ubl-strings.h:143 msgid "Login must not start with digit" msgstr "Логин не должен начинаться с цифры" -#: source/ubl-strings.h:129 +#: source/ubl-strings.h:144 msgid "Loading has failed" msgstr "Ошибка загрузки" -#: source/ubl-strings.h:130 +#: source/ubl-strings.h:145 msgid "Login name" msgstr "Имя логина" -#: source/ubl-strings.h:131 +#: source/ubl-strings.h:146 msgid "Additional groups:" msgstr "Дополнительные группы:" -#: source/ubl-strings.h:132 +#: source/ubl-strings.h:147 msgid "Password configuration" msgstr "Конфигурация пароля" -#: source/ubl-strings.h:133 +#: source/ubl-strings.h:148 msgid "Password has been changed:" msgstr "Пароль изменён:" -#: source/ubl-strings.h:134 +#: source/ubl-strings.h:149 msgid "expiration date:" msgstr "Дата устаревания:" -#: source/ubl-strings.h:135 +#: source/ubl-strings.h:150 msgid "Password change interval: minimum" msgstr "Интервал смены пароля: минимум" -#: source/ubl-strings.h:136 +#: source/ubl-strings.h:151 msgid "days, maximum" msgstr "дней, максимум" -#: source/ubl-strings.h:137 +#: source/ubl-strings.h:152 msgid "days" msgstr "дней" -#: source/ubl-strings.h:138 +#: source/ubl-strings.h:153 msgid "Days until warning:" msgstr "Дней до предупреждения:" -#: source/ubl-strings.h:139 +#: source/ubl-strings.h:154 msgid "Days without activity:" msgstr "Дней без активности:" -#: source/ubl-strings.h:140 +#: source/ubl-strings.h:155 msgid "Force change at next login" msgstr "Принудительно сменить при следующем входе в систему" -#: source/ubl-strings.h:141 +#: source/ubl-strings.h:156 msgid "User shell:" msgstr "Оболочка пользователя:" -#: source/ubl-strings.h:142 +#: source/ubl-strings.h:157 msgid "Home directory:" msgstr "Домашний каталог:" -#: source/ubl-strings.h:143 +#: source/ubl-strings.h:158 msgid "Don't set" msgstr "Не создавать" -#: source/ubl-strings.h:144 +#: source/ubl-strings.h:159 msgid "Create system user" msgstr "Создать системного пользователя" -#: source/ubl-strings.h:145 +#: source/ubl-strings.h:160 msgid "Create user with ununique (repeating) UID" msgstr "Создать пользователя с повторяющимися (не уникальными) UID" -#: source/ubl-strings.h:146 +#: source/ubl-strings.h:161 msgid "Do not check login for compliance with character rules" msgstr "Не проверять логин на несоответствие правилам использования символов" -#: source/ubl-strings.h:147 +#: source/ubl-strings.h:162 msgid "Temporary deactivation" msgstr "Временное отключение учётной записи" -#: source/ubl-strings.h:148 +#: source/ubl-strings.h:163 msgid "Save" msgstr "Сохранить" -#: source/ubl-strings.h:149 +#: source/ubl-strings.h:164 msgid "login_name" msgstr "Имя_логина" -#: source/ubl-strings.h:150 +#: source/ubl-strings.h:165 msgid "group_name" msgstr "Имя_группы" -#: source/ubl-strings.h:151 +#: source/ubl-strings.h:166 msgid "User name" msgstr "Имя пользователя" -#: source/ubl-strings.h:152 +#: source/ubl-strings.h:167 msgid "Sync user" msgstr "Синхронизировать пользователя" -#: source/ubl-strings.h:153 +#: source/ubl-strings.h:168 msgid "Sync user with password" msgstr "Синхронизировать пользователя с паролем" -#: source/ubl-strings.h:154 +#: source/ubl-strings.h:169 msgid "Encrypt all passwords" msgstr "Зашифровать все пароли" -#: source/ubl-strings.h:156 +#: source/ubl-strings.h:171 msgid "User configuration" msgstr "Настройка пользователя" -#: source/ubl-strings.h:157 +#: source/ubl-strings.h:172 msgid "User configuration synchronization" msgstr "Синхронизация настроек пользователя" -#: source/ubl-strings.h:158 +#: source/ubl-strings.h:173 msgid "During system startup, load the user from the configuration" msgstr "" "При запуске операционной системы применять настройки пользователя из " "конфигурации" -#: source/ubl-strings.h:159 +#: source/ubl-strings.h:174 msgid "When shutting down the system, save the user into the configuration" msgstr "" "При завершении работы операционной системы сохранить настройки пользователя " "в конфигурацию" -#: source/ubl-strings.h:160 +#: source/ubl-strings.h:175 msgid "User password configuration syncronization" msgstr "Синхронизация настроек пароля пользователя" -#: source/ubl-strings.h:161 +#: source/ubl-strings.h:176 msgid "" "During system startup, load the user's parameters from the configuration" msgstr "При загрузке системы загрузить параметры пользователя из конфигурации" -#: source/ubl-strings.h:162 +#: source/ubl-strings.h:177 msgid "" "When shutting down the system, save the user's parameters into the " "configuration" msgstr "" "При завершении работы системы сохранить параметры пользователя в конфигурацию" -#: source/ubl-strings.h:164 +#: source/ubl-strings.h:179 msgid "Main" msgstr "Основные" -#: source/ubl-strings.h:165 +#: source/ubl-strings.h:180 msgid "Additional" msgstr "Дополнительные" -#: source/ubl-strings.h:166 +#: source/ubl-strings.h:181 msgid "Syncronization" msgstr "Синхронизация" -#: source/ubl-strings.h:169 +#: source/ubl-strings.h:184 msgid "Repeat password:" msgstr "Подтверждение пароля:" -#: source/ubl-strings.h:170 +#: source/ubl-strings.h:185 msgid "Password hash:" msgstr "Хэш пароля:" -#: source/ubl-strings.h:171 +#: source/ubl-strings.h:186 msgid "Do not encrypt password" msgstr "Не шифровать пароль" -#: source/ubl-strings.h:174 +#: source/ubl-strings.h:189 msgid "Additional configuration of service parameter saving" msgstr "Дополнительные настройки сохранения параметров сервисов" -#: source/ubl-strings.h:175 +#: source/ubl-strings.h:190 msgid "" "At every system shutdown save changes of (root)/var/lib/samba\n" "into (hd)/ublinux-data/rootcopy" @@ -625,31 +687,31 @@ msgstr "" "При каждом завершении работы ОС сохранять изменения (root)/var/lib/samba\n" "в (hd)/ublinux-data/rootcopy/" -#: source/ubl-strings.h:176 +#: source/ubl-strings.h:191 msgid "For system save mode \"Sandbox\"" msgstr "Для режима сохранения системы \"Песочница\"" -#: source/ubl-strings.h:179 +#: source/ubl-strings.h:194 msgid "User deletion" msgstr "Удаление пользователя(-лей)" -#: source/ubl-strings.h:180 +#: source/ubl-strings.h:195 msgid "Confirm user(-s) deletion:" msgstr "Подтвердите удаление пользователя (-ей):" -#: source/ubl-strings.h:181 +#: source/ubl-strings.h:196 msgid "Chosen" msgstr "Выбран" -#: source/ubl-strings.h:182 +#: source/ubl-strings.h:197 msgid "User" msgstr "Пользователь" -#: source/ubl-strings.h:183 +#: source/ubl-strings.h:198 msgid "Home directory" msgstr "Домашний каталог" -#: source/ubl-strings.h:184 +#: source/ubl-strings.h:199 msgid "Delete home directory" msgstr "Удалить домашний каталог" -- 2.35.1 From 2896bf6d4a04c5ecc6fcdbf26570413d402e379b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 15:47:06 +0600 Subject: [PATCH 10/33] Removed Label for UID and GID column if it's x or empty --- source/ubl-settings-usergroups.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index ce944f8..a8045ca 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -74,7 +74,7 @@ void yon_interface_update(main_window *widgets){ } if(!strcmp(parameters[0],"x")) parameters[0]=""; - if (parameters_size>1&&!strcmp(parameters[1],"x")) parameters[1]=AUTOMATICALLY_LABEL; + if (parameters_size>1&&!strcmp(parameters[1],"x")) parameters[1]=""; if (parameters_size>2&&!strcmp(parameters[2],"x")) parameters[2]=login; char *pars = ""; if (parameters_size>5&&strcmp(parameters[5],"x")&&strcmp(parameters[5],"")){ @@ -92,7 +92,7 @@ void yon_interface_update(main_window *widgets){ gtk_list_store_set(widgets->UsersList,&iter, 2,login, 3,parameters_size>0?parameters[0]:"", - 1,parameters_size>1&&!yon_char_is_empty(parameters[1])?parameters[1]:AUTOMATICALLY_LABEL, + 1,parameters_size>1&&!yon_char_is_empty(parameters[1])?parameters[1]:"", 4,parameters_size>2&&!yon_char_is_empty(parameters[2])?parameters[2]:login, 5,parameters_size>3?!strcmp(parameters[3],"x")||!strcmp(parameters[3],"")?def_groups:parameters[3]:def_groups, 6,parameters_size>4?!strcmp(parameters[3],"x")?"":parameters[4]:"", @@ -118,7 +118,7 @@ void yon_interface_update(main_window *widgets){ login = yon_char_divide_search(parameters[0],"=",-1); login[strlen(login)-1]='\0'; } - if (!strcmp(parameters[1],"x")) parameters[1]=AUTOMATICALLY_LABEL; + if (!strcmp(parameters[1],"x")) parameters[1]=""; gtk_list_store_set(widgets->GroupsList,&iter, 1,login, 0,parameters_size>1?parameters[1]:"", -- 2.35.1 From a745d15d241bb1622b3ab6852075528e5d8c36d3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 16:59:14 +0600 Subject: [PATCH 11/33] Added sorting to all columns at users and groups at system window's groups tab --- ubl-settings-usergroups-system.glade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ubl-settings-usergroups-system.glade b/ubl-settings-usergroups-system.glade index 1dfbd92..c2bd604 100644 --- a/ubl-settings-usergroups-system.glade +++ b/ubl-settings-usergroups-system.glade @@ -380,6 +380,7 @@ without activity fixed 50 Group + 1 150 @@ -395,6 +396,7 @@ without activity 50 Group users + 2 -- 2.35.1 From 657276e0ec91d7cc9b78bdbd9618f9d16707bab2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 26 Feb 2024 17:58:13 +0600 Subject: [PATCH 12/33] Calendar now checks invalid date; Calendar initialy show current date --- source/ubl-settings-usergroups.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index a8045ca..b9b19b4 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1775,10 +1775,23 @@ void on_toggle_button_set_active_from_toggle_button_inversed(GtkToggleButton *se void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *window){ int year=0, month=0, day=0; gtk_calendar_get_date(GTK_CALENDAR(window->ExpirationCalendar),&year,&month,&day); - GDateTime *date = g_date_time_new_local(year,month,day,23,59,59); - char *date_string = g_date_time_format(date,"%Y-%m-%d"); + time_t t = time(NULL); + struct tm tm = *localtime(&t); + if ((1900+tm.tm_year)>year||((1900+tm.tm_year)==year&&tm.tm_mon>month)||((1900+tm.tm_year)==year&&tm.tm_mon==month&&tm.tm_mday>day)) { + gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), ""); + return; + } + char *dy = yon_char_from_int(day); + char *mn = yon_char_from_int(month); + char *yr = yon_char_from_int(year); + if (tm.tm_mon<10) yon_char_append("0",mn); + if (tm.tm_mday<10) yon_char_append("0",dy); + char *date_string = yon_char_unite(yr,"-",mn,"-",dy); gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), date_string); window->expiration_unix=date_string; + free(dy); + free(mn); + free(yr); } void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *window){ @@ -1905,6 +1918,12 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){ window->userTitleNameLabel=yon_gtk_builder_get_widget(builder,"userTitleNameLabel"); window->expiration_unix=NULL; + + time_t t = time(NULL); + struct tm tm = *localtime(&t); + gtk_calendar_select_day(GTK_CALENDAR(window->ExpirationCalendar),tm.tm_mday); + gtk_calendar_select_month(GTK_CALENDAR(window->ExpirationCalendar),tm.tm_mon,1900+tm.tm_year); + on_UID_update(NULL,window); int shell_size=0; config_str shells = yon_file_open(shell_list_path,&shell_size); -- 2.35.1 From df0dccf4b9d537bc4f27308b60d128c970befe6e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 12:03:20 +0600 Subject: [PATCH 13/33] Vte include --- source/CMakeLists.txt | 8 ++++++++ source/ubl-settings-usergroups.h | 1 + 2 files changed, 9 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 1dc287a..d92d948 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,6 +8,11 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) +pkg_check_modules(VTE291 REQUIRED vte-2.91) +include_directories(${VTE291_INCLUDE_DIRS}) +link_directories(${VTE291_LIBRARY_DIRS}) +add_definitions(${VTE291_CFLAGS_OTHER}) + find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) if(WEBKIT_LIBRARIES_FOUND) @@ -74,12 +79,15 @@ set(SOURCE_FILES set(LIBRARIES ${GTK_LIBRARIES} + ${VTE291_LIBRARIES} ublsettings ublsettings-gtk3 ublsettingsui-gtk3 pthread) +add_definitions(-DVTE_INCLUDE) + add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}) target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES}) diff --git a/source/ubl-settings-usergroups.h b/source/ubl-settings-usergroups.h index f013345..19dde23 100644 --- a/source/ubl-settings-usergroups.h +++ b/source/ubl-settings-usergroups.h @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include -- 2.35.1 From 2b748acd505a1c37b0faea1bb3d4df4e0c1f956d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 12:28:45 +0600 Subject: [PATCH 14/33] Fixed additional parameters spaces --- source/ubl-settings-usergroups.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index b9b19b4..cb274aa 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1822,9 +1822,9 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w int user_shell_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo)); if (user_shell_active>0){ - user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); + user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); if (!strcmp(user_shell,SET_LABEL)){ - user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); + user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); } } else user_shell=""; @@ -1840,7 +1840,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w int system_user_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateSystemCheck)); if (system_user_active) - create_system_user = " --system"; + create_system_user = "--system"; int create_ununique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck)); if (create_ununique_active) @@ -1855,7 +1855,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w main_group = ""; } char *final_string = user_home; - final_string = yon_char_unite(user_home,!yon_char_is_empty(final_string)?" ":"", + final_string = yon_char_unite(final_string,!yon_char_is_empty(final_string)?" ":"", yon_char_return_if_exist(user_shell,""), !yon_char_is_empty(user_shell)?" ":"", yon_char_return_if_exist(create_system_user,""), @@ -1866,6 +1866,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w !yon_char_is_empty(do_not_check)?" ":"", yon_char_return_if_exist(no_user_group,""), NULL); + if (final_string[strlen(final_string)-1]==' ') final_string[strlen(final_string)-1]='\0'; gtk_entry_set_text(GTK_ENTRY(window->userExtraOptionsEntry),final_string); free(final_string); } -- 2.35.1 From a8dad7d8298db1171c6009a37caff168f70a9a8f Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 12:35:44 +0600 Subject: [PATCH 15/33] Fixed 'x' symbol in additional parameters column after config loading --- source/ubl-settings-usergroups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index cb274aa..e9b19de 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -95,7 +95,7 @@ void yon_interface_update(main_window *widgets){ 1,parameters_size>1&&!yon_char_is_empty(parameters[1])?parameters[1]:"", 4,parameters_size>2&&!yon_char_is_empty(parameters[2])?parameters[2]:login, 5,parameters_size>3?!strcmp(parameters[3],"x")||!strcmp(parameters[3],"")?def_groups:parameters[3]:def_groups, - 6,parameters_size>4?!strcmp(parameters[3],"x")?"":parameters[4]:"", + 6,parameters_size>4?!strcmp(parameters[4],"x")?"":parameters[4]:"", 7,pars, -1); if(parameters) -- 2.35.1 From 1387f30ba9a1fed44bdf6e9096dcfdc3241f9187 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 12:47:38 +0600 Subject: [PATCH 16/33] Removed transistent window for system users and groups window --- source/ubl-settings-usergroups.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index e9b19de..5b0605c 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1381,7 +1381,6 @@ return window; void on_settings_usergroups_system_open(GtkWidget *self, main_window *widgets){ ubl_settings_usergroups_system_window *window = yon_ubl_settings_usergroups_system_new(); - gtk_window_set_transient_for(GTK_WINDOW(window->MonitorWindow),GTK_WINDOW(widgets->Window)); gtk_widget_show(window->MonitorWindow); } -- 2.35.1 From 7c62c8d7e6db5fceae24170fa73ee954e80425c2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 14:41:03 +0600 Subject: [PATCH 17/33] Changed logic of group password rendering --- source/ubl-settings-usergroups.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 5b0605c..9c85d64 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1003,7 +1003,8 @@ void on_group_save(GtkWidget *self, dictionary *dict){ GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList); if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter)) gtk_list_store_append(widgets->GroupsList,&iter); - gtk_list_store_set(widgets->GroupsList,&iter,0,strcmp(gid,"x")?gid:AUTOMATICALLY_LABEL,1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PasswordCombo)),-1); + char *passwor = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); + gtk_list_store_set(widgets->GroupsList,&iter,0,strcmp(gid,"x")?gid:"",1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_get_active(GTK_COMBO_BOX(window->PasswordCombo))==0?DEFAULT_USER_LABEL:check_is_password_hash(passwor)?UNENCRYPTED_LABEL:ENCRYPTED_LABEL,-1); on_subwindow_close(self); } @@ -2212,7 +2213,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),parsed[4]); gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),2); } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),0); } } char *sync = yon_config_get_by_key(GROUPADD_SYNC(name)); -- 2.35.1 From 0f74c8d7a8aaade445c154c663dfdb9875e2f158 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 14:44:37 +0600 Subject: [PATCH 18/33] Desktop changes --- ubl-settings-usergroups.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubl-settings-usergroups.desktop b/ubl-settings-usergroups.desktop index 5e3efa3..1ccea0e 100644 --- a/ubl-settings-usergroups.desktop +++ b/ubl-settings-usergroups.desktop @@ -5,7 +5,7 @@ Name[ru]=Пользователи и группы GenericName=ubl-settings-usergroups GenericName[ru]=Пользователи и группы Comment=System users and groups configuration -Comment[ru]=Настройка пользователей и групп системы (глобальная настройка, через конфигурационный файл) +Comment[ru]=Настройка пользователей и групп системы Type=Application Exec=pkexec ubl-settings-usergroups Icon=com.ublinux.ubl-settings-usergroups -- 2.35.1 From 4beb13a83cca02263554ce74a34610dadf7e4174 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 14:56:20 +0600 Subject: [PATCH 19/33] Fixed expiration date disappearing --- source/ubl-settings-usergroups.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 9c85d64..8c7c74b 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1559,8 +1559,8 @@ void on_user_save(GtkWidget *self, dictionary *dict){ long password_interval_maximum = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userPasswordChangeDelayMaximumSpin)); password_expiration_date = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordExpirationEntry)); - if (!yon_char_is_empty(password_expiration_date)){ - password_expiration_date = window->expiration_unix; + if (yon_char_is_empty(password_expiration_date)){ + password_expiration_date=""; } long warning_days_active = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->userWarningSpin)); @@ -1782,10 +1782,10 @@ void on_date_selected(GtkWidget *self, ubl_settings_usergroups_user_window *wind return; } char *dy = yon_char_from_int(day); - char *mn = yon_char_from_int(month); + char *mn = yon_char_from_int(month+1); char *yr = yon_char_from_int(year); - if (tm.tm_mon<10) yon_char_append("0",mn); - if (tm.tm_mday<10) yon_char_append("0",dy); + if (tm.tm_mon+1<10) mn = yon_char_append("0",mn); + if (tm.tm_mday<10) dy = yon_char_append("0",dy); char *date_string = yon_char_unite(yr,"-",mn,"-",dy); gtk_entry_set_text(GTK_ENTRY(window->userPasswordExpirationEntry), date_string); window->expiration_unix=date_string; -- 2.35.1 From e9233a78d241d586c8e4f7e3735f10979e7aa842 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 15:17:55 +0600 Subject: [PATCH 20/33] Switched group deletion function to same as user's --- source/ubl-settings-usergroups.c | 101 +++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 12 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 8c7c74b..5fbfc92 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -452,6 +452,50 @@ void yon_delete_confirmation_save(GtkWidget *self, dictionary *dict){ on_subwindow_close(self); } +void yon_group_delete_confirmation_save(GtkWidget *self, dictionary *dict){ + GtkTreeIter iter,itar; + main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); + yon_confirmation_window *window = yon_dictionary_get_data(dict->first->next,yon_confirmation_window*); + int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->GroupsList),&iter); + for (;valid;valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->GroupsList),&iter)){ + char *name; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->GroupsList),&iter,2,&name,-1); + int valid2 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar); + for (;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){ + char *name_check; + int status,delete; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&delete,1,&name_check,-1); + if (!strcmp(name,name_check)&&delete){ + gtk_list_store_remove(widgets->GroupsList,&iter); + yon_config_remove_by_key(USERADD(name)); + yon_config_remove_by_key(USERSHADOW(name)); + gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->GroupsList),&iter); + } + } + } + char *name; + if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->GroupsList),&iter)){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->GroupsList),&iter,1,&name,-1); + int valid2 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itar); + for (;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){ + char *name_check; + int status,delete; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&delete,1,&name_check,3,&status,-1); + if (!strcmp(name,name_check)&&delete){ + gtk_list_store_remove(widgets->GroupsList,&iter); + yon_config_remove_by_key(GROUPADD(name)); + gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->GroupsList),&iter); + if (status){ + if (yon_char_parsed_check_exist(main_config.remove_homes,main_config.homes_size,name)==-1){ + yon_char_parsed_add_or_create_if_exists(main_config.remove_homes,&main_config.homes_size,name); + } + } + } + } + } + on_subwindow_close(self); +} + yon_confirmation_window *yon_delete_confirmation_new(){ yon_confirmation_window *window = malloc(sizeof(yon_confirmation_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_confirmation); @@ -514,6 +558,38 @@ void yon_delete_confirmation_open(main_window *widgets){ gtk_widget_show(window->Window); } +void yon_group_delete_confirmation_open(main_window *widgets){ + yon_confirmation_window *window = yon_delete_confirmation_new(); + gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window)); + GtkTreeIter iter,itar; + dictionary *dict = NULL; + gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->DeletionTree),2),0); + gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->DeletionTree),3),0); + gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->DeletionTree),4),0); + yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); + g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_group_delete_confirmation_save),dict); + GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList); + GList *list = gtk_tree_selection_get_selected_rows(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model); + int chosen_size=0; + config_str chosen = NULL; + for (int i=0;iGroupsList),&iter); + for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->GroupsList),&iter)){ + char *name; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->GroupsList),&iter,1,&name,-1); + gtk_list_store_append(window->list,&itar); + gtk_list_store_set(window->list,&itar,0,yon_char_parsed_check_exist(chosen,chosen_size,name)>-1?1:0,1,name,-1); + free(name); + } + gtk_widget_show(window->Window); +} + yon_savasettings_window *yon_saving_settings_new(){ GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_savesettings); yon_savasettings_window *window = malloc(sizeof(yon_savasettings_window)); @@ -2245,18 +2321,19 @@ void on_main_delete(GtkWidget *self, main_window *widgets){ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){ yon_delete_confirmation_open(widgets); } else { - model = GTK_TREE_MODEL(widgets->GroupsList); - cur_tree=widgets->GroupsTree; - if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){ - char *name; - gtk_tree_model_get(model,&iter,1,&name,-1); - data->action_text=DELETE_CONFIRMATION_LABEL("group",name); - if (yon_confirmation_dialog_call(self,data)==GTK_RESPONSE_ACCEPT){ - yon_config_remove_by_key(GROUPADD(name)); - gtk_list_store_remove(GTK_LIST_STORE(model),&iter); - - } - } + yon_group_delete_confirmation_open(widgets); + // model = GTK_TREE_MODEL(widgets->GroupsList); + // cur_tree=widgets->GroupsTree; + // if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){ + // char *name; + // gtk_tree_model_get(model,&iter,1,&name,-1); + // data->action_text=DELETE_CONFIRMATION_LABEL("group",name); + // if (yon_confirmation_dialog_call(self,data)==GTK_RESPONSE_ACCEPT){ + // yon_config_remove_by_key(GROUPADD(name)); + // gtk_list_store_remove(GTK_LIST_STORE(model),&iter); + + // } + // } } } -- 2.35.1 From 758fd4565a70fb72fe0c887f54df8dbe86c1fe8f Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 15:45:39 +0600 Subject: [PATCH 21/33] Changed logic of group password rendering --- source/ubl-settings-usergroups.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 5fbfc92..835c2fc 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -119,12 +119,25 @@ void yon_interface_update(main_window *widgets){ login[strlen(login)-1]='\0'; } if (!strcmp(parameters[1],"x")) parameters[1]=""; + char *pars=""; + if (parameters_size>3&&strcmp(parameters[3],"x")&&strcmp(parameters[3],"")){ + + if (!check_is_password_hash(parameters[3])){ + pars = ENCRYPTED_LABEL; + } else { + pars = UNENCRYPTED_LABEL; + + } + } else { + pars = DEFAULT_USER_LABEL; + + } gtk_list_store_set(widgets->GroupsList,&iter, 1,login, 0,parameters_size>1?parameters[1]:"", 2,parameters_size>0?parameters[0]:"", 3,parameters_size>2?parameters[2]:"", - 4,parameters_size>3?ENCRYPTED_LABEL:DEFAULT_USER_LABEL, + 4,pars, -1); if(parameters) free(parameters); -- 2.35.1 From 56f3b77f394aacf350a5021a2a9aadeead655f7a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 16:19:07 +0600 Subject: [PATCH 22/33] Fixed saving of parameter when old and new values are same, but target configuration is local, what means it never contains 6th section - password --- source/ubl-settings-usergroups.c | 56 ++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 835c2fc..c52b4ce 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -309,8 +309,60 @@ void on_config_save(GtkWidget *self, main_window *widgets){ yon_samba_sync_proceed(); template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL); if (window){ - yon_hide_passwords(window); - g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(on_save_window_close_update),widgets); + if (main_config.load_mode==0){ + GtkTreeIter iter; + int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter); + for(;valid;valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ + char *parameter,*old_value, *new_value; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,¶meter,2,&old_value,3,&new_value,-1); + int old_size, new_size; + config_str old_parsed = yon_char_parse(old_value,&old_size,":"); + config_str new_parsed = yon_char_parse(new_value,&new_size,":"); + if (old_parsed&&new_parsed){ + char *parameter_type = yon_char_divide_search(parameter,"[",-1); + if (!strcmp(parameter_type,"USERADD")){ + if (old_size>5){ + old_parsed = yon_char_parsed_rip(old_parsed,&old_size,5); + + } + if (new_size>5){ + new_parsed = yon_char_parsed_rip(new_parsed,&new_size,5); + } + char *old_final = yon_char_parsed_to_string(old_parsed,old_size,":"); + char *new_final = yon_char_parsed_to_string(new_parsed,new_size,":"); + if (!strcmp(old_final,new_final)){ + gtk_list_store_set(window->list,&iter,5,0,-1); + } + free(old_final); + free(new_final); + yon_char_parsed_free(old_parsed,old_size); + yon_char_parsed_free(new_parsed,new_size); + + } else if (!strcmp(parameter_type,"GROUPADD")){ + if (old_size>3){ + old_parsed = yon_char_parsed_rip(old_parsed,&old_size,3); + + } + if (new_size>3){ + new_parsed = yon_char_parsed_rip(new_parsed,&new_size,3); + } + char *old_final = yon_char_parsed_to_string(old_parsed,old_size,":"); + char *new_final = yon_char_parsed_to_string(new_parsed,new_size,":"); + if (!strcmp(old_final,new_final)){ + gtk_list_store_set(window->list,&iter,5,0,-1); + } + free(old_final); + free(new_final); + yon_char_parsed_free(old_parsed,old_size); + yon_char_parsed_free(new_parsed,new_size); + + } + } + } + } else { + yon_hide_passwords(window); + g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(on_save_window_close_update),widgets); + } } } -- 2.35.1 From a0064ad9d190bf7b301d6e78a921ea86ec21e86c Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 17:05:35 +0600 Subject: [PATCH 23/33] Fixed groups 'x' instead of empty string at additional parameters column --- source/ubl-settings-usergroups.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index c52b4ce..a9ae29a 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -118,6 +118,9 @@ void yon_interface_update(main_window *widgets){ login = yon_char_divide_search(parameters[0],"=",-1); login[strlen(login)-1]='\0'; } + if (parameters_size>2&&!strcmp(parameters[2],"x")){ + parameters[2]=""; + } if (!strcmp(parameters[1],"x")) parameters[1]=""; char *pars=""; if (parameters_size>3&&strcmp(parameters[3],"x")&&strcmp(parameters[3],"")){ -- 2.35.1 From 46f1e18b04ca62e2f1372cad097bfa5dbbec90e5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 17:07:43 +0600 Subject: [PATCH 24/33] Localisation changes --- source/ubl-strings.h | 2 +- ubl-settings-usergroups.pot | 2 +- ubl-settings-usergroups_ru.po | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index cf85c5b..b2f5a55 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -116,7 +116,7 @@ //ubl-settings-usergroups-system.glade #define INSPECTOR_TITLE_LABEL _("System users and groups") -#define DISABLED_LABEL _("Disabled") +#define LOCKED_LABEL _("Locked") #define USERNAME_LABEL _("Username") #define PRIMARY_GROUP_LABEL _("Primary\ngroup") #define HOME_DIRECTORY_LABEL _("Home\ndirectory") diff --git a/ubl-settings-usergroups.pot b/ubl-settings-usergroups.pot index 24a4631..f1ebb1a 100644 --- a/ubl-settings-usergroups.pot +++ b/ubl-settings-usergroups.pot @@ -372,7 +372,7 @@ msgid "System users and groups" msgstr "" #: source/ubl-strings.h:119 -msgid "Disabled" +msgid "Locked" msgstr "" #: source/ubl-strings.h:120 diff --git a/ubl-settings-usergroups_ru.po b/ubl-settings-usergroups_ru.po index 6edb3d7..29f088f 100644 --- a/ubl-settings-usergroups_ru.po +++ b/ubl-settings-usergroups_ru.po @@ -388,7 +388,7 @@ msgid "System users and groups" msgstr "Пользователи и группы в системе" #: source/ubl-strings.h:119 -msgid "Disabled" +msgid "Locked" msgstr "Отключен" #: source/ubl-strings.h:120 -- 2.35.1 From 94c225b91b015dd96ac6e94bd4e0944948271632 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 27 Feb 2024 17:11:17 +0600 Subject: [PATCH 25/33] Comments removal --- source/ubl-settings-usergroups.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index a9ae29a..d450c3c 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -803,7 +803,7 @@ void on_passwords_encrypt(){ } } -void on_password_change(GtkWidget *self, dictionary *entry_dict){// +void on_password_change(GtkWidget *self, dictionary *entry_dict){ GtkComboBox *combo = yon_dictionary_get_data(entry_dict->first,GtkComboBox*); GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*); ubl_settings_usergroups_password_window *window = yon_ubl_settings_usergroups_password_new(); @@ -2239,7 +2239,6 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ }else if (!strcmp(parameters_substring[i],"--no-create-home")||!strcmp(parameters_substring[i],"-M")){ gtk_combo_box_set_active(GTK_COMBO_BOX(window->userHomeCombo),2); }else if (!strcmp(parameters_substring[i],"--no-user-group")||!strcmp(parameters_substring[i],"-N")){ - // gtk gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck),0); gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),""); }else if (!strcmp(parameters_substring[i],"--non-unique")||!strcmp(parameters_substring[i],"-o")){ @@ -2248,7 +2247,6 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userDontCheckCheck),1); } } - // gtk_entry_set_text(GTK_ENTRY(window->), parsed_size>4?parameters[4]:""); } if (parsed_size>5){ window->old_password=parameters[5]; @@ -2390,18 +2388,6 @@ void on_main_delete(GtkWidget *self, main_window *widgets){ yon_delete_confirmation_open(widgets); } else { yon_group_delete_confirmation_open(widgets); - // model = GTK_TREE_MODEL(widgets->GroupsList); - // cur_tree=widgets->GroupsTree; - // if(gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(cur_tree)),&model,&iter)){ - // char *name; - // gtk_tree_model_get(model,&iter,1,&name,-1); - // data->action_text=DELETE_CONFIRMATION_LABEL("group",name); - // if (yon_confirmation_dialog_call(self,data)==GTK_RESPONSE_ACCEPT){ - // yon_config_remove_by_key(GROUPADD(name)); - // gtk_list_store_remove(GTK_LIST_STORE(model),&iter); - - // } - // } } } @@ -2474,9 +2460,6 @@ void config_init(){ if (!strcmp(divided,"minlen")){ main_config.password_min_length = atol(strstr(login_defs[i],"\t")); } - // else if (!strcmp(divided,"UID_MIN")){ - // main_config.MINUID = atol(strstr(login_defs[i],"\t")); - // } } } } @@ -2492,7 +2475,6 @@ void config_init(){ } free(parameter); } - // yon_char_parsed_free(file_output,size); } void on_selection_changed(GtkWidget *self, main_window *widgets){ -- 2.35.1 From a5e9efaa47e22a3baeffc39007a6a719676a9c03 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:12:01 +0600 Subject: [PATCH 26/33] fixed group GID loading --- source/ubl-settings-usergroups.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index d450c3c..e7cf8ad 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -2326,10 +2326,10 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ if (size>1&&strcmp(parsed[0],"x")) gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),parsed[0]); if (size>1){ - if (!strcmp(parsed[1],"")||!strcmp(parsed[1],"x")) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),1); - else + if (strcmp(parsed[1],"")&&strcmp(parsed[1],"x")){ gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),parsed[1]); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0); + } } if (size>2&&!yon_char_is_empty(parsed[2])){ int parsed_size=0; -- 2.35.1 From fde8df91175b217b504173932bd7fd4cdb6c10a4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:12:12 +0600 Subject: [PATCH 27/33] Localisatino update --- source/ubl-strings.h | 5 ++++- ubl-settings-usergroups.pot | 18 +++++++++++++----- ubl-settings-usergroups_ru.po | 20 ++++++++++++++------ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index b2f5a55..2f9f4a0 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -191,9 +191,12 @@ #define SYSTEM_SAVEMODE_LABEL _("For system save mode \"Sandbox\"") //ubl-settings-usergroups-confirmation.glade +#define DELETE_GROUP_CONFIRMATION_TITLE_LABEL _("Group deletion") +#define DELETE_GROUP_CONFIRMATION_CONFIRM_LABEL _("Confirm group(-s) deletion:") + #define DELETE_CONFIRMATION_TITLE_LABEL _("User deletion") #define DELETE_CONFIRMATION_CONFIRM_LABEL _("Confirm user(-s) deletion:") #define DELETE_CONFIRMATION_CHOSEN_LABEL _("Chosen") #define DELETE_CONFIRMATION_USER_LABEL _("User") #define DELETE_CONFIRMATION_HOME_LABEL _("Home directory") -#define DELETE_CONFIRMATION_DELETE_HOME_LABEL _("Delete home directory") \ No newline at end of file +#define DELETE_CONFIRMATION_DELETE_HOME_LABEL _("Delete home directory") diff --git a/ubl-settings-usergroups.pot b/ubl-settings-usergroups.pot index f1ebb1a..a1b415c 100644 --- a/ubl-settings-usergroups.pot +++ b/ubl-settings-usergroups.pot @@ -651,26 +651,34 @@ msgid "For system save mode \"Sandbox\"" msgstr "" #: source/ubl-strings.h:194 -msgid "User deletion" +msgid "Group deletion" msgstr "" #: source/ubl-strings.h:195 +msgid "Confirm group(-s) deletion:" +msgstr "" + +#: source/ubl-strings.h:197 +msgid "User deletion" +msgstr "" + +#: source/ubl-strings.h:198 msgid "Confirm user(-s) deletion:" msgstr "" -#: source/ubl-strings.h:196 +#: source/ubl-strings.h:199 msgid "Chosen" msgstr "" -#: source/ubl-strings.h:197 +#: source/ubl-strings.h:200 msgid "User" msgstr "" -#: source/ubl-strings.h:198 +#: source/ubl-strings.h:201 msgid "Home directory" msgstr "" -#: source/ubl-strings.h:199 +#: source/ubl-strings.h:202 msgid "Delete home directory" msgstr "" diff --git a/ubl-settings-usergroups_ru.po b/ubl-settings-usergroups_ru.po index 29f088f..d0d9602 100644 --- a/ubl-settings-usergroups_ru.po +++ b/ubl-settings-usergroups_ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ubl-ubl-settings-usergroups 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-26 14:59+0600\n" +"POT-Creation-Date: 2023-05-22 16:12+0600\n" "PO-Revision-Date: 2023-01-01 00:00+0600\n" "Last-Translator: UBLinux Team \n" "Language-Team: Russian - UBLinux Team \n" @@ -692,26 +692,34 @@ msgid "For system save mode \"Sandbox\"" msgstr "Для режима сохранения системы \"Песочница\"" #: source/ubl-strings.h:194 -msgid "User deletion" +msgid "Group deletion" msgstr "Удаление пользователя(-лей)" #: source/ubl-strings.h:195 +msgid "Confirm group(-s) deletion:" +msgstr "Подтвердите удаление групп(-ы):" + +#: source/ubl-strings.h:197 +msgid "User deletion" +msgstr "Удаление групп(-ы)" + +#: source/ubl-strings.h:198 msgid "Confirm user(-s) deletion:" msgstr "Подтвердите удаление пользователя (-ей):" -#: source/ubl-strings.h:196 +#: source/ubl-strings.h:199 msgid "Chosen" msgstr "Выбран" -#: source/ubl-strings.h:197 +#: source/ubl-strings.h:200 msgid "User" msgstr "Пользователь" -#: source/ubl-strings.h:198 +#: source/ubl-strings.h:201 msgid "Home directory" msgstr "Домашний каталог" -#: source/ubl-strings.h:199 +#: source/ubl-strings.h:202 msgid "Delete home directory" msgstr "Удалить домашний каталог" -- 2.35.1 From 353ccefb7534942abcbfc735deff82a4cedf3b83 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:41:10 +0600 Subject: [PATCH 28/33] Changed 'default password' for group tab to 'no password required' --- source/ubl-settings-usergroups.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index e7cf8ad..8be6a12 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -132,7 +132,7 @@ void yon_interface_update(main_window *widgets){ } } else { - pars = DEFAULT_USER_LABEL; + pars = NO_PASSWORD_LABEL; } gtk_list_store_set(widgets->GroupsList,&iter, @@ -2355,7 +2355,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),parsed[4]); gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),2); } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),0); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),1); } } char *sync = yon_config_get_by_key(GROUPADD_SYNC(name)); -- 2.35.1 From 8cb8fbb9f40299b674839f82a658eb81e940e116 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:50:22 +0600 Subject: [PATCH 29/33] Localisation fixes --- ubl-settings-usergroups-system.glade | 2 +- ubl-settings-usergroups.glade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ubl-settings-usergroups-system.glade b/ubl-settings-usergroups-system.glade index c2bd604..18d4aa7 100644 --- a/ubl-settings-usergroups-system.glade +++ b/ubl-settings-usergroups-system.glade @@ -140,7 +140,7 @@ True fixed 50 - Disabled + Locked diff --git a/ubl-settings-usergroups.glade b/ubl-settings-usergroups.glade index 535d785..16713af 100644 --- a/ubl-settings-usergroups.glade +++ b/ubl-settings-usergroups.glade @@ -329,7 +329,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True fixed 10 - Disabled + Locked 0 -- 2.35.1 From 48b9ecc076d117e579fa547f025f7ee0715a7f15 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:53:48 +0600 Subject: [PATCH 30/33] Localisatino update --- source/ubl-strings.h | 2 ++ ubl-settings-usergroups.pot | 32 ++++++++++++++++++-------------- ubl-settings-usergroups_ru.po | 32 ++++++++++++++++++-------------- 3 files changed, 38 insertions(+), 28 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 2f9f4a0..2343452 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -180,6 +180,8 @@ #define ADDITIONAL_NAME_LABEL _("Additional") #define SYNCRONIZATION_NAME_LABEL _("Syncronization") +#define PASSWORD_NO_SET_LABEL _("Not specified") + //ubl-settings-usergroups-password.glade #define PASSWORD_REPEAT_LABEL _("Repeat password:") #define PASSWORD_HASH_LABEL _("Password hash:") diff --git a/ubl-settings-usergroups.pot b/ubl-settings-usergroups.pot index a1b415c..8974fc1 100644 --- a/ubl-settings-usergroups.pot +++ b/ubl-settings-usergroups.pot @@ -624,61 +624,65 @@ msgstr "" msgid "Syncronization" msgstr "" -#: source/ubl-strings.h:184 +#: source/ubl-strings.h:183 +msgid "Not specified" +msgstr "" + +#: source/ubl-strings.h:186 msgid "Repeat password:" msgstr "" -#: source/ubl-strings.h:185 +#: source/ubl-strings.h:187 msgid "Password hash:" msgstr "" -#: source/ubl-strings.h:186 +#: source/ubl-strings.h:188 msgid "Do not encrypt password" msgstr "" -#: source/ubl-strings.h:189 +#: source/ubl-strings.h:191 msgid "Additional configuration of service parameter saving" msgstr "" -#: source/ubl-strings.h:190 +#: source/ubl-strings.h:192 msgid "" "At every system shutdown save changes of (root)/var/lib/samba\n" "into (hd)/ublinux-data/rootcopy" msgstr "" -#: source/ubl-strings.h:191 +#: source/ubl-strings.h:193 msgid "For system save mode \"Sandbox\"" msgstr "" -#: source/ubl-strings.h:194 +#: source/ubl-strings.h:196 msgid "Group deletion" msgstr "" -#: source/ubl-strings.h:195 +#: source/ubl-strings.h:197 msgid "Confirm group(-s) deletion:" msgstr "" -#: source/ubl-strings.h:197 +#: source/ubl-strings.h:199 msgid "User deletion" msgstr "" -#: source/ubl-strings.h:198 +#: source/ubl-strings.h:200 msgid "Confirm user(-s) deletion:" msgstr "" -#: source/ubl-strings.h:199 +#: source/ubl-strings.h:201 msgid "Chosen" msgstr "" -#: source/ubl-strings.h:200 +#: source/ubl-strings.h:202 msgid "User" msgstr "" -#: source/ubl-strings.h:201 +#: source/ubl-strings.h:203 msgid "Home directory" msgstr "" -#: source/ubl-strings.h:202 +#: source/ubl-strings.h:204 msgid "Delete home directory" msgstr "" diff --git a/ubl-settings-usergroups_ru.po b/ubl-settings-usergroups_ru.po index d0d9602..d492236 100644 --- a/ubl-settings-usergroups_ru.po +++ b/ubl-settings-usergroups_ru.po @@ -663,23 +663,27 @@ msgstr "Дополнительные" msgid "Syncronization" msgstr "Синхронизация" -#: source/ubl-strings.h:184 +#: source/ubl-strings.h:183 +msgid "Not specified" +msgstr "Не задан" + +#: source/ubl-strings.h:186 msgid "Repeat password:" msgstr "Подтверждение пароля:" -#: source/ubl-strings.h:185 +#: source/ubl-strings.h:187 msgid "Password hash:" msgstr "Хэш пароля:" -#: source/ubl-strings.h:186 +#: source/ubl-strings.h:188 msgid "Do not encrypt password" msgstr "Не шифровать пароль" -#: source/ubl-strings.h:189 +#: source/ubl-strings.h:191 msgid "Additional configuration of service parameter saving" msgstr "Дополнительные настройки сохранения параметров сервисов" -#: source/ubl-strings.h:190 +#: source/ubl-strings.h:192 msgid "" "At every system shutdown save changes of (root)/var/lib/samba\n" "into (hd)/ublinux-data/rootcopy" @@ -687,39 +691,39 @@ msgstr "" "При каждом завершении работы ОС сохранять изменения (root)/var/lib/samba\n" "в (hd)/ublinux-data/rootcopy/" -#: source/ubl-strings.h:191 +#: source/ubl-strings.h:193 msgid "For system save mode \"Sandbox\"" msgstr "Для режима сохранения системы \"Песочница\"" -#: source/ubl-strings.h:194 +#: source/ubl-strings.h:196 msgid "Group deletion" msgstr "Удаление пользователя(-лей)" -#: source/ubl-strings.h:195 +#: source/ubl-strings.h:197 msgid "Confirm group(-s) deletion:" msgstr "Подтвердите удаление групп(-ы):" -#: source/ubl-strings.h:197 +#: source/ubl-strings.h:199 msgid "User deletion" msgstr "Удаление групп(-ы)" -#: source/ubl-strings.h:198 +#: source/ubl-strings.h:200 msgid "Confirm user(-s) deletion:" msgstr "Подтвердите удаление пользователя (-ей):" -#: source/ubl-strings.h:199 +#: source/ubl-strings.h:201 msgid "Chosen" msgstr "Выбран" -#: source/ubl-strings.h:200 +#: source/ubl-strings.h:202 msgid "User" msgstr "Пользователь" -#: source/ubl-strings.h:201 +#: source/ubl-strings.h:203 msgid "Home directory" msgstr "Домашний каталог" -#: source/ubl-strings.h:202 +#: source/ubl-strings.h:204 msgid "Delete home directory" msgstr "Удалить домашний каталог" -- 2.35.1 From 994ba158837657facfe8d1df6aec433e37a0ab1d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 10:55:34 +0600 Subject: [PATCH 31/33] Changed label from 'no password need' to 'not specified' at groups password status column --- source/ubl-settings-usergroups.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 8be6a12..37b0108 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -132,7 +132,7 @@ void yon_interface_update(main_window *widgets){ } } else { - pars = NO_PASSWORD_LABEL; + pars = PASSWORD_NO_SET_LABEL; } gtk_list_store_set(widgets->GroupsList,&iter, @@ -1148,7 +1148,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){ if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter)) gtk_list_store_append(widgets->GroupsList,&iter); char *passwor = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); - gtk_list_store_set(widgets->GroupsList,&iter,0,strcmp(gid,"x")?gid:"",1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_get_active(GTK_COMBO_BOX(window->PasswordCombo))==0?DEFAULT_USER_LABEL:check_is_password_hash(passwor)?UNENCRYPTED_LABEL:ENCRYPTED_LABEL,-1); + gtk_list_store_set(widgets->GroupsList,&iter,0,strcmp(gid,"x")?gid:"",1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_get_active(GTK_COMBO_BOX(window->PasswordCombo))==0?PASSWORD_NO_SET_LABEL:check_is_password_hash(passwor)?UNENCRYPTED_LABEL:ENCRYPTED_LABEL,-1); on_subwindow_close(self); } -- 2.35.1 From 45103f8d60c49f8dc027bcdfe5e02964bafd6685 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 16:21:57 +0600 Subject: [PATCH 32/33] Fixed users and groups repeating at group choosing window --- source/ubl-settings-usergroups.c | 113 ++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 32 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 37b0108..0efee6e 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -715,16 +715,26 @@ void on_groups_save(GtkWidget *self, dictionary *dict){ } void on_groups_clicked(GtkWidget *self, GtkEntry *output_target){ - ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(); + ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0); gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),MAIN_GROUP_LABEL); gtk_label_set_text(GTK_LABEL(window->HeaderLabel),MAIN_GROUP_LABEL); - GtkTreeIter iter, itar; + GtkTreeIter iter, itar,itor; int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.groups_list),&iter); for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.groups_list),&iter)){ char *groupname; gtk_tree_model_get(GTK_TREE_MODEL(main_config.groups_list),&iter,1,&groupname,-1); - gtk_list_store_append(window->list,&itar); - gtk_list_store_set(window->list,&itar,1,groupname,-1); + int valid1 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itor); + for (;valid1;valid1 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itor)){ + char *checked; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itor,1,&checked,-1); + if (!strcmp(groupname,checked)){ + break; + } + } + if (!valid1){ + gtk_list_store_append(window->list,&itar); + gtk_list_store_set(window->list,&itar,1,groupname,-1); + } free(groupname); } gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),0),0); @@ -760,10 +770,10 @@ void on_groups_multiple_save(GtkWidget *self, dictionary *dict){ } void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){ - ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(); + ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0); gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),ADDITIONAL_GROUPS_TITLE_LABEL); gtk_label_set_text(GTK_LABEL(window->HeaderLabel),ADDITIONAL_GROUPS_TITLE_LABEL); - GtkTreeIter iter, itar; + GtkTreeIter iter, itar,itor; char *output = (char*)gtk_entry_get_text(output_target); int size=0; config_str parsed=NULL; @@ -774,8 +784,18 @@ void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.groups_list),&iter)){ char *groupname; gtk_tree_model_get(GTK_TREE_MODEL(main_config.groups_list),&iter,1,&groupname,-1); - gtk_list_store_append(window->list,&itar); - gtk_list_store_set(window->list,&itar,1,groupname,-1); + int valid1 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itor); + for (;valid1;valid1 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itor)){ + char *checked; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itor,1,&checked,-1); + if (!strcmp(groupname,checked)){ + break; + } + } + if (!valid1){ + gtk_list_store_append(window->list,&itar); + gtk_list_store_set(window->list,&itar,1,groupname,-1); + } free(groupname); } valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter); @@ -1007,11 +1027,11 @@ void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *self, main_w } void on_user_choose(GtkWidget *self, GtkEntry *target){ - ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(); + ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(1); gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL); gtk_label_set_text(GTK_LABEL(window->HeaderLabel),GROUP_USERS_TITLE_LABEL); gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(window->GroupColumn),USERS_LABEL); - GtkTreeIter iter, itar; + GtkTreeIter iter, itar,itor; char *output = (char*)gtk_entry_get_text(target); int size=0; config_str parsed=NULL; @@ -1022,8 +1042,18 @@ void on_user_choose(GtkWidget *self, GtkEntry *target){ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.users_list),&iter)){ char *groupname; gtk_tree_model_get(GTK_TREE_MODEL(main_config.users_list),&iter,2,&groupname,-1); - gtk_list_store_append(window->list,&itar); - gtk_list_store_set(window->list,&itar,1,groupname,-1); + int valid1 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itor); + for (;valid1;valid1 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itor)){ + char *checked; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itor,1,&checked,-1); + if (!strcmp(groupname,checked)){ + break; + } + } + if (!valid1){ + gtk_list_store_append(window->list,&itar); + gtk_list_store_set(window->list,&itar,1,groupname,-1); + } free(groupname); } valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter); @@ -1119,12 +1149,12 @@ void on_group_save(GtkWidget *self, dictionary *dict){ admins = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdminGroupsEntry)); int non_unique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UnuniqueGIDCheck)); if(non_unique_active){ - non_unique=" --non-unique"; + non_unique="--non-unique"; } else non_unique=""; int gsystem_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->SystemGroupCheck)); if(gsystem_active){ - gsystem=" --system"; + gsystem="--system"; } else gsystem=""; int shutdown_sync_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->GroupaddShutdownCheck)); @@ -1232,7 +1262,7 @@ void on_group_clicked(GtkCellRenderer *self, char *path, ubl_settings_usergroups gtk_list_store_set(window->list,&iter,0,!status,-1); } -ubl_settings_usergroups_group_window *yon_ubl_settings_usergroups_group_new(){ +ubl_settings_usergroups_group_window *yon_ubl_settings_usergroups_group_new(int mode){ // 1 - user, 0 - group ubl_settings_usergroups_group_window *window = malloc(sizeof(ubl_settings_usergroups_group_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubl_settings_usergroups_group); window->GroupsWindow=yon_gtk_builder_get_widget(builder,"GroupsWindow"); @@ -1248,13 +1278,22 @@ ubl_settings_usergroups_group_window *yon_ubl_settings_usergroups_group_new(){ gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),GROUPS_TITLE_LABEL); g_signal_connect(G_OBJECT(window->StatusCell),"toggled",G_CALLBACK(on_group_clicked),window); GtkTreeIter iter; - gtk_tree_view_set_model(GTK_TREE_VIEW(window->GroupsTree),GTK_TREE_MODEL(window->list)); - for (int i=0;ilist,&iter); gtk_list_store_set(window->list,&iter,0,0,1,group_name,-1); } + gtk_tree_view_set_model(GTK_TREE_VIEW(window->GroupsTree),GTK_TREE_MODEL(window->list)); g_signal_connect(G_OBJECT(window->GroupsCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); @@ -1282,16 +1321,26 @@ void on_standard_groups_accept(GtkWidget *self, ubl_settings_usergroups_group_wi } void on_standard_groups_open(GtkWidget *self, main_window *widgets){ - ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(); + ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0); gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),DEFAULT_GROUPS_TITLE_LABEL); gtk_label_set_text(GTK_LABEL(window->HeaderLabel),DEFAULT_GROUPS_TITLE_LABEL); - GtkTreeIter iter, itar; + GtkTreeIter iter, itar,itor; int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.groups_list),&iter); for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.groups_list),&iter)){ char *groupname; gtk_tree_model_get(GTK_TREE_MODEL(main_config.groups_list),&iter,1,&groupname,-1); - gtk_list_store_append(window->list,&itar); - gtk_list_store_set(window->list,&itar,1,groupname,-1); + int valid1 = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&itor); + for (;valid1;valid1 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itor)){ + char *checked; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itor,1,&checked,-1); + if (!strcmp(groupname,checked)){ + break; + } + } + if (!valid1){ + gtk_list_store_append(window->list,&itar); + gtk_list_store_set(window->list,&itar,1,groupname,-1); + } free(groupname); } g_signal_connect(G_OBJECT(window->GroupsOkButton),"clicked",G_CALLBACK(on_standard_groups_accept),window); @@ -1305,11 +1354,11 @@ void on_standard_groups_open(GtkWidget *self, main_window *widgets){ for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ char *cur_name; gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&cur_name,-1); - for (int i=0;ilist,&iter,0,1,-1); + for (int i=0;ilist,&iter,0,1,-1); + } } - } free(cur_name); } } @@ -1633,7 +1682,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){ int do_not_check_actve = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userDontCheckCheck)); if (do_not_check_actve) - do_not_check = " --badnames"; + do_not_check = "--badnames"; login = (char*)gtk_entry_get_text(GTK_ENTRY(window->userLoginEntry)); if (login[0]>'0'&&login[0]<'9'&&!do_not_check_actve){ @@ -1718,9 +1767,9 @@ void on_user_save(GtkWidget *self, dictionary *dict){ int user_shell_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->userShellCombo)); if (user_shell_active>0){ - user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); + user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); if (!strcmp(user_shell,SET_LABEL)){ - user_shell = yon_char_unite(" --shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); + user_shell = yon_char_unite("--shell ",(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->userShellCombo)),NULL); } } else user_shell=""; @@ -1733,11 +1782,11 @@ void on_user_save(GtkWidget *self, dictionary *dict){ int system_user_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateSystemCheck)); if (system_user_active) - create_system_user = " --system"; + create_system_user = "--system"; int create_ununique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck)); if (create_ununique_active) - create_ununique = " --non-unique"; + create_ununique = "--non-unique"; samba_sync = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck)); samba_password_sync = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck)); @@ -1988,7 +2037,7 @@ void on_parameter_changed(GtkWidget *self,ubl_settings_usergroups_user_window *w int create_ununique_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userCreateUnuniqueCheck)); if (create_ununique_active) - create_ununique = " --non-unique"; + create_ununique = "--non-unique"; int main_group_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck)); if (!main_group_active){ main_group = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry)); -- 2.35.1 From f93691cc7c34282c7ba1427945bc5016831204f5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 28 Feb 2024 17:36:48 +0600 Subject: [PATCH 33/33] Passwords and hash of old values at saving window replaced with '********' --- source/ubl-settings-usergroups.c | 56 +++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 0efee6e..bcb9bd3 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -238,6 +238,22 @@ void yon_hide_passwords(template_saving_window *window){ } } if(!yon_char_is_empty(old_value)){ + config_str parsed = NULL; + parsed = yon_char_parse(old_value,&size,":"); + if (size>5&&!yon_char_is_empty(parsed[5])&&strcmp(parsed[5],"x")&&parsed[5][0]!='%'&&parsed[5][1]!='%'){ + free(old_value); + free(parsed[5]); + parsed[5]=yon_char_new("*******"); + old_value = yon_char_parsed_to_string(parsed,size,":"); + } else if (size>5&&!yon_char_is_empty(parsed[5])&&strcmp(parsed[5],"x")) { + free(old_value); + free(yon_char_divide(parsed[5],1)); + old_value = yon_char_parsed_to_string(parsed,size,":"); + } + if (parsed){ + yon_char_parsed_free(parsed,size); + } + old=yon_char_unite("",old_value,"",NULL); } if(!yon_char_is_empty(new_value)){ @@ -260,6 +276,21 @@ void yon_hide_passwords(template_saving_window *window){ new_value = yon_char_parsed_to_string(parsed,size,":"); } if(!yon_char_is_empty(old_value)){ + config_str parsed = NULL; + parsed = yon_char_parse(old_value,&size,":"); + if (size>4&&!yon_char_is_empty(parsed[4])&&strcmp(parsed[4],"x")&&parsed[4][0]!='%'&&parsed[4][1]!='%'){ + free(old_value); + free(parsed[4]); + parsed[4]=yon_char_new("*******"); + old_value = yon_char_parsed_to_string(parsed,size,":"); + } else if (size>4&&!yon_char_is_empty(parsed[4])&&strcmp(parsed[4],"x")) { + free(old_value); + free(yon_char_divide(parsed[4],1)); + old_value = yon_char_parsed_to_string(parsed,size,":"); + } + if (parsed){ + yon_char_parsed_free(parsed,size); + } old=yon_char_unite("",old_value,"",NULL); } if(!yon_char_is_empty(new_value)){ @@ -276,12 +307,21 @@ void yon_hide_passwords(template_saving_window *window){ free(yon_char_divide(new_value,1)); newv=new_value; } else if (!yon_char_is_empty(new_value)&&new_value[0]=='$') { - newv=new_value; + if (main_config.load_mode){ + newv=new_value; + } else { + newv="*******"; + } }else if (!yon_char_is_empty(new_value)){ newv="*******"; } if (!yon_char_is_empty(old_value)){ - old = yon_char_unite("",old_value,"",NULL); + if (main_config.load_mode){ + + old = yon_char_new("*******"); + } else { + old = yon_char_unite("",old_value,"",NULL); + } } char *new_string = yon_char_unite(!yon_char_is_empty(old)?old:"","\n",!yon_char_is_empty(newv)?newv:"",NULL); gtk_list_store_set(window->list,&iter,7,new_string,-1); @@ -293,12 +333,20 @@ void yon_hide_passwords(template_saving_window *window){ free(yon_char_divide(new_value,1)); newv=new_value; } else if (!yon_char_is_empty(new_value)&&new_value[0]=='$') { - newv=new_value; + if (main_config.load_mode){ + newv=new_value; + } else { + newv="*******"; + } }else if (!yon_char_is_empty(new_value)){ newv="*******"; } if (!yon_char_is_empty(old_value)){ - old = yon_char_unite("",old_value,"",NULL); + if (main_config.load_mode){ + old = yon_char_new("*******"); + } else { + old = yon_char_unite("",old_value,"",NULL); + } } char *new_string = yon_char_unite(!yon_char_is_empty(old)?old:"","\n",!yon_char_is_empty(newv)?newv:"",NULL); gtk_list_store_set(window->list,&iter,7,new_string,-1); -- 2.35.1