]> git.ipfire.org Git - thirdparty/systemd.git/commit
logind: remove an obscure dbus error from GetSessionByPID(0) and friends
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Sat, 7 Oct 2017 11:24:02 +0000 (12:24 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 14 Nov 2017 18:12:42 +0000 (18:12 +0000)
commitaeb075704b5e2ae4757da69ca8d6eda0235d327d
treeee50ede35e28dae8160846d81964a2c7e04ab4ce
parent8d9c2bca41b03fd113edd2fe66dd88c3894debd3
logind: remove an obscure dbus error from GetSessionByPID(0) and friends

GetSessionByPID(0) can fail with NO_SESSION_FOR_PID.  More obscurely, if
the session is abandoned, it can return NO_SUCH_SESSION.  It is not clear
that the latter was intended.  The message associated with the former,
hints that this was overlooked.

We don't have a document enumerating the errors.  Any specific
error-handling in client code, e.g. translated messages, would also be
liable to overlook the more obscure error code.

I can't see any equivalent condition for GetUserByPID(0).  On the other
hand, the code did not return NO_USER_FOR_PID where it probably should.
The relevant code is right next to that for GetSessionByPID(0), so it will
be simpler to understand if both follow the same pattern.
src/login/logind-dbus.c