Commit Graph

41 Commits

Author SHA1 Message Date
24fefbe332 Port to PolicyKit 1.0
See https://bugzilla.redhat.com/show_bug.cgi?id=498368
and
https://fedoraproject.org/wiki/Features/PolicyKitOne
2010-08-16 19:33:01 +01:00
4ea1c48f9f Detect when a device is disconnected
Pretty hacky way to detect whether the device we're handling has
been disconnected during a verify or enrollment. This should allow
us to avoid users having to wait when somebody pulls the plug.
2009-01-27 16:45:47 -03:00
6a480f409d Stop extra signals from being emitted
Some devices keep sending us signals when an enrollment or
verification finished. Ignore all those signals, we hate them.
2008-12-04 13:23:51 +00:00
64e415aaac Fix memleak on VerifyStart
Clean up the data pass to the async verification and identification
functions ourselves.
2008-11-24 17:20:46 +00:00
7b06c4b7f3 Review possible errors and document them
Review all the possible errors and document them for each function.
2008-11-24 17:20:46 +00:00
c9fdeb47aa Use D-Bus properties instead of GetProperties
- Use D-Bus native properties instead of a GetProperties call.
- Fix a number of front-ends by registering the right signals and
marshallers following the "done" signal argument addition
- Fix VerifyStart call in the pam module
2008-11-22 13:00:48 +00:00
26aab5dc28 Add a done argument to result signals
For verify and enroll, add a done argument so that front-end
know easily when they should be closing the device.
2008-11-21 18:15:51 +00:00
874d8164b4 Add ScanType and NumberEnrollStages properties
Export the type of scan the device performs, and, when the device
is claimed, the number of enrollment stages.
2008-11-21 18:15:50 +00:00
f7186c7ff0 Remove all uses of enums in the API
The clients aren't supposed to know the magic numbers for enums,
so use strings instead.
2008-11-21 18:15:50 +00:00
1e43720c15 Remove use of finger number in the API
Use well-defined strings instead of numbers to pass around
specific fingers in the public API.
2008-11-21 18:15:21 +00:00
ea4114b976 Make GetProperties async
as the rest of our functions.
2008-11-21 18:15:21 +00:00
924e08d2e8 Add device name property
Add GetProperties method, with a single "Name" properties into
the hashtable.
Use the device name property in the PAM module, and in the list test.
2008-11-21 18:15:21 +00:00
69c131f723 Add gross hack to allow root to verify users
This is a gross hack for PAM sessions to work as expected. root
is allowed to verify any users. If you want to allow any other
actions for root, you'll need to go through normal PolicyKit
procedures.

This should fix fingerprint authentication not working in GDM, or
on the console.
2008-11-21 18:14:09 +00:00
f93d8cbce2 Clean up device when the client disconnects
Track clients connected to each device using EggDbusMonitor.
When there are no more clients connected to the device, release it.

When no devices are used anymore, set up a timeout to exit within
30 seconds.
2008-11-03 22:56:12 +00:00
e29806cd88 Add an action property
Add an action property and notify listeners when the action changes.
2008-11-03 22:56:12 +00:00
f43ea8f095 Add an enrollment action
Return an error if an enrollment is already in progress.
2008-11-03 22:56:12 +00:00
5f3e1be27f Track current action
Track the current action happening in the device, so we can
see what each device is doing. Refuse to launch a verification if
there's already one in progress.
2008-11-03 22:56:12 +00:00
09852db6ee Always emit VerifyFingerSelected
If the finger passed for verification is -1, always emit the
VerifyFingerSelected signal, as the front-end isn't to know
whether we're using identification or verification.
2008-11-02 11:16:59 +00:00
0a075532c7 Fix another error path
More to do though...
2008-11-02 11:16:59 +00:00
15fbacd738 More identification work
- Add a finger selected signal, so that when an "automatic" finger
  is selected for verification, we know which one to scan
- Fix the finger print numbers list to use GPOINTER_TO_INT /
  GINT_TO_POINTER
- Make sure the gallery is NULL when there's no prints available
- Don't use identification when a finger number is provided
- Add support for selecting the finger number in verify
- Add support for fatal warnings there as well
2008-11-02 11:16:13 +00:00
ee874bb1d4 Add identify support
Passing -1 to the VerifyStart function will either accept any
fingers scanned, if the driver supports identification, or select
the first enrolled fingerprint for scanning if it doesn't.
2008-11-02 11:16:13 +00:00
974e022c4d Debug output cleanup
Remove a few debug messages, and merge another one.
2008-11-02 11:16:13 +00:00
e8c36e9592 Rework the "SetUsername" functionality
- Remove SetUsername itself, and add a username parameter to DeviceClaim,
  ListEnrolledFingers and DeleteEnrolledFingers.
- For each of those calls, check that the incoming connection is allowed
  to operate on that particular username
- Don't require a claimed device to list or remove fingerprints
- Clean up username and sender when releasing the device
- Modify the storage backend to not require an opened device to list
  or delete fingerprints
- Add a simple test program to list registered fingerprints for the
  usernames passed as argument
2008-11-02 11:16:13 +00:00
bd2debc01e Update storage code to allow plugins
Add naive plugin support to the storage code, it will
load plugins from $(libdir)/fprintd/modules, given the configuration
from /etc/fprintd.conf.
2008-11-02 11:16:13 +00:00
c738aa334d Fix PolicyKit action for deleting fingerprints
We can only delete fingerprints if we could enroll them
in the first place.
2008-11-02 11:16:13 +00:00
af42db88bf Add DeleteEnrolledFingers
To delete all the enrolled finger prints for a particular user.
We can already overwrite existing enrolled fingerprints, and there's
not really any point in dismissing just one fingerprint.
2008-11-02 11:16:13 +00:00
bb1210981b Kill LoadPrintData and UnloadPrintData
They were just doing nothing interesting for us, and might
cause problems if data changes under us (say, remote storage).
2008-11-02 11:16:13 +00:00
46a9783be6 Add PolicyKit checking
Add PolicyKit checks to all the public functions, grouped
in 2 main groups: Verify and Enroll
By default, only the user is able to enroll new fingers,
or verify themselves.
You need to be allowed at least one of those 2 actions
to be allowed to claim or release the device.

We also add a new SetUsername function, for administration
functions. Users will need to be authenticate as admins to
be allowed to change the username on which the actions will
be taken. Any prints loaded before the change of username will
be unloaded.
2008-05-22 17:56:25 +01:00
61a2266e52 Start of PolicyKit support
Get a PolicyKit context per-device, set up its main loop,
and steal more code from gnome-panel to check whether
the actions are allowed for a particular caller.
2008-05-22 17:56:25 +01:00
5e194488e7 The user that claims the device is the one we work on
When the user claims the device, get its uid and username,
and use this data to read/save from storage.
2008-05-22 17:55:16 +01:00
8529a43b0d Save using storage
Save the fingerprint using the storage functions so we
can verify the data we enroll.
2008-05-22 17:55:16 +01:00
b1b5e2b495 Kill ListEnrolledFingersFromStorage
Last FromStorage variant killed, we need to make sure all
the functions now use the storage functions internally,
otherwise we won't be able to load from the place we save.
2008-05-22 17:55:16 +01:00
5d4e23ab32 Kill LoadPrintDataFromStorage
First FromStorage variant to go
2008-05-22 17:55:15 +01:00
7f592dd2e4 Fix return values for async methods
Async methods should return "out" variables using dbus_g_method_return(),
not through function parameters. Fixes crashing using those functions.
2008-05-22 17:55:15 +01:00
c63f624a26 Async methods return void
Thanks to Richard Hughes for spotting this. Shouldn't
make any operational differences, as the return values
of those methods weren't used anyway.
2008-05-22 17:55:15 +01:00
1748e5f484 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
2008-05-18 12:41:05 +01:00
1919ca75f2 Use GObject-provided boilerplate
Clean up the device object by using G_DEFINE_TYPE
2008-05-14 16:07:32 +01:00
1f54a0c363 Initial storage implementation
[dsd: changed from /etc/fprint to /var/lib/fprint]
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2008-04-06 23:49:28 +01:00
fc6b0c194c Add enrollment functionality 2008-03-06 16:37:19 +00:00
3e68c40e4e Present verify results with a signal 2008-03-06 13:12:34 +00:00
080e427651 Move to object oriented model
There is now a single Manager class shared between all apps.
Apps then share a collection of Device objects.
2008-03-05 23:52:33 +00:00