Commit Graph

23 Commits

Author SHA1 Message Date
ab8dcfaa61 treewide: fix typos 2021-01-04 11:04:13 +01:00
32ee94c8a0 Add compatibility defines to allow compiling with older glib
We need at least the GFlagsClass autoptr, but just pull in most of the
definitions from libfprint.
2020-12-14 11:30:45 +01:00
f73429f062 fprintd: Reindent the source code following uncrustify rules 2020-12-07 18:41:45 +01:00
a38917ab26 fprintd: Re-order permissions table by priority and add docs
Given that we could do operations where at least one permission, is
requested, we should give more priority to the weaker ones that are
acceptable and in case raise the level at later points.
2020-12-05 01:01:36 +01:00
4e707f0d31 manager: Use GEnum to register DBus errors from FprintError
Given that mk_genenum already parses FprintError, add the nick metadata
to the errors so that it matches the wanted DBus error and automatically
generate the errors list.

In this way we'll have to only touch one definition to get everything
updated
2020-11-10 14:45:59 +01:00
4c78012103 device: Use meson to generate fprint device permission flags 2020-11-10 14:45:59 +01:00
93bad82540 fprintd: Use GDBus codegen based implementation
Fprintd is dependent on the deprecated dbus-glib, also this doesn't provide
various features we can take advantage of, like the ones for async
authentication mechanism.

So, remove all the dbus-glib dependencies and simplify the code, but without
any further refactor, and keeping everything as it used to work, while this
will give room for further improvements in subsequent commits.

Internally, we just use dbus-codegen to generate the skeletons, and we
use the generated FprintdDBusManager with composition, while we
implement the device skeleton interface in FprintDevice, so that we
don't have to use it as a proxy, and keep being closer to what it used
to be with dbus-glib.

Fixes: #61
2020-11-10 14:45:59 +01:00
130d6cdb63 main: Move fprintd_dbus_conn declaration to main.c
There's no need to declare it as extern in the header as it is already
declared in the source files where it's used.

Fixes:
../src/device.c:51:25: error: redundant redeclaration of ‘fprintd_dbus_conn’ [-Werror=redundant-decls]
  51 | extern DBusGConnection *fprintd_dbus_conn;
     |                         ^~~~~~~~~~~~~~~~~
In file included from ../src/device.c:34:
../src/fprintd.h:29:25: note: previous declaration of ‘fprintd_dbus_conn’ was here
  29 | extern DBusGConnection *fprintd_dbus_conn;
     |                         ^~~~~~~~~~~~~~~~~
2020-02-05 15:25:35 +01:00
cc4bac3410 main: Use G_DECLARE_FINAL_TYPE to define objet 2020-02-04 14:19:41 +01:00
b99afd19f0 main: Use #pragma once 2020-01-23 18:25:18 +01:00
ce3406b20f main: Fix typos in comments 2020-01-14 14:00:56 +01:00
d7821aa790 Initial port to libfprint2 2019-12-03 17:08:03 +01:00
69e987b335 Fix return value for GetDefaultDevice
Tell the front-end there's no devices available when there isn't
any, instead of erroring out.
2008-12-04 13:23:50 +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
1abf51afa4 Don't crash the server if there's no devices
Big ninny just crashed because there's no fingerprint readers. Hoo,
hoo. My eyes are bleeding.
2008-11-24 17:20:46 +00:00
9743d9d2a0 Register errors with D-Bus
So we get errors like:
net.reactivated.Fprint.Error.DiscoverPrints
instead of:
org.freedesktop.DBus.GLib.UnmappedError.FprintdErrorQuark.Code2
2008-11-24 17:20:46 +00:00
3cd0a7aeaf First pass at adding API docs through gtk-doc
Required a bit of mangling.
2008-11-21 18:15:51 +00:00
b0f2060628 Exit when no devices are in use
When no actions are happening on any of the devices, make the
daemon exit after 30 seconds.
2008-11-03 22:56:12 +00: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
3a0152e124 Fix _get_error() in the manager
Fix wrong assumption of semantics when fp_discover_devs()
returns NULL.
2008-05-16 12:17:48 +01:00
017f770480 Clean up object creation code
Make all of FPrintManager's struct members private,
warn of errors using a _get_error() function, as object
creation can never fail.

The only error possible shouldn't really be an error though,
as it only means that no devices will be enumerated, but it
could tell us about newly plugged devices instead.
2008-05-14 16:07:25 +01:00
fc6b0c194c Add enrollment functionality 2008-03-06 16:37:19 +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