boltgolt / howdy

🛡️ Windows Hello™ style facial authentication for Linux
MIT License
5.9k stars 307 forks source link

Beta crashes with no face model known #836

Closed tokox closed 1 year ago

tokox commented 1 year ago

While testing beta version I discovered that when there is no face model known for user, then howdy crashes with this error:

Child killed by signal User defined signal 1 (10)

However, this error is definitely not right. 'pam_howdy' is detecting 'no face model' there (checked it):

https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L254-L259

Error steps:

  1. 'no face model' check fails
  2. howdy_status is called
  3. status isn't success, so howdy_error is called https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L112-L117
  4. status isn't child return value or signal (undefined behaviour probably? (idk how WIFEXITED and WIFSIGNALED work)) https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L59-L65
  5. second if is executed https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L89-L93
  6. 'Child killed...' message logged https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L92-L96
  7. error is returned to pam https://github.com/boltgolt/howdy/blob/f7649fc922b5b7877146d00d0475bad9d6453531/howdy/src/pam/main.cc#L98-L101

Maybe separate function to detect type of CompareError and what happened to child will be a good solution? What do you think?

Error created in #824 in a5184dc663969960dd1cd7a543ff2df646e22392


I've searched for similar issues already, and my issue has not been reported yet.

Linux distribution (if applicable): Fedora 38

Howdy version (sudo howdy version): Howdy 3.0.0 BETA

saidsay-so commented 1 year ago

803 contains a fix for this.

tokox commented 1 year ago

OK, didn't checked there. When will it be merged? Thanks

boltgolt commented 1 year ago

Just now!