[gnome-shell/benzea/fix-sd-notify] main: Remove NOTIFY_SOCKET from environment



commit 076f545fb0ad04208cacc06630865a74af46276d
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Sep 23 11:04:18 2019 +0200

    main: Remove NOTIFY_SOCKET from environment
    
    It is only used exactly once to notify systemd about the service
    startup. So unset it as soon as possible as it can leak into
    subprocesses we spawn otherwise.

 src/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/main.c b/src/main.c
index 8be1395f70..489026b765 100644
--- a/src/main.c
+++ b/src/main.c
@@ -532,7 +532,9 @@ main (int argc, char **argv)
   shell_init_debug (g_getenv ("SHELL_DEBUG"));
 
   shell_dbus_init (meta_get_replace_current_wm ());
-  sd_notify (0, "READY=1");
+  /* We only use NOTIFY_SOCKET exactly once; unset it so it doesn't remain in
+   * our environment. */
+  sd_notify (1, "READY=1");
   shell_a11y_init ();
   shell_perf_log_init ();
   shell_introspection_init ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]