Commit graph

327 commits

Author SHA1 Message Date
Bastien Nocera
3624bcb114 data: Fix copy/paste error in fprintd-verify's man page 2020-01-24 17:03:43 +01:00
Bastien Nocera
8fbc59a258 pam: Allow unloading libs that pam_fprintd is linked to
Remove "nodelete" linker flag now that we use sd-bus and not dbus-glib,
so that libraries that pam_fprintd links to can be unloaded.

This was added because GLib's type system expects to be initialised
once and only once per process, and re-loading this type system when it
had already been initialised caused crashes.
2020-01-24 17:03:43 +01:00
Bastien Nocera
5a8da0022a tests: Make warnings fatal in PAM tests
This will catch problems with GLib being unloaded when the PAM module is
unloaded, which would have crashed when using dbus-glib.

This serves as a test for https://gitlab.freedesktop.org/libfprint/fprintd/issues/2

Closes: #2
2020-01-24 17:03:32 +01:00
Bastien Nocera
6089ba6f40 pam: Better debug when timeout is invalid 2020-01-24 00:51:13 +01:00
Bastien Nocera
ee6e8a6fa3 pam: Better debug when max_tries option is invalid 2020-01-24 00:51:13 +01:00
Bastien Nocera
42f5280a03 pam: Better debug arguments support
Support debug=[on|off|true|false|1|0] as an option in addition to
"debug".
2020-01-24 00:51:13 +01:00
Bastien Nocera
affffaf134 pam: Return PAM_MAXTRIES after too many tries 2020-01-24 00:51:13 +01:00
Bastien Nocera
6ab270fb1a tests: Reduce the default timeout in tests 2020-01-24 00:51:13 +01:00
Bastien Nocera
2d0bed6b13 tests: Add PAM timeout test 2020-01-24 00:51:13 +01:00
Bastien Nocera
c43134e36f tests: Add PAM test with 2 readers 2020-01-24 00:51:13 +01:00
Bastien Nocera
b9d23ddb87 tests: Fix dbusmock template when adding > 1 reader 2020-01-24 00:51:13 +01:00
Bastien Nocera
205dedae4f tests: Add dbus-monitor'ing to PAM tests
Should prove useful debugging the PAM module if we need it.
2020-01-24 00:51:13 +01:00
Bastien Nocera
d70f15b5e8 pam: Port to sd-bus
This pam plugin never used GDBus because it transparently uses threads
which do not work well with a lot of PAM applications. But even settling
on the "still better to use than plain dbus library" dbus-glib wasn't
without problems, as any use or initialisation of GIO sockets would
modify signal handler for signals such as SIGPIPE (see gio/gsocket.c).

Many years later, sd-bus is a more modern alternative to the bare dbus
library with a better API.

This includes:
- Removing use of gboolean, guint, g_new0() and many glib string helpers
- Simplifying debug logging
- Marking user-facing messages to be translated
2020-01-24 00:51:13 +01:00
Bastien Nocera
6f63beb1fc pam: Add str_has_prefix() helper
To simplify the options parsing.
2020-01-23 18:45:43 +01:00
Bastien Nocera
f7557c6ee7 pam: Add monotonic clock helper 2020-01-23 18:45:43 +01:00
Bastien Nocera
0b598965b0 pam: Remove GLib usage from copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
8325d347d6 pam: Add str_equal() helper to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
0bdf801043 pam: Add helper to replace G_GNUC_UNUSED to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
6e3b053372 pam: Add include for bool to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
c6e72c5f28 pam: Add include for asprintf to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
986a42bcd1 pam: Update copyright notice 2020-01-23 18:45:43 +01:00
Bastien Nocera
0c6bab8640 main: Fix redeclaration linking error
Fix linking error as the "store" global variable gets redeclared in
each C file that includes the header. Move the actual declaration to
main.c.

Fixes:
 /usr/bin/ld: ./.libs/libfprintd.a(device.o):/builds/libfprint/fprintd/src/storage.h:51: multiple definition of `store'; main.o:/builds/libfprint/fprintd/src/storage.h:51: first defined here
2020-01-23 18:25:25 +01:00
Bastien Nocera
b99afd19f0 main: Use #pragma once 2020-01-23 18:25:18 +01:00
Bastien Nocera
3d6dfabd8d Revert "ci: Temporarily add newer pam_wrapper build"
This reverts commit db0ab55bef.
2020-01-23 18:25:14 +01:00
Marco Trevisan (Treviño)
67adcb59ed configure.ac: Depend on libfprint-2
libfprint changed SONAME to completely break with previous version, so
update fprintd dependency accordingly.
2020-01-23 18:24:53 +01:00
Bastien Nocera
db0ab55bef ci: Temporarily add newer pam_wrapper build
So that the test suite can pass.
2020-01-22 15:34:02 +01:00
Bastien Nocera
00b79d1a2f tests: Add test for the PAM module
Test the PAM module using pam_wrapper and our mock fprintd.

See https://lwn.net/Articles/671094/

Note that this requires a version of pam_wrapper with this bug fixed:
https://bugzilla.samba.org/show_bug.cgi?id=14245
2020-01-22 15:34:02 +01:00
Bastien Nocera
f1517af09a tests: Add fprintd-verify test that uses scripting 2020-01-20 17:31:46 +01:00
Bastien Nocera
c0bf1515fd tests: Check that verify test doesn't succeed early 2020-01-20 17:31:08 +01:00
Bastien Nocera
872089883c tests: Add scripting capabilities to the verification process
Add scripting capabilities to the verification process so that the mock
daemon can send its own results without needing the client to prod it to
do that. This is incredibly useful when the client is single threaded
and blocking.

Note that there are barely any safeguards, so the scripting task is not
cancelled if an error occurs, or the VerifyStatus signals are sent out
of order.
2020-01-20 17:26:24 +01:00
Bastien Nocera
431755becd tests: Add test for fprintd utils 2020-01-17 15:32:22 +01:00
Bastien Nocera
0a42b90390 tests: Add dbusmock template for fprintd daemon 2020-01-17 15:18:43 +01:00
Bastien Nocera
cd3ed2e450 device: Fix documentation for ERROR_INVALID_FINGERNAME 2020-01-17 14:41:22 +01:00
Bastien Nocera
c929d39df1 device: Fix "enrollemnt" typo 2020-01-17 14:40:36 +01:00
Bastien Nocera
1a5ef6c5a7 build: Add separate dependency for pam module 2020-01-14 15:52:21 +01:00
Bastien Nocera
ce3406b20f main: Fix typos in comments 2020-01-14 14:00:56 +01:00
Bastien Nocera
0d407db171 manager: Fix typo in comment 2020-01-14 14:00:56 +01:00
Bastien Nocera
4eb751a218 data: Fix typos in man pages 2020-01-14 14:00:56 +01:00
Bastien Nocera
0f44267ea1 README.transifex: Fix typo 2020-01-14 14:00:56 +01:00
Bastien Nocera
9baea4494b device: Replace deprecated g_type_class_add_private() 2020-01-14 14:00:56 +01:00
Bastien Nocera
41afbd1ced device: Simplify FprintDevicePrivate declaration 2020-01-14 14:00:56 +01:00
Bastien Nocera
f2d6921b74 manager: Replace deprecated g_type_class_add_private() 2020-01-14 14:00:56 +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
Benjamin Berg
deb3c25e51 device: Adjust to new libfprint API for early match reporting
This API was added to libfprint to allow drivers to report the match
result early before the operation has been completed. No driver makes
use of this facility yet and instead drivers try to finish the
operation early for quick result reporting. This primarily means not
waiting for finger removal.

Once drivers are updated, fprintd reactivity will regress unless the
early match callback is implemented as they would only get an operation
finished callback when the whole of the operation was finished,
including finger removal and finishing up USB communications.

See: https://gitlab.freedesktop.org/libfprint/fprintd/issues/35
2020-01-14 13:41:57 +01:00
Marco Trevisan (Treviño)
a520896325 device: Use FP_FINGER_IS_VALID to check finger number 2019-12-19 14:29:04 +01:00
Marco Trevisan (Treviño)
707ed01059 file_storage: Remove definition of FP_FINGER_IS_VALID
This is now provided by libfprint
2019-12-19 14:28:35 +01:00
Marco Trevisan (Treviño)
6903c36157 file-storage: Use first/last fingers references instead of named ones
Don't depend in the hardcoded libfprint fingers order, but use instead the
aliases for first/last fingers in libfprint order
2019-12-18 17:34:04 +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
5043ef3c7d device: Print warnings for fatal errors 2019-12-04 17:03:53 +01:00