NetworkManager/src/nm-dispatcher
Thomas Haller dab2ee8ac5
all: suppress wrong gcc-12 warning "-Wdangling-pointer"
gcc-12.0.1-0.8.fc36 is annoying with false positives.
It's related to g_error() and its `for(;;) ;`.

For example:

    ../src/libnm-glib-aux/nm-shared-utils.c: In function 'nm_utils_parse_inaddr_bin_full':
    ../src/libnm-glib-aux/nm-shared-utils.c:1145:26: error: dangling pointer to 'error' may be used [-Werror=dangling-pointer=]
     1145 |                     error->message);
          |                          ^~
    /usr/include/glib-2.0/glib/gmessages.h:343:32: note: in definition of macro 'g_error'
      343 |                                __VA_ARGS__);         \
          |                                ^~~~~~~~~~~
    ../src/libnm-glib-aux/nm-shared-utils.c:1133:31: note: 'error' declared here
     1133 |         gs_free_error GError *error = NULL;
          |                               ^~~~~
    /usr/include/glib-2.0/glib/gmessages.h:341:25: error: dangling pointer to 'addrbin' may be used [-Werror=dangling-pointer=]
      341 |                         g_log (G_LOG_DOMAIN,         \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      342 |                                G_LOG_LEVEL_ERROR,    \
          |                                ~~~~~~~~~~~~~~~~~~~~~~~
      343 |                                __VA_ARGS__);         \
          |                                ~~~~~~~~~~~~
    ../src/libnm-glib-aux/nm-shared-utils.c:1141:13: note: in expansion of macro 'g_error'
     1141 |             g_error("unexpected assertion failure: could parse \"%s\" as %s, but not accepted by "
          |             ^~~~~~~
    ../src/libnm-glib-aux/nm-shared-utils.c:1112:14: note: 'addrbin' declared here
     1112 |     NMIPAddr addrbin;
          |              ^~~~~~~

I think the warning could potentially be useful and prevent real bugs.
So don't disable it altogether, but go through the effort to suppress it
at the places where it currently happens.

Note that NM_PRAGMA_WARNING_DISABLE_DANGLING_POINTER macro only expands
to suppressing the warning with __GNUC__ equal to 12. The purpose is to
only suppress the warning where we know we want to. Hopefully other gcc
versions don't have this problem.

I guess, we could also write a NM_COMPILER_WARNING() check in
"m4/compiler_options.m4", to disable the warning if we detect it. But
that seems too cumbersome.
2022-02-21 19:50:52 +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 format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00: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 format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00: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])