1 --- NetworkManager-1.8.0/configure.ac.orig 2017-05-27 22:30:22.001467624 +0200
2 +++ NetworkManager-1.8.0/configure.ac 2017-05-27 22:57:15.061449204 +0200
6 if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then
7 - PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])])
8 + PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-daemon libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])])
10 have_systemd_logind=no
12 --- NetworkManager-1.34.0/src/core/nm-session-monitor.c.orig 2022-01-13 15:49:26.000000000 +0100
13 +++ NetworkManager-1.34.0/src/core/nm-session-monitor.c 2022-01-13 20:47:31.545775434 +0100
17 #if SESSION_TRACKING_SYSTEMD
18 +#include <systemd/sd-daemon.h>
19 #include <systemd/sd-login.h>
20 #define LOGIND_NAME "systemd-logind"
22 @@ -52,13 +53,11 @@ struct _NMSessionMonitor {
26 -#if SESSION_TRACKING_CONSOLEKIT
28 GFileMonitor *monitor;
35 struct _NMSessionMonitorClass {
36 @@ -136,7 +135,6 @@ st_sd_finalize(NMSessionMonitor *monitor
38 /*****************************************************************************/
40 -#if SESSION_TRACKING_CONSOLEKIT
44 @@ -269,7 +267,6 @@ ck_finalize(NMSessionMonitor *monitor)
45 nm_clear_pointer(&monitor->ck.cache, g_hash_table_unref);
46 g_clear_object(&monitor->ck.monitor);
48 -#endif /* SESSION_TRACKING_CONSOLEKIT */
50 /*****************************************************************************/
52 @@ -295,14 +292,15 @@ nm_session_monitor_session_exists(NMSess
53 g_return_val_if_fail(NM_IS_SESSION_MONITOR(self), FALSE);
55 #if SESSION_TRACKING_XLOGIND
56 + if (sd_booted() > 0) {
57 if (st_sd_session_exists(self, uid, active))
62 -#if SESSION_TRACKING_CONSOLEKIT
64 if (ck_session_exists(self, uid, active))
71 @@ -313,26 +311,28 @@ static void
72 nm_session_monitor_init(NMSessionMonitor *monitor)
74 #if SESSION_TRACKING_XLOGIND
75 + if (sd_booted() > 0) {
77 _LOGD("using " LOGIND_NAME " session tracking");
81 -#if SESSION_TRACKING_CONSOLEKIT
84 _LOGD("using ConsoleKit session tracking");
90 finalize(GObject *object)
92 #if SESSION_TRACKING_XLOGIND
93 + if (sd_booted() > 0)
94 st_sd_finalize(NM_SESSION_MONITOR(object));
98 -#if SESSION_TRACKING_CONSOLEKIT
99 ck_finalize(NM_SESSION_MONITOR(object));
102 G_OBJECT_CLASS(nm_session_monitor_parent_class)->finalize(object);
104 --- NetworkManager-1.48.0/src/core/nm-power-monitor.c.orig 2024-05-31 13:23:57.000000000 +0200
105 +++ NetworkManager-1.48.0/src/core/nm-power-monitor.c 2024-06-01 08:21:35.884268446 +0200
107 #include <sys/stat.h>
108 #include <gio/gunixfdlist.h>
110 +#ifdef SUSPEND_RESUME_SYSTEMD
111 +# include <systemd/sd-daemon.h>
114 #include "libnm-glib-aux/nm-dbus-aux.h"
115 #include "libnm-core-intern/nm-core-internal.h"
116 #include "NetworkManagerUtils.h"
118 #if defined(SUSPEND_RESUME_SYSTEMD) || defined(SUSPEND_RESUME_ELOGIND)
120 -#define SUSPEND_DBUS_NAME "org.freedesktop.login1"
121 -#define SUSPEND_DBUS_PATH "/org/freedesktop/login1"
122 -#define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
123 +#define SD_SUSPEND_DBUS_NAME "org.freedesktop.login1"
124 +#define SD_SUSPEND_DBUS_PATH "/org/freedesktop/login1"
125 +#define SD_SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
126 #if defined(SUSPEND_RESUME_SYSTEMD)
127 #define _NMLOG_PREFIX_NAME "power-monitor-sd"
131 #elif defined(SUSPEND_RESUME_CONSOLEKIT)
135 +#if defined (SUSPEND_RESUME_SYSTEMD) || defined (SUSPEND_RESUME_ELOGIND) || defined(SUSPEND_RESUME_CONSOLEKIT)
137 /* ConsoleKit2 has added the same suspend/resume DBUS API that Systemd
138 * uses. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit
140 @@ -292,6 +300,20 @@ nm_power_monitor_init(NMPowerMonitor *se
142 self->inhibit_fd = -1;
143 self->cancellable = g_cancellable_new();
144 +#ifdef SUSPEND_RESUME_SYSTEMD
145 + if (sd_booted() > 0)
146 + g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM,
147 + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
148 + | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
150 + SD_SUSPEND_DBUS_NAME,
151 + SD_SUSPEND_DBUS_PATH,
152 + SD_SUSPEND_DBUS_INTERFACE,
154 + (GAsyncReadyCallback) on_proxy_acquired,
158 g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM,
159 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
160 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,