summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2012-12-23 00:50:45 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2012-12-23 00:50:45 +0000
commit0417565a779a879935d3f6845d28ede2c07cd455 (patch)
treefe539950e5e3cbe7b71a32e3fc5fb68f59735063 /libexec
parent2b3c5a4235f188e9442c6926d8cc97797ab610df (diff)
Make the per-user counter file r/w by group auth
xlock issue pointed out and diff tested by Andreas Bartelt, thanks!
Diffstat (limited to 'libexec')
-rw-r--r--libexec/login_yubikey/login_yubikey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/login_yubikey/login_yubikey.c b/libexec/login_yubikey/login_yubikey.c
index 58409640058..0a5d2477864 100644
--- a/libexec/login_yubikey/login_yubikey.c
+++ b/libexec/login_yubikey/login_yubikey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_yubikey.c,v 1.4 2012/02/01 16:07:28 dhill Exp $ */
+/* $OpenBSD: login_yubikey.c,v 1.5 2012/12/23 00:50:44 halex Exp $ */
/*
* Copyright (c) 2010 Daniel Hartmeier <daniel@benzedrine.cx>
@@ -31,6 +31,7 @@
*/
#include <sys/param.h>
+#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <ctype.h>
@@ -254,6 +255,7 @@ yubikey_login(const char *username, const char *password)
}
syslog(LOG_INFO, "user %s: counter %u.%u > %u.%u",
username, ctr / 256, ctr % 256, last_ctr / 256, last_ctr % 256);
+ umask(S_IRWXO);
if ((f = fopen(fn, "w")) == NULL) {
syslog(LOG_ERR, "user %s: fopen: %s: %m", username, fn);
return (AUTH_FAILED);