summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-23 23:27:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-23 23:27:00 +0000
commita85f0af604f2e459ae5e195de50da889cee2adf8 (patch)
tree1d940af149ae0b4f84c81e6eaec0b633b25012ac /sbin
parent8ad74366642c0982e261447b2a3687eb47758589 (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')
-rw-r--r--sbin/mount/mount.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 4a9b6052fb5..b868dbd8b58 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.c,v 1.60 2015/01/16 06:39:59 deraadt Exp $ */
+/* $OpenBSD: mount.c,v 1.61 2015/11/23 23:26:59 deraadt Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
@@ -108,6 +108,9 @@ main(int argc, char * const argv[])
int all, ch, forceall, i, mntsize, rval, new;
char *options, mntpath[PATH_MAX];
+ if (pledge("stdio rpath disklabel proc exec", NULL) == -1)
+ err(1, "pledge");
+
all = forceall = 0;
options = NULL;
vfstype = "ffs";