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); } class='list nowrap'>AgeCommit message (Expand)Author or 2018-09-27perform-download: Optionally report a "download-progress" trace....* guix/scripts/perform-download.scm (perform-download): Add #:print-build-trace? and pass it to 'url-fetch'. (guix-perform-download): Define 'print-build-trace?' and pass it to 'perform-download'. * guix/build/download.scm (ftp-fetch): Add #:print-build-trace? and honor it. (url-fetch): Likewise. * nix/libstore/builtins.cc (builtinDownload): Set _NIX_OPTIONS environment variable. Ludovic Courtès 2017-02-07daemon: Define 'NIX_STORE' before invoking 'guix perform-download'....Reported by rohit yadav <rohityadav@utexas.edu> at <https://lists.gnu.org/archive/html/guix-devel/2017-02/msg00191.html>. This fixes a regression whereby 'guix perform-download' would always see NIX_STORE as unset and thus use "/gnu/store", leading it to miscompute the hydra.gnu.org content-addressed URLs when the store file name is not "/gnu/store". * nix/libstore/builtins.cc (builtinDownload): Add 'setenv' call for 'NIX_STORE'. Ludovic Courtès 2017-01-11daemon: Allow check builds of 'builtin:download' derivations....Fixes <http://bugs.gnu.org/25089>. Reported by Leo Famulari <leo@famulari.name>. * nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin' case, check whether DRV's output is in 'redirectedOutputs', and pass an 'output' argument to the built-in builder. (DerivationGoal::addHashRewrite): Add 'printMsg' call. * nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter. * nix/libstore/builtins.cc (builtinDownload): Likewise. Add OUTPUT to ARGV. * guix/scripts/perform-download.scm (perform-download): Add 'output' parameter. (guix-perform-download): Adjust 'match' clauses accordingly. * tests/derivations.scm ("'download' built-in builder, check mode"): New test. Ludovic Courtès 2016-11-16daemon: Add 'built-in-builders' RPC....* nix/libstore/builtins.cc (builtinBuilderNames): New function. * nix/libstore/builtins.hh (builtinBuilderNames): New declaration. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x160. (WorkerOp)[wopBuiltinBuilders]: New value. * nix/nix-daemon/nix-daemon.cc (performOp): Handle it. * guix/store.scm (operation-id)[built-in-builders]: New value. * guix/store.scm (read-arg): Add 'string-list'. (built-in-builders): New procedure. * tests/derivations.scm ("built-in-builders"): New test. Ludovic Courtès 2016-11-16daemon: Add "builtin:download" derivation builder....This ensures that 1) the derivation doesn't change when Guix changes; 2) the derivation closure doesn't contain Guix and its dependencies; 3) we don't have to rely on ugly chroot hacks. Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131. * nix/libstore/build.cc (DerivationGoal::runChild): Add special case for 'isBuiltin(drv)'. Disable chroot when 'isBuiltin(drv)'. * nix/libstore/builtins.cc, nix/libstore/builtins.hh, nix/scripts/download.in, guix/scripts/perform-download.scm: New files. * guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'. * nix/local.mk (libstore_a_SOURCES): Add builtins.cc. (libstore_headers): Add builtins.hh. (nodist_pkglibexec_SCRIPTS): Add 'scripts/download'. * config-daemon.ac: Emit 'scripts/download'. * Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'. * tests/derivations.scm ("unknown built-in builder") ("'download' built-in builder") ("'download' built-in builder, invalid hash") ("'download' built-in builder, not found") ("'download' built-in builder, not fixed-output"): New tests. Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com> Ludovic Courtès