diff options
author | Alan Jenkins <alan.christopher.jenkins@gmail.com> | 2017-09-18 18:04:59 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-09-18 18:04:59 +0100 |
commit | 8f22b5738389cad3a9f3f054205ad0fedbda5b09 (patch) | |
tree | 6adbec4b6d72c3bce981632ca8ca420d5a56ea45 /src | |
parent | 813ee46c0ec85d7d93687b3660a4f4885c43ceae (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/login/loginctl.c | 6 |
1 files 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; |