Commit graph

24 commits

Author SHA1 Message Date
Oscar Cowdery Lack 76cd3f2642 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 82b0296964 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 9877189ea3 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 3a310f92ab
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 ebfb1388e2 swaylock: exit on display error 2018-10-23 11:49:33 +01:00
Ryan Dwyer 6921fdc6d6 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 f98f351a52 swaylock: Don't wait too long for surface damage before verifying 2018-10-15 00:26:27 +10:00
Ryan Dwyer fa11b7f701 swaylock: clear password after 10 seconds 2018-10-15 00:26:27 +10:00
Ryan Dwyer c242712262 swaylock: Remove indicator after 3 seconds 2018-10-15 00:26:27 +10:00
espkk 42f72f8bb4 swaylock: fix clear_password_buffer 2018-10-14 07:40:33 +03:00
Drew DeVault c977349120 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 936a920a8e Implement swaylock customization flags 2018-07-10 21:29:15 -04:00
emersion 63b4bf5000
Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
Dominique Martinet b78c29a83f 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 c78ce0770a 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 cc10c7af65
swaylock: implement a proper render loop 2018-05-27 13:39:38 +01:00
Mattias Eriksson 2d884d4e4f 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 ad6aa21c43 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 5d444b34f6 Address review feedback from @emersion 2018-04-04 18:52:44 -04:00
Drew DeVault 0138f79b4a Move extra roundtrip into password.c 2018-04-04 18:47:49 -04:00
Drew DeVault 62a736a196 Actually let's not do that TODO 2018-04-04 18:47:48 -04:00
Drew DeVault d053acbed6 R E N D E R I N G 2018-04-04 18:47:48 -04:00
Drew DeVault e902de34db Verify passwords 2018-04-04 18:47:48 -04:00
Drew DeVault 066143adef Add password buffer, refactor rendering/surfaces 2018-04-04 18:47:48 -04:00