From d3026a6d331298003ccc6cd9d2e20dcb7fa9ae1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Date: Wed, 3 Jul 2019 13:31:54 +0200 Subject: [PATCH] respect NM_VPN_PLUGIN_DIR Rebased by Maxim Cournoyer on 2022/08/23. diff --git a/src/core/vpn/nm-vpn-manager.c b/src/core/vpn/nm-vpn-manager.c index 6bf8edaee5..9bd960ba86 100644 --- a/src/core/vpn/nm-vpn-manager.c +++ b/src/core/vpn/nm-vpn-manager.c @@ -209,8 +209,9 @@ nm_vpn_manager_init(NMVpnManager *self) NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE(self); GFile *file; GSList *infos, *info; - const char *conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc(); - const char *conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib(); + const char *conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc(); + const char *conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib(); + const char *conf_dir_user = _nm_vpn_plugin_info_get_default_dir_user(); /* Watch the VPN directory for changes */ file = g_file_new_for_path(conf_dir_lib); @@ -229,6 +230,14 @@ nm_vpn_manager_init(NMVpnManager *self) g_signal_connect(priv->monitor_etc, "changed", G_CALLBACK(vpn_dir_changed), self); } + file = g_file_new_for_path(conf_dir_user); + priv->monitor_etc = g_file_monitor_directory(file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref(file); + if (priv->monitor_etc) { + priv->monitor_id_etc = + g_signal_connect(priv->monitor_etc, "changed", G_CALLBACK(vpn_dir_changed), self); + } + /* first read conf_dir_lib. The name files are not really user configuration, but * plugin configuration. Hence we expect ~newer~ plugins to install their files * in /usr/lib/NetworkManager. We want to prefer those files. @@ -243,6 +252,11 @@ nm_vpn_manager_init(NMVpnManager *self) try_add_plugin(self, info->data); g_slist_free_full(infos, g_object_unref); + infos = _nm_vpn_plugin_info_list_load_dir(conf_dir_user, TRUE, 0, NULL, NULL); + for (info = infos; info; info = info->next) + try_add_plugin(self, info->data); + g_slist_free_full(infos, g_object_unref); + priv->active_services = g_hash_table_new_full(nm_str_hash, g_str_equal, g_free, NULL); } span title='2024-06-03 00:27:11 +0200'>2024-06-03build: Use the po4a command for the translation generation....gemmaro 2024-06-03build: Update the POT creation task with the po4a command....gemmaro 2024-05-25configure.ac: Set default value for the 'prefix' variable....Maxim Cournoyer 2024-04-19maint: Resurrect running `make' from a tarball....Janneke Nieuwenhuizen 2023-10-22teams: Adjust shebang to use 'guix repl'....Maxim Cournoyer 2023-09-26build: Add dependency on Git....Ludovic Courtès 2022-07-03etc: Add teams.scm....Ricardo Wurmus 2022-01-25build: Require Guile >= 3.0.3....Ludovic Courtès 2021-11-23maint: "make dist" builds tarballs in 'ustar' format....Ludovic Courtès