Enroll failed with error -22

I use pam_fprint on my laptop. Somehow my fingerprints disappeared and I could not enroll them back with pam_fprint_enroll. I had this error message:

Enroll failed with error -22

To fix this I switched from pam_fprint to fprintd which uses D-Bus. I also had to change /etc/pam.d/system:

-auth    sufficient   pam_fprint.so
+auth    sufficient   pam_fprintd.so

Then I could enroll my fingerprints with fprint-enroll.

2 thoughts on “Enroll failed with error -22

  1. Did run into this on a ThinkPad W530 as well.

    The reason for EINVAL was a driver bug in libfprint. The following patch fixes the issue for me.

    diff –git a/libfprint/drivers/upeke2.c b/libfprint/drivers/upeke2.c
    index f685205..45192e8 100644
    — a/libfprint/drivers/upeke2.c
    +++ b/libfprint/drivers/upeke2.c
    @@ -870,7 +870,7 @@ static int dev_init(struct fp_dev *dev, unsigned long driver_data)
    upekdev = g_malloc(sizeof(*upekdev));
    upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */
    dev->priv = upekdev;
    – dev->nr_enroll_stages = 5;
    + dev->nr_enroll_stages = 6;

    fpi_drvcb_open_complete(dev, 0);
    return 0;

  2. I agree but I don’t understand why it worked before with pam_fprint_enroll? It’s like the number of enroll stages needed by the device jumped from 5 to 6.

    The reason it doesn’t work with pam_fprint_enroll is that it uses the sync call fp_enroll_finger_img() that returns EINVAL when stage >= dev->nr_enroll_stages. Instead fprintd uses the async calls that do not check that.

Leave a Reply

Your email address will not be published. Required fields are marked *

× eight = eight