Commit Graph

260 Commits

Author SHA1 Message Date
c0ba475fbf 0.9.0 V_0_9_0 2019-08-08 15:18:00 +02:00
704c19b87a device: Restart verification if error is "retry"
fprintd's API docs say that "retry" errors for verification
"the verification is still ongoing" and that "[the] user should retry
scanning their finger.

Unfortunately, retry errors are fatal in libfprint. Make fprintd restart
operations when "retry" is the error for either identification or
verification purposes.

We need to also make sure that a "*Stop" D-Bus call will return as
normal if called while we're stopping a verification or identification
in order to restart it.

Closes: #22
2019-08-08 13:12:28 +00:00
8f90390c6b pam: Fix rhost check when rhost is unavailable
Don't exit early if the rhost field isn't filled in, as it usually isn't
for a lot of services.

Fixes: 3274a31
2019-08-08 12:31:32 +02:00
e061990fa9 build: Fix loading configuration file with default build args
Fix incorrect configuration path when the sysconfdir is relative to the
prefix argument:
fprintd-WARNING **: 12:22:38.816: Could not open "${prefix}/etc/fprintd.conf": No such file or directory

The path needs to be expanded before it's substituted.
2019-08-08 12:26:23 +02:00
011310e30c main: Print the full path of the configuration file
Rather than just its filename, otherwise we won't know where to look.
2019-08-08 12:26:23 +02:00
3274a31153 pam: Don't ask for fingerprints for remote logins
As written in the "Linux-PAM Application Developers' Guide"
at http://www.linux-pam.org/Linux-PAM-html/adg-security-user-identity.html:
"
As a general rule, the following convention for its value can be
assumed: NULL = unknown; localhost = invoked directly from the
local system; other.place.xyz = some component of the user's
connection originates from this remote/requesting host.
"

So also exit early if the hostname isn't localhost as it should be.

Closes: #21
2019-08-07 14:12:53 +00:00
d6c4e8ba64 file: Remove unused variable 2019-08-07 15:15:23 +02:00
48976d0031 main: Throw g_warning() on startup failure
Rather than using g_print()
2019-08-07 15:15:23 +02:00
cbf4a47af3 main: Add debug when about to load configuration file 2019-08-07 15:15:23 +02:00
bfbac18606 file: More debug on file and directory accesses 2019-08-07 15:15:23 +02:00
09529c396b Add code of conduct document 2019-07-25 12:07:27 +02:00
94a9815362 data: tell systemd to create state directory
If the directory referred to by ReadWritePaths= does not exist, the
service fails to start:

    systemd[1]: Starting Fingerprint Authentication Daemon...
    systemd[9736]: fprintd.service: Failed to set up mount namespacing: No such file or directory
    systemd[9736]: fprintd.service: Failed at step NAMESPACE spawning /usr/lib/fprintd/fprintd: No such file or directory
    systemd[1]: fprintd.service: Main process exited, code=exited, status=226/NAMESPACE
    systemd[1]: fprintd.service: Failed with result 'exit-code'.
    systemd[1]: Failed to start Fingerprint Authentication Daemon.

This may happen when booting with an empty /var filesystem.

For a system service, "StateDirectory=fprint" causes /var/lib/fprint and
any parent directories to be created if missing (with mode 0755 by
default, owned by the user and group of the service, which in this case
is root).  In combination with ProtectSystem=strict, this state
directory will be mounted read-write.  StateDirectory was introduced in
systemd 235, so require at least this version.

The /var/lib prefix is hardcoded in systemd. (Since systemd 240, the
full path(s) to StateDirectory are provided as $STATE_DIRECTORY, but
since it is always /var/lib, we continue to just hardcode that path.)

On non-systemd systems, since fprintd runs as root with no confinement,
it can create its state directory as needed (with g_mkdir_with_parents()
in file_storage_print_data_save()).
2019-07-04 15:27:54 +01:00
9ed8767cb3 Hardcode storage path as /var/lib/fprint
--localstatedir (and --prefix) will now be ignored in favour of this
hardcoded path.  This is in preparation for a change to use systemd's
StateDirectory feature.
2019-07-04 15:27:54 +01:00
8ae7abc6c2 autogen.sh: open-code pushd/popd
This script uses /bin/sh, which on Debian-like systems is dash, which
does not support bash's pushd/popd.
2019-03-21 09:17:43 +00:00
dd9d7cc35d build: Create the storage directory at install time
Otherwise you could get into a state where the daemon could not start
because the directory listed as a ReadWritePaths in the .service file is
missing.

Spotted by Will Thompson.

See: !5
2019-03-04 17:10:13 +01:00
dbeeb95756 file: Simplify file_storage_get_basestore_for_username() usage
file_storage_get_basestore_for_username() can never fail, so simplify
its callers by removing the error checking.
2019-02-15 23:59:00 +00:00
5e76441210 ci: Fix CI for recent libfprint changes
The gettext in fprintd would be getting confused by a new file in
libfprint that looks like it should have been translated. Ignore this
file in our build.
2019-02-15 12:19:06 +01:00
8de9164be0 main: Fix memory leak when a save fails
and simplify the flow of that function.

From https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1745455/comments/7
2018-11-12 12:09:51 +00:00
267e6b3238 device: Fix client_username memory leak
No need to duplicate that string until we pass it out.

From https://bugs.launchpad.net/ubuntu/+source/fprintd/+bug/1745455/comments/7
2018-11-12 12:09:51 +00:00
51f4dce4e7 pam: Fix typo in occurred 2018-11-09 07:41:42 +01:00
0c76397a6e loop: Use signed type for fp_get_pollfds() retval
This will be a warning with slightly older versions of libfprint, but at
least it would catch errors.
2018-06-26 15:19:45 +02:00
815256717b README: Update URL in Transifex doc 2018-06-18 12:45:41 +02:00
9e32cd5257 0.8.1 V_0_8_1 2018-06-15 17:54:01 +02:00
32b9f1b056 data: Update policy vendor URL 2018-06-15 17:54:01 +02:00
12ef09a1c9 po: Update translations 2018-06-15 17:50:08 +02:00
596172e42d README: Update link to website 2018-06-07 22:25:39 +02:00
d37d8a233a TODO: Remove image transfer support
I doubt we want to do this, and nothing has needed it so far.
2018-05-31 17:28:19 +02:00
3550ac5f05 TODO: Remove identification support TODO
See #10
2018-05-31 17:28:19 +02:00
111681c57d TODO: Remove hardware protection TODO
See #9
2018-05-31 17:24:58 +02:00
6eed9f1244 TODO: Remove translations from TODO
Already registered in Transifex:
https://www.transifex.com/freedesktop/fprintd/
2018-05-31 17:23:53 +02:00
04bd6bab46 TODO: Remove hotplug TODO item
See #8
2018-05-31 17:20:19 +02:00
fa4af3ee67 build: Add CI 2018-05-31 14:44:17 +02:00
31b985f547 device: Fix crash on exit
Fix a possible crash when an fprintd client disappears. If the client
requested for the device to be released, then, without waiting for the
reply of that release, disappeared from the bus, we would try to close
it a second time, accessing a function pointer that didn't exist
anymore.

See https://bugzilla.redhat.com/show_bug.cgi?id=1515720
2018-05-31 12:02:31 +02:00
661684b1f5 main: Turn messages in debug messages
Rather than filling the logs with mostly useless messages, print those
as debug.
2018-05-30 19:59:07 +02:00
2322244c5a build: Add a log domain for fprintd debug messages 2018-05-30 19:58:20 +02:00
8e0c030f62 main: Split off events loop handling into a separate file
To make it easier to use as an example.
2018-05-25 16:06:54 +02:00
4234902671 main: Clean up main loop integration
Remove do/while loops in favour of for loops, and downgrade some
warnings and messages statements to debug.
2018-05-25 15:45:02 +02:00
78ffe68426 po: Update translations
And add Belarusian
2018-04-26 14:44:45 +02:00
2704e72308 data: Restrict available socket protocols
When starting the daemon
2018-04-26 14:44:02 +02:00
f39f28830a pam: Avoid errors when using parts of the copy/paste header
If not all the functions in the header are used, we'd get warnings about
them being unused. Mark all the functions as unused, so we can avoid
warnings.
2018-02-06 14:12:41 +01:00
e6d291b248 po: Add 2 new languages 2018-02-06 11:23:01 +01:00
a2f2526df6 po: Update translations 2018-02-06 11:22:13 +01:00
2f78c46dcf build: Fix srcdir = builddir build
Don't try to copy a file over itself if srcdir == builddir
2018-02-06 11:21:06 +01:00
8eba309920 0.8.0 V_0_8_0 2017-09-13 16:27:53 +02:00
6494efa94e data: Stop privilege escalations in daemon
Using the NoNewPrivileges stanza from systemd.
2017-09-13 15:48:17 +02:00
e55ad52ded device: Fix warning when open the device fails
The error should be initialised to NULL before being set.
2017-02-16 15:51:22 +01:00
0d28678118 device: dbus_g_method_return_error() does not free the error
So free the errors after sending them on the bus.

https://bugs.freedesktop.org/show_bug.cgi?id=99838
2017-02-16 15:44:12 +01:00
051eb0427d pam: Don't poke the hardware if user has no registered prints
Before claiming the device and therefore potentially activating
the actual hardware, make a call to see if the user has any
prints registered at all.

https://bugs.freedesktop.org/show_bug.cgi?id=99811
2017-02-16 14:49:58 +01:00
f54a90ea80 pam: separate device opening and claiming
For some operations, i.e. listing the enrolled prints, the device
does not need to be claimed. Therefore the claiming can be delayed
until we actually start the verification process, allowing us to
query the fingerprint system if the user has any prints enrolled.

https://bugs.freedesktop.org/show_bug.cgi?id=99811
2017-02-16 14:46:35 +01:00
da87d1d7ee pam: Only call g_type_init when using an old glib
Calling g_type_init() is not needed anymore and deprecated since
glib version 2.36.

https://bugs.freedesktop.org/show_bug.cgi?id=99812
2017-02-14 17:14:20 +01:00