From f229dd67b70d31956a43bc45604f19584d80dfcf Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 30 Sep 2014 12:22:12 -0700 Subject: [PATCH] fix custom password for bsd_auth. --- slock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slock.c b/slock.c index 6d84d8b..d7150be 100644 --- a/slock.c +++ b/slock.c @@ -424,15 +424,15 @@ readpw(Display *dpy, const char *pws) switch(ksym) { case XK_Return: passwd[len] = 0; -#ifdef HAVE_BSD_AUTH - running = !auth_userokay(getlogin(), NULL, "auth-xlock", passwd); -#else if(g_pw) { running = !!strcmp(passwd, g_pw); } else { +#ifdef HAVE_BSD_AUTH + running = !auth_userokay(getlogin(), NULL, "auth-xlock", passwd); +#else running = !!strcmp(crypt(passwd, pws), pws); - } #endif + } if(running) { XBell(dpy, 100); lock_tries++;