Commit Graph

549 Commits

Author SHA1 Message Date
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
3d2d73d615 main: call g_type_init only if 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
06ea385260 tests: call g_type_init only if 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
8fa3dcd5cd main: Plug tiny memory leak
dbus_g_method_get_sender() returns an allocated-string which we need to
free. This is handled properly in the rest of the codebase.

https://bugs.freedesktop.org/show_bug.cgi?id=99811
2017-02-14 14:29:54 +01:00
32307570fe po: Update translations 2017-02-11 18:17:40 +01:00
7ae196a0dd po: Remove duplicate Bulgarian and Persian translations
https://bugs.freedesktop.org/show_bug.cgi?id=99773
2017-02-11 18:16:23 +01:00
36d3d9d749 data: Lockdown the fprintd service
Give read-write access to USB devices in /dev, and the location of the
fingerprints, access to Unix sockets for D-Bus and
close everything else down.

See systemd.exec(5) for details about the options.
2017-01-05 13:04:48 +01:00
b3c1ed0d2a main: Don't hardcode fingerprint storage directory
It used to be hard-coded to /var/lib/fprint, but is now set to
$(localstatedir)/lib/fprint/.
2017-01-05 12:50:06 +01:00
eabeaa258e 0.7.0 V_0_7_0 2016-10-13 17:33:26 +02:00
e2ba6321f8 po: Update translations 2016-10-13 17:28:26 +02:00
efe2a5b00c build: Fix updating translations with builddir != srcdir
tx supports a single "--root" argument to pass both where it expects to
read the created data file (the .pot file) and the configuration. As
those are two separate directories with builddir != srcdir, copy the .tx
file from srcdir to builddir to upload the updated .pot file.
2016-10-13 17:28:26 +02:00
9acacefa18 pam: Fix "format-nonliteral" warning
In file included from tests/enroll.c:29:0:
pam/fingerprint-strings.h: In function ‘finger_str_to_msg’:
pam/fingerprint-strings.h:99:6: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
      return g_strdup_printf (TR (fingers[i].place_str_specific), driver_name);
      ^~~~~~
pam/fingerprint-strings.h:104:6: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
      return g_strdup_printf (TR (fingers[i].swipe_str_specific), driver_name);
      ^~~~~~
2016-07-19 11:27:17 +02:00