summaryrefslogtreecommitdiffstats
path: root/lib/libskey/skeylogin.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-09-04 18:19:47 +0000
committermillert <millert@openbsd.org>1997-09-04 18:19:47 +0000
commit1f4ca9dd77363ef79a9a61c3aa36ed1d10d2fa67 (patch)
tree7f5ee6aae539acfb24c37162409d804b4e068d68 /lib/libskey/skeylogin.c
parentsync (diff)
downloadwireguard-openbsd-1f4ca9dd77363ef79a9a61c3aa36ed1d10d2fa67.tar.xz
wireguard-openbsd-1f4ca9dd77363ef79a9a61c3aa36ed1d10d2fa67.zip
Don't unlock skeys file before closing it. The lock is released
when the file is closed anyway and explicately unlocking before the file gets flushed defeats the purpose of locking in the first place.
Diffstat (limited to 'lib/libskey/skeylogin.c')
-rw-r--r--lib/libskey/skeylogin.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index f252fb24c9e..a99a25072dc 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -11,7 +11,7 @@
*
* S/KEY verification check, lookups, and authentication.
*
- * $OpenBSD: skeylogin.c,v 1.20 1997/07/27 22:11:41 millert Exp $
+ * $OpenBSD: skeylogin.c,v 1.21 1997/09/04 18:19:47 millert Exp $
*/
#include <sys/param.h>
@@ -300,7 +300,6 @@ skeyverify(mp, response)
/* Reread the file record NOW */
(void)fseek(mp->keyfile, mp->recstart, SEEK_SET);
if (fgets(mp->buf, sizeof(mp->buf), mp->keyfile) != mp->buf) {
- (void)flock(fileno(mp->keyfile), LOCK_UN);
(void)fclose(mp->keyfile);
return(-1);
}
@@ -317,7 +316,6 @@ skeyverify(mp, response)
/* Do actual comparison */
if (memcmp(filekey, fkey, SKEY_BINKEY_SIZE) != 0){
/* Wrong response */
- (void)flock(fileno(mp->keyfile), LOCK_UN);
(void)fclose(mp->keyfile);
return(1);
}
@@ -339,7 +337,6 @@ skeyverify(mp, response)
mp->logname, skey_get_algorithm(), mp->n,
mp->seed, mp->val, tbuf);
- (void)flock(fileno(mp->keyfile), LOCK_UN);
(void)fclose(mp->keyfile);
return(0);