Add user tracking when claiming a device

Mark all the methods on the device as async, so we
can get access to the associated DBusGMethodInvocation.

When claiming the device, remember the sender, and for every
API entry point, check that the sender is the same as the one
that made the original claim.

Trying to enroll a user whilst the device is already claimed
from another program will fail with:
** ERROR **: failed to claim device: Device was already claimed

This is the first step towards PolicyKit and multi-user support
This commit is contained in:
Bastien Nocera
2008-05-16 17:24:45 +01:00
committed by Daniel Drake
parent 039c988f4b
commit 1748e5f484
4 changed files with 194 additions and 29 deletions

View File

@ -32,6 +32,7 @@ GQuark fprint_error_quark(void);
#define FPRINT_ERROR fprint_error_quark()
typedef enum {
FPRINT_ERROR_INTERNAL,
FPRINT_ERROR_ALREADY_IN_USE,
FPRINT_ERROR_DISCOVER_PRINTS,
FPRINT_ERROR_PRINT_NOT_FOUND,
FPRINT_ERROR_PRINT_LOAD,