From d73dc91a28d5283bb0bfa32f56876e0998624471 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 13 Oct 2015 15:15:30 +0000 Subject: [PATCH] can pledge "stdio" after opening device. --- sbin/newfs_ext2fs/newfs_ext2fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbin/newfs_ext2fs/newfs_ext2fs.c b/sbin/newfs_ext2fs/newfs_ext2fs.c index 4fdae02f3b0..9060472e74c 100644 --- a/sbin/newfs_ext2fs/newfs_ext2fs.c +++ b/sbin/newfs_ext2fs/newfs_ext2fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs_ext2fs.c,v 1.15 2015/01/16 06:40:00 deraadt Exp $ */ +/* $OpenBSD: newfs_ext2fs.c,v 1.16 2015/10/13 15:15:30 deraadt Exp $ */ /* $NetBSD: newfs_ext2fs.c,v 1.8 2009/03/02 10:38:13 tsutsui Exp $ */ /* @@ -296,6 +296,10 @@ main(int argc, char *argv[]) } pp = getpartition(fsi, special, argv, &lp); + + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + if (!Iflag) { static const char m[] = "%s partition type is not `%s' (or use -I)"; -- 2.20.1