summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-12 06:24:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-12 06:24:29 +0000
commit7b587e2618a822a34f769fb9198acac41df2f709 (patch)
treeae6f2ea184c8f5e5a407d515993a54a47ecaa8ab
parent5651682f5b4715cd792f2470a9f4582afaa4ad81 (diff)
pledge "stdio" after opening up the input & output files.
ok jsg
-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);