chiark / gitweb /
logind: nicer error message when we cannot guess the caller's session
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Jun 2017 02:10:15 +0000 (22:10 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
Partial fix for #6032.

src/login/logind-dbus.c

index f22859c..70d2b1f 100644 (file)
@@ -69,6 +69,9 @@ int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const ch
                         return r;
 
                 r = sd_bus_creds_get_session(creds, &name);
+                if (r == -ENXIO)
+                        return sd_bus_error_setf(error, BUS_ERROR_NO_SESSION_FOR_PID,
+                                                 "Caller does not belong to any known session");
                 if (r < 0)
                         return r;
         }