diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 19:19:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 19:19:31 +0000 |
commit | c10750cf11d5188fefdbb251666560c63f567b49 (patch) | |
tree | cf4bf88d121eebd22a523f6c2c8663fedbab3bf1 /sbin/scan_ffs | |
parent | 05d4eb3f8a6fd3603419f079bcedc86152bb5b97 (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/scan_ffs')
-rw-r--r-- | sbin/scan_ffs/scan_ffs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/scan_ffs/scan_ffs.c b/sbin/scan_ffs/scan_ffs.c index 8c8e6bfcaf5..83d330160d1 100644 --- a/sbin/scan_ffs/scan_ffs.c +++ b/sbin/scan_ffs/scan_ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scan_ffs.c,v 1.20 2015/10/11 04:33:17 deraadt Exp $ */ +/* $OpenBSD: scan_ffs.c,v 1.21 2015/11/23 19:19:30 deraadt Exp $ */ /* * Copyright (c) 1998 Niklas Hallqvist, Tobias Weingartner @@ -138,6 +138,9 @@ main(int argc, char *argv[]) daddr_t beg = 0, end = -1; const char *errstr; + if (pledge("stdio rpath disklabel", NULL) == -1) + err(1, "pledge"); + while ((ch = getopt(argc, argv, "lsvb:e:")) != -1) switch(ch) { case 'b': |