NetworkManager/src/nm-dispatcher
Beniamino Galvani e5c2c5f1c2 nm-dispatcher: fix crash when parsing output dictionary
'stdout' is NULL when the script didn't write anything or failed.

Fixes the following crash detected by NMCI in test
'dispatcher_device_handler_dummy'.

  nm-dispatcher[936339]: g_strsplit: assertion 'string != NULL' failed

  build_result_options (nm-dispatcher)
  complete_request (nm-dispatcher)
  complete_script (nm-dispatcher)
  script_watch_cb (nm-dispatcher)
  g_child_watch_dispatch (libglib-2.0.so.0)
  g_main_dispatch (libglib-2.0.so.0)
  g_main_context_iterate (libglib-2.0.so.0)
  g_main_context_iteration (libglib-2.0.so.0)
  main (nm-dispatcher)
  __libc_start_main (libc.so.6)
  _start (nm-dispatcher)

Fixes: d72f26b875 ('dispatcher: read device-handler's stdout into a dictionary')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1889
2024-03-20 09:31:44 +01:00
..
tests all: suppress wrong gcc-12 warning "-Wdangling-pointer" 2022-02-21 19:50:52 +01:00
meson.build build: fix linking libnm-log-null into different test programs 2021-07-05 14:51:27 +02:00
nm-dispatcher-utils.c dispatcher: pass user setting properties in the environment 2024-02-21 11:49:11 +01:00
nm-dispatcher-utils.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-dispatcher.c nm-dispatcher: fix crash when parsing output dictionary 2024-03-20 09:31:44 +01:00
nm-dispatcher.conf build: move "dispatcher/" to "src/nm-dispatcher/" 2021-02-28 18:56:09 +01:00
nm-dispatcher.xml build: move "dispatcher/" to "src/nm-dispatcher/" 2021-02-28 18:56:09 +01:00
org.freedesktop.nm_dispatcher.service.in build: move "dispatcher/" to "src/nm-dispatcher/" 2021-02-28 18:56:09 +01:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00

nm-dispatcher

Runs as a D-Bus activated, exit-on-idle service to execute user scripts (dispatcher scripts) on certain events.

The user does not directly configure this service, it gets controlled by NetworkManager. However, the user (or other applications) would place scripts in certain directories for the dispatcher service to execute them.

The systemd service is called NetworkManager-dispatcher.service.

See:

  • man 8 NetworkManager-dispatcher ([www])