From 43df60e4e4359956898847648e809b43940a489f Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 12 Oct 2015 06:24:28 +0000 Subject: [PATCH] pledge "stdio" after opening up the input & output files. ok jsg --- usr.sbin/mkuboot/mkuboot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.20.1