slock

My build of the suckless screen locker.
git clone git://git.alex.balgavy.eu/slock.git
Log | Files | Refs | README | LICENSE

commit 37c3fae853298e13aa54cad4b27e87eb977e09c3
parent 1c6123c9ae1a55f4affdc6be6846ef1e22e253c3
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date:   Thu, 25 Jan 2024 21:29:51 +0100

Clear password on ctrl-u

Diffstat:
Mslock.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/slock.c b/slock.c @@ -318,6 +318,12 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, default: // if (num && !iscntrl((int)buf[0]) && // (len + num < sizeof(passwd))) { + if (ksym == XK_u && ev.xkey.state & ControlMask) { + printf("Clearing!\n"); + explicit_bzero(&passwd, sizeof(passwd)); + len = 0; + continue; + } if (controlkeyclear && iscntrl((int)buf[0])) continue; if (num && (len + num < sizeof(passwd))) {