summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mkuboot
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-12 06:24:28 +0000
committerderaadt <deraadt@openbsd.org>2015-10-12 06:24:28 +0000
commit43df60e4e4359956898847648e809b43940a489f (patch)
treed72edd84bb2f2d599689fc27b63a2f679f043115 /usr.sbin/mkuboot
parentunifdef EVP_CHECK_DES_KEY: Ben Kaduk noticed it has a syntax error; that (diff)
downloadwireguard-openbsd-43df60e4e4359956898847648e809b43940a489f.tar.xz
wireguard-openbsd-43df60e4e4359956898847648e809b43940a489f.zip
pledge "stdio" after opening up the input & output files.
ok jsg
Diffstat (limited to 'usr.sbin/mkuboot')
-rw-r--r--usr.sbin/mkuboot/mkuboot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/mkuboot/mkuboot.c b/usr.sbin/mkuboot/mkuboot.c
index 6f5cd69f4ca..36103366fb8 100644
--- a/usr.sbin/mkuboot/mkuboot.c
+++ b/usr.sbin/mkuboot/mkuboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkuboot.c,v 1.5 2015/10/12 05:54:18 deraadt Exp $ */
+/* $OpenBSD: mkuboot.c,v 1.6 2015/10/12 06:24:28 deraadt Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -230,6 +230,9 @@ main(int argc, char *argv[])
if (ofd < 0)
err(1, "%s", oname);
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
/* Write initial header. */
if (write(ofd, &ih, sizeof ih) != sizeof ih)
err(1, "%s", oname);