From 1e5977b62f896e844b548c3007ace9e1dfa7f9ed Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 11 Apr 2020 21:28:04 +0200 Subject: New upstream version 1.23.90 --- dispatcher/meson.build | 3 +++ dispatcher/nm-dispatcher.c | 4 ++-- dispatcher/tests/meson.build | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'dispatcher') diff --git a/dispatcher/meson.build b/dispatcher/meson.build index 7feb9597..9a691082 100644 --- a/dispatcher/meson.build +++ b/dispatcher/meson.build @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-2.1+ + dispatcher_inc = include_directories('.') name = 'nm-dispatcher' @@ -17,6 +19,7 @@ install_data( deps = [ libnm_dep, libnm_nm_default_dep, + libnm_libnm_aux_dep, ] c_flags = [ diff --git a/dispatcher/nm-dispatcher.c b/dispatcher/nm-dispatcher.c index c38ea00f..27647c1b 100644 --- a/dispatcher/nm-dispatcher.c +++ b/dispatcher/nm-dispatcher.c @@ -598,7 +598,7 @@ find_scripts (Request *request) else subdir = NULL; - scripts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + scripts = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); _find_scripts (request, scripts, NMLIBDIR, subdir); _find_scripts (request, scripts, NMCONFDIR, subdir); @@ -1090,7 +1090,7 @@ done: nm_clear_g_source (&signal_id_term); nm_clear_g_source (&signal_id_int); nm_clear_g_source (&gl.quit_id); - g_clear_pointer (&gl.loop, g_main_loop_unref); + nm_clear_pointer (&gl.loop, g_main_loop_unref); g_clear_object (&gl.dbus_connection); if (!gl.debug) diff --git a/dispatcher/tests/meson.build b/dispatcher/tests/meson.build index 83c915e5..5c6f6b12 100644 --- a/dispatcher/tests/meson.build +++ b/dispatcher/tests/meson.build @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: LGPL-2.1+ + test_unit = 'test-dispatcher-envp' deps = [ -- cgit 1.3.0-6-gf8a5 From d460892bbfece74fb6d3cd846bf6ef548290be41 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 8 May 2020 21:40:53 +0200 Subject: New upstream version 1.24.0 --- dispatcher/nm-dispatcher.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'dispatcher') diff --git a/dispatcher/nm-dispatcher.c b/dispatcher/nm-dispatcher.c index 27647c1b..e1737d85 100644 --- a/dispatcher/nm-dispatcher.c +++ b/dispatcher/nm-dispatcher.c @@ -482,7 +482,7 @@ check_filename (const char *file_name) static gboolean script_dispatch (ScriptInfo *script) { - GError *error = NULL; + gs_free_error GError *error = NULL; char *argv[4]; Request *request = script->request; @@ -491,27 +491,30 @@ script_dispatch (ScriptInfo *script) script->dispatched = TRUE; + /* Only for "hostname" action we coerce the interface name to "none". We don't + * do so for "connectivity-check" action. */ + argv[0] = script->script; - argv[1] = request->iface ?: (!strcmp(request->action, NMD_ACTION_HOSTNAME) ? "none" : ""); + argv[1] = request->iface + ?: (nm_streq (request->action, NMD_ACTION_HOSTNAME) ? "none" : ""); argv[2] = request->action; argv[3] = NULL; _LOG_S_T (script, "run script%s", script->wait ? "" : " (no-wait)"); - if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &script->pid, &error)) { - script->watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script); - script->timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script); - if (!script->wait) - request->num_scripts_nowait++; - return TRUE; - } else { + if (!g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &script->pid, &error)) { _LOG_S_W (script, "complete: failed to execute script: %s", error->message); script->result = DISPATCH_RESULT_EXEC_FAILED; script->error = g_strdup (error->message); request->num_scripts_done++; - g_clear_error (&error); return FALSE; } + + script->watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script); + script->timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script); + if (!script->wait) + request->num_scripts_nowait++; + return TRUE; } static gboolean -- cgit 1.3.0-6-gf8a5