summaryrefslogtreecommitdiffstats
path: root/usr.bin/lock/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/lock/lock.c')
-rw-r--r--usr.bin/lock/lock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c
index 2f26171..3f23a98 100644
--- a/usr.bin/lock/lock.c
+++ b/usr.bin/lock/lock.c
@@ -94,7 +94,7 @@ main(int argc, char **argv)
struct itimerval ntimer, otimer;
struct tm *timp;
int ch, failures, sectimeout, usemine, vtylock;
- char *ap, *mypw, *ttynam, *tzn;
+ char *ap, *cryptpw, *mypw, *ttynam, *tzn;
char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ];
openlog("lock", LOG_ODELAY, LOG_AUTH);
@@ -222,7 +222,8 @@ main(int argc, char **argv)
}
if (usemine) {
s[strlen(s) - 1] = '\0';
- if (!strcmp(mypw, crypt(s, mypw)))
+ cryptpw = crypt(s, mypw);
+ if (cryptpw == NULL || !strcmp(mypw, cryptpw))
break;
}
else if (!strcmp(s, s1))
OpenPOWER on IntegriCloud