chiark / gitweb /
logind: check whether first drmSetMaster succeeded
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 1 Oct 2013 15:53:43 +0000 (17:53 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 1 Oct 2013 15:53:43 +0000 (17:53 +0200)
commitc2e5d024a380bae6ead301fb4f40787b372ec3e0
treeef7ecb86df3823a6996dbecea97c6344fe03a34c
parent081dfa852fc5cd183a20747f2d8e4ef62d29d181
logind: check whether first drmSetMaster succeeded

The initial drmSetMaster may fail if there is an active master already. We
must not assume that all existing clients comply to logind rules. We check
for this during session-activation already but didn't during device setup.
Fix this by checking the return code.

As drmSetMaster has had horrible return codes in the past (0 for failure?
EINVAL for denied access, ..) we need to be quite pedantic. To guarantee
an open file-descriptor we need to close the device and reopen it without
master if setting master failed first.
src/login/logind-session-device.c