aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-09-23 19:08:39 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-09-23 19:08:39 +0200
commita98fba8971ab4b8d8b1f18422b808a79434d8923 (patch)
tree99af8ddc9dc4911cdb4a9dbd123eaffa37d6ce23
parentdc2e8e839e4d72f5fec36c9a0474e6062a7a8f51 (diff)
downloadslock-a98fba8971ab4b8d8b1f18422b808a79434d8923.tar.gz
slock-a98fba8971ab4b8d8b1f18422b808a79434d8923.tar.xz
error out early on crypt() fail
-rw-r--r--slock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/slock.c b/slock.c
index 6dedc69..2d57e81 100644
--- a/slock.c
+++ b/slock.c
@@ -321,8 +321,9 @@ main(int argc, char **argv) {
#endif
hash = gethash();
- if (strlen(hash) < 2)
- die("slock: failed to get user password hash.\n");
+ errno = 0;
+ if (!crypt("", hash))
+ die("slock: crypt: %s\n", strerror(errno));
if (!(dpy = XOpenDisplay(NULL)))
die("slock: cannot open display\n");