summaryrefslogtreecommitdiffstats
path: root/libexec/login_skey
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-10-16 13:37:43 +0000
committermillert <millert@openbsd.org>2015-10-16 13:37:43 +0000
commitcbbcd319fcd2cd7f102ec0f7c551a3c482f8d7d8 (patch)
tree8b52edbb1256ec475192a65364a2a4fd87a370a9 /libexec/login_skey
parentactually include the prerequisite dependency for BIO instead of doing nastyness (diff)
downloadwireguard-openbsd-cbbcd319fcd2cd7f102ec0f7c551a3c482f8d7d8.tar.xz
wireguard-openbsd-cbbcd319fcd2cd7f102ec0f7c551a3c482f8d7d8.zip
Implement real "flock" request and add it to userland programs that
use pledge and file locking. OK deraadt@
Diffstat (limited to 'libexec/login_skey')
-rw-r--r--libexec/login_skey/login_skey.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libexec/login_skey/login_skey.c b/libexec/login_skey/login_skey.c
index 63838238e17..1ca514a750f 100644
--- a/libexec/login_skey/login_skey.c
+++ b/libexec/login_skey/login_skey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_skey.c,v 1.24 2015/01/16 06:39:50 deraadt Exp $ */
+/* $OpenBSD: login_skey.c,v 1.25 2015/10/16 13:37:43 millert Exp $ */
/*
* Copyright (c) 2000, 2001, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -34,6 +34,7 @@
#include <syslog.h>
#include <unistd.h>
#include <limits.h>
+#include <err.h>
#include <login_cap.h>
#include <bsd_auth.h>
@@ -65,6 +66,11 @@ main(int argc, char *argv[])
(void)signal(SIGTSTP, suspend);
(void)setpriority(PRIO_PROCESS, 0, 0);
+ if (pledge("stdio rpath wpath flock sendfd proc tty", NULL) == -1) {
+ syslog(LOG_AUTH|LOG_ERR, "pledge: %m");
+ exit(1);
+ }
+
openlog(NULL, LOG_ODELAY, LOG_AUTH);
while ((ch = getopt(argc, argv, "ds:v:")) != -1) {