[hackers] [slock] Add /etc/passwd support || FRIGN

From: <git_AT_suckless.org>
Date: Mon, 09 Jun 2014 20:14:43 +0200

commit 9db14b10dd09336c6a8fe283f99108c9acc4667a
Author: FRIGN <dev_AT_frign.de>
Date: Tue Jun 3 19:19:10 2014 +0200

    Add /etc/passwd support
    
    Fix slock to work with /etc/passwd without /etc/shadow.
    while we're at it, remove an occurence of trailing whitespace.

diff --git a/slock.c b/slock.c
index 506231e..aedee2e 100644
--- a/slock.c
+++ b/slock.c
_AT_@ -75,7 +75,7 @@ getpw(void) { /* only run as root */
         rval = pw->pw_passwd;
 
 #if HAVE_SHADOW_H
- if (strlen(rval) >= 1) { /* kludge, assumes pw placeholder entry has len >= 1 */
+ if (rval[0] == 'x' && rval[1] == '
Received on Mon Jun 09 2014 - 20:14:43 CEST

This archive was generated by hypermail 2.3.0 : Mon Jun 09 2014 - 20:24:08 CEST