swaywm / swaylock

Screen locker for Wayland
MIT License
853 stars 202 forks source link

Implement handling SIGUSR2 to record external failed authentication attempts #324

Open lilyinstarlight opened 1 year ago

lilyinstarlight commented 1 year ago

This adds support for indicating external authentication failures using SIGUSR2, in addition to the existing support for external authentication successes using SIGUSR1

Since SIGUSR* defaults to termination, we ignore them in the forked pw backend children (which worked already because SIGUSR1 ends up in termination anyway, but we do not want that to happen for SIGUSR2)

This is intended to be usable with an external program that can handle fprintd communication as an alternative to #283

Supersedes and closes #311

emersion commented 1 year ago

SIGUSR1 is not intended for external processes to indicate success. It's a feature to unlock the session when it's stuck.

lilyinstarlight commented 1 year ago

SIGUSR1 is not intended for external processes to indicate success. It's a feature to unlock the session when it's stuck.

Adding a SIGUSR2 was suggested in https://github.com/swaywm/swaylock/pull/283#issuecomment-1678615442. If this is not the correct approach, is there something else that can be done to support this use-case?

Thanks!

emersion commented 1 year ago

swaylock is not meant to be extensible through plugins. I don't think we want to support extensibility because of the complexity. Regardless, signals in particular are not a great API.

I would suggest forking swaylock or creating your own screen locker with fprintd support.

lilyinstarlight commented 1 year ago

Okay, feel free to close this then. Thanks!