Commit graph

30 commits

Author SHA1 Message Date
Mohammed Anas
84023f525a Bump minimum glib dependency version to 2.64
As per this apply the patch that applied on the generated code
2024-08-30 05:25:48 +02:00
Marco Trevisan (Treviño)
3a05589685 utils/delete: Add ability to delete single user fingerprints by finger name
Each user can now be followed by an `-f`/`--finger` parameter that when
available will be used to delete a single fingerprint for the user.

Add tests
2021-03-03 19:51:07 +01:00
Marco Trevisan (Treviño)
8485985ed3 delete: Use GOptionContext to handle help 2021-03-03 19:50:44 +01:00
Marco Trevisan (Treviño)
8d14af379f utils/verify: Terminate with EXIT_FAILURE when enrollment failed 2021-03-03 19:49:07 +01:00
Marco Trevisan (Treviño)
9a13293818 utils/enroll: Terminate with EXIT_FAILURE when enrollment failed 2021-03-03 19:49:07 +01:00
Marco Trevisan (Treviño)
c66d5d0fa6 utils/enroll: Fix typo on error 2021-03-03 19:49:07 +01:00
Marco Trevisan (Treviño)
4b246d3ce2 utils/delete: Use proper error string on deletion 2021-03-03 19:49:07 +01:00
Benjamin Berg
de725a91e4 verify: Print message about verification start from callback
It seems that GLib may process multiple DBus signals in one mainloop
iteration. This could cause messages to be re-ordered, which in turn
caused a race condition in the CI that could trigger random failures.
2020-12-11 16:00:28 +01:00
Marco Trevisan (Treviño)
f73429f062 fprintd: Reindent the source code following uncrustify rules 2020-12-07 18:41:45 +01:00
Benjamin Berg
2d98d4543f verify: Add print about start for tests
This allows properly reading the output only to the point where we can
ensure that verification has started.
2020-12-07 15:27:14 +01:00
Benjamin Berg
eb73e024e1 utils: Fix race in verify accepting unrelated signals
Signals like VerifyResult may be received from unrelated Verify
operations. To avoid races, we need to ignore any VerifyResult that
happenes before the DBus method returns.

The only way to do this race-free is to use the async version of the
VerifyStart method.
2020-12-07 15:27:14 +01:00
Marco Trevisan (Treviño)
38ba7199b7 utils: Use auto-pointers 2020-11-13 13:32:51 +01:00
Marco Trevisan (Treviño)
827baff301 enroll: Cleanup error with autoptr 2020-11-13 13:32:51 +01:00
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
ecc02cb588 utils: Uniform the no-devices error messages removing duplicated checks
Use error messages to be consistent, and avoid checking for a returned
value when dbus-glib function to fetch it returned false, as it's
implicit that we had a failure.

Otherwise if didn't fail we are sure that we got the requested value.
2020-11-04 21:06:13 +01:00
Marco Trevisan (Treviño)
f6eb3b3ea5 verify: Pass the "any" finger parameter to the daemon
fprintd supports "any" finger parameter for the VerifyStart call, and it's
up to the daemon to pick the first known if the device doesn't support
identification.

So remove the check to verify utility and add a test to verify this is
respected.
2020-11-04 21:06:13 +01:00
Marco Trevisan (Treviño)
5a703baa20 verify: Fail if we try to verify a non-enrolled finger
Since we list the fingers available fail early in case it's not found
2020-11-04 21:06:10 +01:00
Bastien Nocera
812a3552a6 build: Fix custom_target meson warning
WARNING: custom_target 'utils_marshal' has more than one output! Using the first one.
2020-08-17 16:14:25 +02:00
Marco Trevisan (Treviño)
554df2a8d9 utils: Fix memory leak when error is ignored in list
If we get a `NoEnrolledPrints` error while list, we don't consider it an
hard error and in such case we proceed to releasing the device, but without
clearing the previously set error first.
2020-02-14 16:00:20 +01:00
Marco Trevisan (Treviño)
1ecae1d014 delete: Clear the error in case we ignore it
If we get a `NoEnrolledPrints` error during delete, we don't consider it an
hard error and in such case we proceed to releasing the device, but without
clearing the previously set error first.
2020-02-14 15:55:09 +01:00
Bastien Nocera
73625233f6 build: Remove autotools support 2020-02-05 16:54:54 +01:00
Marco Trevisan (Treviño)
e10417a907 verify: Constify username
utils/verify.c:191:12: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
191 |   username = "";
    |            ^
2020-02-05 15:25:35 +01:00
Marco Trevisan (Treviño)
8f75563920 enroll: Fix usernames memory leak
usernames was not freed on exit.
2020-02-05 15:25:35 +01:00
Marco Trevisan (Treviño)
2e00c7a4b1 enroll: Always use allocated memory for finger name
Given that finger_name is set by GOptionEntry, make sure it's always
using allocated memory.

../utils/enroll.c:38:28: error: initialization discards ‘const’ qualifier
  from pointer target type [-Werror=discarded-qualifiers]
38 | static char *finger_name = "right-index-finger";
   |                            ^~~~~~~~~~~~~~~~~~~~
2020-02-05 15:25:35 +01:00
Marco Trevisan (Treviño)
eb6dbb6953 build: Add meson build system
Reuse the generated dbus interface .xml files from fprintd to avoid
unnecessary copies.
2020-02-05 15:25:35 +01:00
Bastien Nocera
c6e72c5f28 pam: Add include for asprintf to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
b690daa95f all: Call setlocale() at the start of main()
This fixes some broken characters in the fprintd debug output.
2020-01-14 13:51:46 +01:00
Bastien Nocera
d0df422f9b all: Bump required glib version
Require the same version of glib as libfprint, and remove support for
very old versions.
2019-12-18 17:03:37 +01:00
Benjamin Berg
882740f8a1 utils: Use new print deletion API
Use the new API that works by claiming the device and then deleting the
prints.

Fixes: #26
2019-12-05 17:54:21 +01:00
Benjamin Berg
3db69c2c2f utils: Move test binaries into utils
These utilities are generally useful beyond only testing purproses. And,
since it is desirable to have automated tests inside the tests
subdirecty, it makes sense to move them elsewhere.
2019-12-03 17:08:03 +01:00