Commit Graph

607 Commits

Author SHA1 Message Date
c12778ec5b tests/fprintd: Verify that each enroll stage happens
Instead of automatically replying with the 'whorl' image for every enroll
state signal with result 'enroll-stage-passed', only perform the number
of required enroll stages and ensure that we get the expected results.

This also will allow to manually perform enroll steps in other tests.
2020-03-17 17:09:19 +01:00
dbabd4d7d3 tests/fprintd: Deduplicate enrollment code 2020-03-17 15:54:14 +01:00
db1865eb3e tests/fprintd: Deduplicate result wait code 2020-03-17 15:49:40 +01:00
10a3e75937 ci: Fix unknown keys in CI
Fix:
root config contains unknown keys: container_fedora_build
2020-03-17 15:31:08 +01:00
01ea517a97 ci: Fix CI syntax error
Fix CI syntax error:
container_fedora_build: unknown keys in `extends` (.fedora@container-build)
Caused by changes in the wayland CI templates:
4a73f030d0
2020-03-17 15:29:37 +01:00
3a98ef646b ci: Re-enable stable branch
Now that libfprint v2 has landed in rawhide.
2020-02-19 13:07:27 +01:00
750a815fdf ci: Use extends to repeat libfprint builds
This syntax is just nicer and more maintainable than the YAML anchors
2020-02-18 14:08:32 +01:00
53fcf52989 ci: Factorize the similar parameters in build jobs 2020-02-18 14:06:32 +01:00
52e12459df main: Improve comments on fprint manager creation
Explain why the manager creation is async better in both in the main file
and in the manager itself
2020-02-14 16:01:01 +01:00
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
681bd1ed2a device: Fix leaked matched print on identify
When starting an identify operation we allocate a gallery of prints from the
gallery, although if we match one of them we get that back in the finish
callback but with a further reference added.

So, in order to clean it up, use an auto-pointer or we'd end up in leaking
it, and the address sanitizer was catching this in our tests already:

  Indirect leak of 12020 byte(s) in 5 object(s) allocated from:
    #0 0x7fe8bc638ce6 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dce6)
    #1 0x7fe8bc37ffd0 in g_malloc0 ../../glib/glib/gmem.c:132
    #2 0x55d100635c01 in load_from_file ../src/file_storage.c:159
    #3 0x55d100635c01 in file_storage_print_data_load ../src/file_storage.c:182
    #4 0x55d10063e950 in fprint_device_verify_start ../src/device.c:882
    #5 0x55d10064036b in dbus_glib_marshal_fprint_device_VOID__STRING_POINTER src/device-dbus-glue.h:96
    #6 0x7fe8bc50f6f5  (/usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2+0xd6f5)
2020-02-14 15:55:09 +01:00
8890732194 device: Don't leak the user on claim error while deleting prints
When using the delete method we check if the device was claimed, if this
fails because the device is already in use we return an error, but we don't
free the user.

While this could be fixed by just a further g_free call, let's just remove
remove the other manual free calls, and use an auto-pointer instead for this
function.
2020-02-14 15:55:09 +01:00
7dac81dcad device: Use g_clear_error instead of doing the same manually
We've now an utility function that can help us to free and unset an error
double pointer, so let's use it.
2020-02-14 15:55:09 +01:00
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
ba7a45d3f8 device: Always free error in delete enrolled fingers2
During delete enrolled fingers2 call, if the check-claimed control fails, we
would return the error without freeing it.

While this could be fixed by just a further g_error_free call, let's just
remove the other manual free call, and use an auto-pointer instead for this
function.
2020-02-14 15:55:09 +01:00
49dced5566 device: Always free error in delete enrolled fingers
During delete enrolled fingers call, if the check-claimed control fails, and
we get an error different from FPRINT_ERROR_CLAIM_DEVICE, we would return
the error without freeing it.

While this could be fixed by just a further g_error_free call, let's just
remove all the manual free calls, and use an auto-pointer instead for this
function.
2020-02-14 15:55:09 +01:00
e25544a8f0 manager: Remove unused path variable 2020-02-14 15:55:09 +01:00
ee8589ec9d main: Ensure we always free context, loop and error
In case of early return we may not free them consistently, while this is not
a big problem in a main function, is better to have a cleaner management,
and we did get valgrind reports.
2020-02-14 15:55:09 +01:00
580cceb50e 1.90.1 1.90.1 2020-02-10 14:59:42 +01:00
b90b21f26b build: Make pam module installation dir configurable
And avoid treating "libdir" as an absolute path, the documentation
clearly states that it is "relative to the prefix".

Based on patch by Timothy Gu <timothygu99@gmail.com>
2020-02-10 14:49:11 +01:00
6d583cb5d8 ci: List dependencies on separate lines
This improves readability of additions and removals.
2020-02-07 17:23:40 +01:00
c776068cd2 ci: Build a docker image with dependencies and use it
Include the wayland ci-templates to be able to easily generate an image
2020-02-07 17:23:32 +01:00
b8d80fcb35 ci: Include libfprint templates to sync with its dependencies
Use libfprint templates in order to get its dependencies without having to
manually keep a list of them in sync
2020-02-06 22:07:27 +01:00
32c2ccdd8c ci: Print coverage data once available so that gitlab can parse it 2020-02-06 11:30:23 +00:00
58784f7002 doc: Fix gtk-doc generation
Closes: #44
2020-02-06 12:21:51 +01:00
f295e6c571 ci: Test gtk-doc build 2020-02-06 12:08:04 +01:00
b02825620a Revert "build: Ensure that gcov symbols are exposed when needed"
This reverts commit 526b2e8c53.

Commit 0994cc31 was enough to implement the coverage support.
2020-02-05 17:09:19 +01:00
2327307b81 build: Rename config.h template
Now that it won't clash with the autotools version.
2020-02-05 17:07:10 +01:00
7c1ae363a8 build: Remove ChangeLog
It's empty and was only there to satisfy the autotools.
2020-02-05 17:05:32 +01:00
a18af36a03 build: Remove INSTALL file
It was an autotools file, and doesn't contain useful information
anymore.
2020-02-05 17:05:08 +01:00
526b2e8c53 build: Ensure that gcov symbols are exposed when needed
When coverage is enabled, we need to expose the __gcov_* symbols in the
binaries and libraries or we won't get any coverage report for them.
2020-02-05 16:54:54 +01:00
73625233f6 build: Remove autotools support 2020-02-05 16:54:54 +01:00
08de7e33a4 ci: Rename jobs to remove meson from the names 2020-02-05 16:45:57 +01:00
c871dfc998 ci: Remove autotools targets 2020-02-05 16:45:57 +01:00
dccc5796b6 ci: Enable coverage reports in test build 2020-02-05 16:45:57 +01:00
0994cc314e main: Ensure that a gcov flush happens on SIGTERM
When coverage is enabled fprintd test won't generate any .gcda file and so
apparently no data, this happens because gcov doesn't handle properly the
process termination when SIGTERM is used, and so when in fprintd.py we
terminate the process no coverage data is reported.

To avoid this, quit the main loop cleanly on SIGTERM, so that we will exit
from the main function cleanly, making libc to perform a gcov flush when we
exit the program.
2020-02-05 16:45:57 +01:00
09b1f1f1db ci: Compile with --werror in build_dev 2020-02-05 15:25:35 +01:00
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
8f75563920 enroll: Fix usernames memory leak
usernames was not freed on exit.
2020-02-05 15:25:35 +01:00
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
72d8a0f512 build: Enable -Werror on redundant declarations
Now that we've fixed our own errors.
2020-02-05 15:25:35 +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
e2fd52190a main: Fix "function declaration isn't a prototype" warning
../src/file_storage.c:47:20: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
47 | static const char *get_storage_path()
   |                    ^~~~~~~~~~~~~~~~
../src/file_storage.c: In function ‘get_storage_path’:
../src/file_storage.c:47:20: warning: old-style function definition [-Wold-style-definition]
../src/file_storage.c: In function ‘file_storage_discover_users’:
../src/file_storage.c:270:9: warning: old-style function definition [-Wold-style-definition]
270 | GSList *file_storage_discover_users()
    |         ^~~~~~~~~~~~~~~~
2020-02-05 15:25:35 +01:00
7d8450e5ab device: Mark fingers names array as const and use unique name
With the stronger warnings enabled when building with meson, we get a
warning for all the fingers definitions:

  ../src/device.c:38:24: warning: initialization discards ‘const’ qualifier
  from pointer target type [-Wdiscarded-qualifiers]
    38 |  [FP_FINGER_UNKNOWN] = "unknown",

As the `fingers` array name was shadowed in another file:

  ../src/device.c:1000:11: warning: declaration of ‘fingers’ shadows a
  global declaration [-Wshadow]
    1000 |   GSList *fingers, *finger;
2020-02-05 15:25:35 +01:00
95e95d2910 main: Fix "function declaration isn't a prototype" warning 2020-02-05 15:25:35 +01:00
75aeff4acd tests: Increase debugging level for PAM tests 2020-02-05 15:25:35 +01:00
bebd3d2a98 tests: Increase debugging for daemon tests 2020-02-05 15:25:35 +01:00
0e2bf7e804 build: Check translations using a script
Use a bash script to check the translations as we used to do during
the autotools-based distcheck.
2020-02-05 15:25:35 +01:00
f5a2c21f90 build: Add configuration recap message for meson 2020-02-05 15:25:35 +01:00
53d80c1474 build: Use gettext to translate policy file with meson
Recent versions of gettext can merge translations in xml files,
so use it and remove the intltool dependency for meson builds.
2020-02-05 15:25:35 +01:00