summaryrefslogtreecommitdiff
path: root/sbin/ncheck_ffs/ncheck_ffs.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-23 19:19:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-23 19:19:31 +0000
commitc10750cf11d5188fefdbb251666560c63f567b49 (patch)
treecf4bf88d121eebd22a523f6c2c8663fedbab3bf1 /sbin/ncheck_ffs/ncheck_ffs.c
parent05d4eb3f8a6fd3603419f079bcedc86152bb5b97 (diff)
Use pledge "disklabel" as needed. The theory here is these tools become more
resistant against memory correctup, if a corrupt filesystem is given to them. ok krw
Diffstat (limited to 'sbin/ncheck_ffs/ncheck_ffs.c')
-rw-r--r--sbin/ncheck_ffs/ncheck_ffs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/ncheck_ffs/ncheck_ffs.c b/sbin/ncheck_ffs/ncheck_ffs.c
index e299eb767da..45c3a0b484e 100644
--- a/sbin/ncheck_ffs/ncheck_ffs.c
+++ b/sbin/ncheck_ffs/ncheck_ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncheck_ffs.c,v 1.51 2015/10/11 19:00:40 doug Exp $ */
+/* $OpenBSD: ncheck_ffs.c,v 1.52 2015/11/23 19:19:30 deraadt Exp $ */
/*-
* Copyright (c) 1995, 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
@@ -510,6 +510,9 @@ main(int argc, char *argv[])
char *ep;
int c, i;
+ if (pledge("stdio rpath disklabel", NULL) == -1)
+ err(1, "pledge");
+
while ((c = getopt(argc, argv, "af:i:ms")) != -1)
switch (c) {
case 'a':