From 4421d4c68bb3e30bf3b273d1a3d7ed5c7a78c2ff Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 29 Jul 2018 13:34:26 +0000 Subject: [PATCH] After "termcap" initilization is finished, top appears to not open any files ever again, so we can re-pledge tighter. --- usr.bin/top/top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index f9317ab4ee5..d3ed70e65f1 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.89 2017/03/15 04:24:14 deraadt Exp $ */ +/* $OpenBSD: top.c,v 1.90 2018/07/29 13:34:26 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -412,6 +412,8 @@ main(int argc, char *argv[]) sigprocmask(SIG_BLOCK, &mask, &oldmask); if (interactive) init_screen(); + if (pledge("stdio getpw tty proc ps vminfo", NULL) == -1) + err(1, "pledge"); (void) signal(SIGINT, leave); siginterrupt(SIGINT, 1); (void) signal(SIGQUIT, leave); -- 2.20.1