dispatcher: only dump environment when there's no error
authorLubomir Rintel <lkundrak@v3.sk>
Mon, 18 Jan 2016 18:11:27 +0000 (19:11 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Mon, 18 Jan 2016 18:12:17 +0000 (19:12 +0100)
  (gdb) bt
  #0  0x00007f206bd1ec58 in handle_action (dbus_dispatcher=<optimized out>, context=0x7f2058003190, str_action=<optimized out>, connection_dict=0x7f205800bc40, connection_props=0x7f205800b900,
      device_props=0x7f205800b150, device_ip4_props=0x7f205800b120, device_ip6_props=0x7f205800b0f0, device_dhcp4_props=0x7f205800b0c0, device_dhcp6_props=0x7f205800b090, vpn_ip_iface=0x7f206c257990 "",
      vpn_ip4_props=0x7f205800b000, vpn_ip6_props=0x7f205800af90, request_debug=1, user_data=0x7f206c242980) at nm-dispatcher.c:722
  #1  0x00007f2068313dac in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #2  0x00007f20683136d5 in ffi_call (cif=cif@entry=0x7ffdfde6d2f0, fn=<optimized out>, rvalue=0x7ffdfde6d260, avalue=avalue@entry=0x7ffdfde6d140) at ../src/x86/ffi64.c:522
  #3  0x00007f2069ba4678 in g_cclosure_marshal_generic (closure=0x7f206c23a9e0, return_gvalue=0x7ffdfde6d440, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>,
      marshal_data=0x0) at gclosure.c:1454
  #4  0x00007f2069ba3e38 in g_closure_invoke (closure=0x7f206c23a9e0, return_value=return_value@entry=0x7ffdfde6d440, n_param_values=14, param_values=param_values@entry=0x7f206c256d10,
      invocation_hint=invocation_hint@entry=0x7ffdfde6d490) at gclosure.c:768
  #5  0x00007f2069bb575d in signal_emit_unlocked_R (node=node@entry=0x7f206c2505a0, detail=detail@entry=0, instance=instance@entry=0x7f206c2442a0, emission_return=emission_return@entry=0x7ffdfde6d5d0,
      instance_and_params=instance_and_params@entry=0x7f206c256d10) at gsignal.c:3553
  #6  0x00007f2069bbc641 in g_signal_emitv (instance_and_params=instance_and_params@entry=0x7f206c256d10, signal_id=signal_id@entry=6, detail=detail@entry=0, return_value=return_value@entry=0x7ffdfde6d5d0)
      at gsignal.c:3048
  #7  0x00007f206bd21aa1 in _nmdbus_dispatcher_skeleton_handle_method_call (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>,
      interface_name=0x7f2058010b20 "org.freedesktop.nm_dispatcher", method_name=0x7f205800ab00 "Action", parameters=<optimized out>, invocation=0x7f2058003190, user_data=0x7f206c2442a0)
      at nmdbus-dispatcher.c:1066
  #8  0x00007f2069ec8ba6 in g_dbus_interface_method_dispatch_helper (invocation=0x7f2058003190, method_call_func=0x7f206bd218d0 <_nmdbus_dispatcher_skeleton_handle_method_call>, interface=0x7f206c2442a0)
      at gdbusinterfaceskeleton.c:609
  #9  skeleton_intercept_handle_method_call (connection=<optimized out>, sender=sender@entry=0x7f205800ee50 ":1.1007", object_path=object_path@entry=0x7f20580108d0 "/org/freedesktop/nm_dispatcher",
      interface_name=interface_name@entry=0x7f2058010b20 "org.freedesktop.nm_dispatcher", method_name=method_name@entry=0x7f205800ab00 "Action", parameters=parameters@entry=0x7f205800af00,
      invocation=invocation@entry=0x7f2058003190, user_data=user_data@entry=0x7f206c2442a0) at gdbusinterfaceskeleton.c:650
  #10 0x00007f2069eb0bc1 in call_in_idle_cb (user_data=0x7f2058003190) at gdbusconnection.c:4873
  #11 0x00007f20696a279a in g_main_dispatch (context=0x7f206c23f9a0) at gmain.c:3109
  #12 g_main_context_dispatch (context=context@entry=0x7f206c23f9a0) at gmain.c:3708
  #13 0x00007f20696a2ae8 in g_main_context_iterate (context=0x7f206c23f9a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3779
  #14 0x00007f20696a2dba in g_main_loop_run (loop=0x7f206c23fa80) at gmain.c:3973
  #15 0x00007f206bd1dcd4 in main (argc=1, argv=0x7ffdfde6da88) at nm-dispatcher.c:948
  (gdb) print error_message
  $4 = 0x7f206bd22980 "Missing or invalid required value path!"
  (gdb)

callouts/nm-dispatcher.c

index c3ad499..eedc20d 100644 (file)
@@ -718,10 +718,6 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
        g_slist_free (sorted_scripts);
 
        _LOG_R_I (request, "new request (%u scripts)", request->scripts->len);
-       if (_LOG_R_D_enabled (request)) {
-               for (p = request->envp; *p; p++)
-                       _LOG_R_D (request, "environment: %s", *p);
-       }
 
        if (error_message || request->scripts->len == 0) {
                GVariant *results;
@@ -738,6 +734,11 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
                return TRUE;
        }
 
+       if (_LOG_R_D_enabled (request)) {
+               for (p = request->envp; *p; p++)
+                       _LOG_R_D (request, "environment: %s", *p);
+       }
+
        nm_clear_g_source (&quit_id);
 
        h->num_requests_pending++;