From 8f22b5738389cad3a9f3f054205ad0fedbda5b09 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Mon, 18 Sep 2017 18:04:59 +0100 Subject: [PATCH] loginctl: enable-linger does not need fallback to XDG_SESSION_ID To maintain consistency with `loginctl user-status`, drop the fallback to XDG_SESSION_ID for `loginctl enable-linger`. The fallback was unnecessary and also incorrect: it passed the numeric value of the session identifier as a UID value. --- src/login/loginctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 4948d2ee7..6fe70b714 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -1186,11 +1186,11 @@ static int enable_linger(int argc, char *argv[], void *userdata) { b = streq(argv[0], "enable-linger"); if (argc < 2) { - /* No argument? Let's either use $XDG_SESSION_ID (if specified), or an empty - * session name, in which case logind will try to guess our session. */ + /* No argument? Let's use an empty user name, + * then logind will use our user. */ short_argv[0] = argv[0]; - short_argv[1] = getenv("XDG_SESSION_ID") ?: (char*) ""; + short_argv[1] = (char*) ""; short_argv[2] = NULL; argv = short_argv; argc = 2; -- 2.30.2