summaryrefslogtreecommitdiff
path: root/sbin/tunefs
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-12 02:01:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-12 02:01:16 +0000
commit6c21dbac88bde2b8b85f851cb93ea89a3fa035ec (patch)
treec48d3faa9e221a4015e1b652cf3dd38993273915 /sbin/tunefs
parent66306797e15bc70263c4ef1142d4aa9c5a252d60 (diff)
tunefs can pledge to only use "stdio", after it has opened the device.
ok doug
Diffstat (limited to 'sbin/tunefs')
-rw-r--r--sbin/tunefs/tunefs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index cf96199e5f3..e363ff97afb 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tunefs.c,v 1.37 2015/02/07 02:09:14 deraadt Exp $ */
+/* $OpenBSD: tunefs.c,v 1.38 2015/10/12 02:01:15 deraadt Exp $ */
/* $NetBSD: tunefs.c,v 1.33 2005/01/19 20:46:16 xtraeme Exp $ */
/*
@@ -155,6 +155,10 @@ main(int argc, char *argv[])
fi = openpartition(special, openflags, &special);
if (fi == -1)
err(1, "%s", special);
+
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
getsb(&sblock, special);
#define CHANGEVAL(old, new, type, suffix) do \