diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-09-23 19:08:39 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-09-23 19:08:39 +0200 |
commit | a98fba8971ab4b8d8b1f18422b808a79434d8923 (patch) | |
tree | 99af8ddc9dc4911cdb4a9dbd123eaffa37d6ce23 | |
parent | dc2e8e839e4d72f5fec36c9a0474e6062a7a8f51 (diff) |
error out early on crypt() fail
-rw-r--r-- | slock.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -321,8 +321,9 @@ main(int argc, char **argv) { | |||
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | hash = gethash(); | 323 | hash = gethash(); |
324 | if (strlen(hash) < 2) | 324 | errno = 0; |
325 | die("slock: failed to get user password hash.\n"); | 325 | if (!crypt("", hash)) |
326 | die("slock: crypt: %s\n", strerror(errno)); | ||
326 | 327 | ||
327 | if (!(dpy = XOpenDisplay(NULL))) | 328 | if (!(dpy = XOpenDisplay(NULL))) |
328 | die("slock: cannot open display\n"); | 329 | die("slock: cannot open display\n"); |