Popax21 / synaTudor

GNU Lesser General Public License v2.1
89 stars 10 forks source link

FEDORA: Impossible to enroll: GDBus.Error:net.reactivated.Fprint.Error.NoSuchDevice: No devices available #14

Closed marcosdalvarez closed 1 year ago

marcosdalvarez commented 1 year ago

Hello! First of all thank you very much for creating the controller for this sensor!!! I'm trying to get it to work on Fedora 37 and can't get it to detect the sensor:

$ fprintd-enroll 
Impossible to enroll: GDBus.Error:net.reactivated.Fprint.Error.NoSuchDevice: No devices available
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 06cb:00be Synaptics, Inc. 
Bus 001 Device 002: ID 5986:212b Bison Electronics Inc. Integrated Camera
Bus 001 Device 004: ID 8087:0029 Intel Corp. AX200 Bluetooth
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# dnf list installed | grep fprint
fprintd.x86_64                                       1.94.2-3.fc37                      @fedora                                        
libfprint-tod.x86_64                                 1.94.5+tod1-3.fc37                 @copr:copr.fedorainfracloud.org:dhodyn:personal
libfprint-tod-devel.x86_64                           1.94.5+tod1-3.fc37                 @copr:copr.fedorainfracloud.org:dhodyn:personal
# cat synaTudor/build/meson-logs/install-log.txt 
# List of files installed by Meson
# Does not contain files installed by custom scripts.
/sbin/tudor/libtudor.so
/sbin/tudor/tudor_cli
/sbin/tudor/tudor_host
/sbin/tudor/tudor_host_launcher
/usr/lib64/libfprint-2/tod-1/libtudor_tod.so
/usr/lib/systemd/system/tudor-host-launcher.service
/usr/share/dbus-1/system.d/net.reactivated.TudorHostLauncher.conf
/usr/share/dbus-1/system-services/net.reactivated.TudorHostLauncher.service
/usr/lib/udev/60-tudor-libfprint-tod.rules
# journalctl -b -u fprintd.service
abr 10 16:54:40 fedora systemd[1]: Starting fprintd.service - Fingerprint Authentication Daemon...
abr 10 16:54:40 fedora fprintd[1623]: Failed to start Tudor host process - is tudor-host-launcher.service running? Error: 'GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected' (g-dbus-error-quark code 4)
abr 10 16:54:40 fedora fprintd[1623]: Ignoring device due to initialization error: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected
abr 10 16:54:40 fedora systemd[1]: Started fprintd.service - Fingerprint Authentication Daemon.
abr 10 16:55:11 fedora systemd[1]: fprintd.service: Deactivated successfully.
# journalctl -b -u tudor-host-launcher.service
abr 10 16:54:40 fedora systemd[1]: Starting tudor-host-launcher.service - Tudor host launcher DBus service...
abr 10 16:54:40 fedora systemd[1]: Started tudor-host-launcher.service - Tudor host launcher DBus service.
abr 10 16:54:40 fedora systemd[1]: tudor-host-launcher.service: Deactivated successfully.

I did the steps on a virtual installation of Ubuntu (VirtualBox) and it worked fine, but on Fedora (which is my real distro) I can't get it to detect the sensor. I don't know how to continue diagnosing, could you help me. Thank you!!!

Sorry for my english, I'm using google translate.

Popax21 commented 1 year ago

What's the output of sudo systemctl status tudor-host-launcher?

marcosdalvarez commented 1 year ago

The output is:

$ sudo systemctl status tudor-host-launcher
○ tudor-host-launcher.service - Tudor host launcher DBus service
     Loaded: loaded (/usr/lib/systemd/system/tudor-host-launcher.service; static)
     Active: inactive (dead)

abr 10 18:02:15 fedora systemd[1]: Starting tudor-host-launcher.service - Tudor host launcher DBus service...
abr 10 18:02:15 fedora systemd[1]: Started tudor-host-launcher.service - Tudor host launcher DBus service.
abr 10 18:02:15 fedora systemd[1]: tudor-host-launcher.service: Deactivated successfully.

I remember that in the first attempt to install udev it gave an error that the plugdev group did not exist, I did a sudo groupadd plugdevand the error no longer appeared... could that have something to do with it?

Thank you!!!

marcosdalvarez commented 1 year ago

I kept experimenting and found that the problem is with selinux. If I set it to permissive mode the sensor works. Now I'm going to have to study how to configure selinux correctly because I have no idea how to do it. Thank you!!!

cargocats commented 1 year ago

Did you manage to write a SELinux configuration file for it?

I kept experimenting and found that the problem is with selinux. If I set it to permissive mode the sensor works. Now I'm going to have to study how to configure selinux correctly because I have no idea how to do it. Thank you!!!

marcosdalvarez commented 1 year ago

Did you manage to write a SELinux configuration file for it?

No, I finally did nothing and just left it at that.

cargocats commented 1 year ago

Did you manage to write a SELinux configuration file for it?

No, I finally did nothing and just left it at that.

So you left it in permissive mode?

marcosdalvarez commented 1 year ago

So you left it in permissive mode?

I left it like that for a while and then I switched to Arch Linux and it doesn't use Selinux

cargocats commented 1 year ago

Tried to get it working on Fedora, but without luck SELinux is not blocking it and there is no errors in journalctl

EDIT: I'm going back to Arch

AuraHerreroRuiz commented 1 year ago

Hello!

I'm chiming in because I wasn't satisfied with leaving SELinux in permissive mode, so I managed to write a "Type enforcement" file for synaTudor to work. (fprintd-tudor.te) I've tested this in a fedora installation only, nonetheless here it is:

module fprintd-tudor 1.0;

require {
    type unconfined_service_t;
    type fprintd_t;
    class unix_dgram_socket { getattr getopt };
}

#============= fprintd_t ==============
allow fprintd_t unconfined_service_t:unix_dgram_socket { getattr getopt };

I don't know if this can be included in the project repo in any way, so I'm leaving it here.

For anyone who doesn't know how to use/install this file so SELinux allows synaTudor to work, here is a step by step guide:

  1. Install the necessary dependencies in your distro to use the utilities checkmodule and semodule_package. In fedora these are the checkpolicy and policycoreutils packages.
  2. Save the above code block as a text file with the filename fprintd-tudor.te (If not the next commands might throw errors, even if you change the filename accordingly in the commands below). This can be done in a temporary directory.
  3. Run checkmodule -M -m -o fprintd-tudor.mod fprintd-tudor.te && semodule_package -m fprintd-tudor.mod -o fprintd-tudor.pp in a terminal.
  4. Finally run semodule -s targeted -i fprintd-tudor.pp as root. You can delete the generated files (fprintd-tudor.te, fprintd-tudor.mod and fprintd-tudor.pp) from your working directory.
cargocats commented 10 months ago

Thanks!!