Commit Graph

25 Commits

Author SHA1 Message Date
Drew DeVault
b90637e2a6 Convert swaylock into standalone project 2019-01-13 21:16:47 -05:00
Oscar Cowdery Lack
aae74613c6 swaylock: Fix caps lock not updating immediately
Partially fixes #2788. This change makes it so the lock screen is
redrawn whenever the caps lock modifier state changes, rather
on relying on the keypress event. This didn't work because
caps lock is disabled when the key is released, not pressed,
so the caps lock indicator does not go away until the next
keypress event.
2019-01-03 09:28:14 +11:00
Milkey Mouse
51838df916 swaylock: Submit password on Ctrl-D
Ctrl-D functions as EOF in most cases on the terminal. login(1) & many other
programs check the password on EOF, same as Enter. To make behavior consistent,
have swaylock submit the password on Ctrl-D.

This commit moves the handling for Enter into its own static function, which is
now also called on Ctrl-D.
2018-12-23 12:08:03 +01:00
Milkey Mouse
4363430d8d swaylock: Clear password buffer on Ctrl-C
I've got in the habit of using Ctrl-C with login(1) to restart password entry.
If Sway does the same thing I don't have to retrain my login muscle memory ;)
2018-12-23 12:08:03 +01:00
emersion
8191c2147b Replace _XOPEN_SOURCE with _POSIX_C_SOURCE
And make sure we don't define both in the same source file.
2018-11-25 17:19:43 +01:00
Ian Fan
274179a804 swaylock: exit on display error 2018-10-23 11:49:33 +01:00
Ryan Dwyer
a59fa9d1b6 Remove timerfd from loop implementation
timerfd doesn't work on the BSDs, so this replaces it with a timespec
for the expiry and uses a poll timeout to check the timers when needed.
2018-10-15 00:26:27 +10:00
Ryan Dwyer
e63e0e4ec4 swaylock: Don't wait too long for surface damage before verifying 2018-10-15 00:26:27 +10:00
Ryan Dwyer
076827d4cb swaylock: clear password after 10 seconds 2018-10-15 00:26:27 +10:00
Ryan Dwyer
f27204e5a1 swaylock: Remove indicator after 3 seconds 2018-10-15 00:26:27 +10:00
espkk
7931487347 swaylock: fix clear_password_buffer 2018-10-14 07:40:33 +03:00
Drew DeVault
64259db8d6 Add support for building swaylock without PAM
This involves setuid'ing swaylock, which then forks and drops perms on
the parent process. The child process remains root and listens on a pipe
for requests to validate passwords against /etc/shadow.
2018-09-28 13:53:01 +02:00
Brian Ashworth
77cf57ae14 Implement swaylock customization flags 2018-07-10 21:29:15 -04:00
emersion
ecf5b656c9 Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
Dominique Martinet
01d2c492fd swaylock: fix the displaying of "verified"
Displaying verified after damaging state needs more than one roundtrip,
so keep looping until surfaces are not dirty anymore
2018-07-07 21:02:28 +09:00
Dominique Martinet
d68ddd1532 swaylock: implement ^U to clear buffer
The whole state->xcb.modifiers thing didn't work at all (always 0)
The xkb doc says "[xkb_state_serialize_mods] should not be used in
regular clients; please use the xkb_state_mod_*_is_active API instead"
so here it is
2018-06-08 22:42:15 +09:00
emersion
515f03c94c swaylock: implement a proper render loop 2018-05-27 13:39:38 +01:00
Mattias Eriksson
52e2575d19 Improved key handling in swaylock
Make escape clear buffer
Add indicator states for ctrl,shift,super et al
Add CapsLock indicator
2018-04-24 15:40:30 +02:00
Geoff Greer
d8f0fb1378 swaylock: Securely zero-out password.
- Replace char* with static array. Any chars > 1024 will be discarded.
- mlock() password buffer so it can't be written to swap.
- Clear password buffer after auth succeeds or fails.

This is basically the same treatment I gave the 0.15 branch in https://github.com/swaywm/sway/pull/1519
2018-04-12 17:49:21 -07:00
Drew DeVault
f39499b139 Address review feedback from @emersion 2018-04-04 18:52:44 -04:00
Drew DeVault
2c6703cd41 Move extra roundtrip into password.c 2018-04-04 18:47:49 -04:00
Drew DeVault
5e61e86883 Actually let's not do that TODO 2018-04-04 18:47:48 -04:00
Drew DeVault
d9287eb53b R E N D E R I N G 2018-04-04 18:47:48 -04:00
Drew DeVault
89942f511d Verify passwords 2018-04-04 18:47:48 -04:00
Drew DeVault
3f21cd441b Add password buffer, refactor rendering/surfaces 2018-04-04 18:47:48 -04:00