iafilatov / libfprint

libfrpint driver for a family of Elantech fingerprint sensors
https://cgit.freedesktop.org/libfprint/libfprint/
GNU Lesser General Public License v2.1
146 stars 20 forks source link

fprintd-enroll times out #11

Closed pklaus closed 6 years ago

pklaus commented 6 years ago

I'm on Arch Linux (rolling release distro) with a very recent version of fprint: 0.8.0-1

After installing the modified libfprint library, running fprint-enroll times out with the following error:

[philipp@lion ~]$ fprintd-enroll 
list_devices failed: Failed to activate service 'net.reactivated.Fprint': timed out (service_start_timeout=25000ms)

Using examples/enroll and examples/verify works nicely with my 04f3:0c1a Elan though.

iafilatov commented 6 years ago

Hm, not really sure. If you compile and install libfprint with debug logging (autogen.sh), you'll get debug output in syslog. Also maybe check if fprintd is running?

pklaus commented 6 years ago

I'll see about the syslog. How can I check fprintd is running? Who's starting the daemon? fprintd-enroll? If so, is it terminating, when the tool ends?

Funny enough, my self-compiled version of fprint_demo works perfectly:

git clone git://github.com/dsd/fprint_demo.git
cd fprint_demo
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --prefix=/usr/local
make
# running
LD_LIBRARY_PATH=/usr/local/lib/ ./src/fprint_demo
pklaus commented 6 years ago

Ah, I see. The syslog revealed the problem:

May 05 11:01:18 lion dbus-daemon[371]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.2425' (uid=1000 pid=14285 comm="fprintd-list philipp ")
May 05 11:01:18 lion systemd[1]: Starting Fingerprint Authentication Daemon...
May 05 11:01:18 lion fprintd[14286]: /usr/lib/fprintd: error while loading shared libraries: libfprint.so.0: cannot open shared object file: No such file or directory
May 05 11:01:18 lion systemd[1]: fprintd.service: Main process exited, code=exited, status=127/n/a
May 05 11:01:18 lion systemd[1]: fprintd.service: Failed with result 'exit-code'.
May 05 11:01:18 lion systemd[1]: Failed to start Fingerprint Authentication Daemon.

So that systemd thing has to get to know the new library path (/usr/local/lib)...

pklaus commented 6 years ago

So the problem was that the system didn't know about this additional library path "/usr/local/lib". When calling a tool from the command line, you can set the environment variable LD_LIBRARY_PATH (like in LD_LIBRARY_PATH=/usr/local/lib/ ./src/fprint_demo). But for the system wide library locations, the correct place to register them is /etc/ld.so.conf or a new .conf file in /etc/ld.so.conf.d/. As I'm using Arch Linux, the latter one is preferred. Here's what was needed to fix the problem:

echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/usr_local_lib.conf
sudo ldconfig

Afterwards, the commands fprintd-enroll and fprintd-verify just work.

Thanks for your nice work on extending the library to the ELAN fp readers!

iafilatov commented 6 years ago

Thanks for your interest, Philipp! I hope it works ok for you because the size of the sensor on these Elan devices has some implications which are outside of my control as a driver dev.

pklaus commented 6 years ago

So I've been using your libfprint together with fprintd for system login and sudo for three weeks now. It's working well, although I have to swipe my finger slowly and entierly for it to succeed. It's not as "convenient" as on Windows but I guess it's also more secure. To compensate for the procedure being more prone to deviations in speed and finger angle, I registered multiple "fingers" but always actually swept my index finger (forefinger) so that there are more reference samples stored for it :-) Thanks for providing the lib!

iafilatov commented 6 years ago

I'm glad it works for you. I don't know and certainly make no claim about how it compares to Windows touch-mode operation in terms of security. There's no data to say whether it's more or less secure in practice. All I can say is that the algo that libfprint uses is well-studied and robust. If it actually matches your print, it's not by chance.

neslinesli93 commented 5 years ago

Hi, I'm getting a similar problem: I can't get fprintd-enroll to work as it times out. Here are the contents of /var/log/syslog:

Aug 28 11:32:59 zenbook systemd[1]: Starting Fingerprint Authentication Daemon...
Aug 28 11:32:59 zenbook systemd[3422]: fprintd.service: Failed to set up mount namespacing: No such file or directory
Aug 28 11:32:59 zenbook systemd[3422]: fprintd.service: Failed at step NAMESPACE spawning /usr/local/libexec/fprintd: No such file or directory
Aug 28 11:32:59 zenbook systemd[1]: fprintd.service: Main process exited, code=exited, status=226/NAMESPACE
Aug 28 11:32:59 zenbook systemd[1]: fprintd.service: Failed with result 'exit-code'.
Aug 28 11:32:59 zenbook systemd[1]: Failed to start Fingerprint Authentication Daemon.

I've installed this library as well as fprintd from source, so it looks like a problem on fprintd end. Any idea?

neslinesli93 commented 5 years ago

Well, eventually I solved this problem by building both fprintd and libfprint to /usr instead of /usr/local.

However I had to stop trying to integrate the fingerprint system inside PMA after noticing that maybe 1/20 tries is successful. Is there really anything we can do?

iafilatov commented 5 years ago

@neslinesli93 Tries of what? What did you mean when you said "verify and enroll seem to work perfectly" in the #21?

neslinesli93 commented 5 years ago

Tries of fprintd-enroll, but they happened before I learned I had to swipe my finger on the sensor, from top to bottom.

Using that technique, I manage to enroll my finger with no failed attempts, but then running fprintd-verify results in a lot of false negatives, annoyingly