From ef0048419ec8f789e17a23ab6946a350fcc5c2ee Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 18 Oct 2015 03:17:49 +0000 Subject: after kmem is open and setup, pledge "stdio rpath wpath cpath" seems to be working. commiting to get feedback from people who crash. --- sbin/savecore/savecore.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbin/savecore/savecore.c') diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 86845f532e9..feb8baec3ff 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savecore.c,v 1.54 2015/10/18 03:13:07 deraadt Exp $ */ +/* $OpenBSD: savecore.c,v 1.55 2015/10/18 03:17:48 deraadt Exp $ */ /* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */ /*- @@ -171,6 +171,11 @@ main(int argc, char *argv[]) (void)time(&now); kmem_setup(); + if (pledge("stdio rpath wpath cpath", NULL) == -1) { + syslog(LOG_ERR, "pledge: %m"); + exit(1); + } + if (clear) { clear_dump(); return (0); -- cgit v1.2.3