diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 23:01:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-11-23 23:01:21 +0000 |
commit | 8ad74366642c0982e261447b2a3687eb47758589 (patch) | |
tree | 8543832fe944b04d0c937c83295262f53f60eeae /sbin/fsck_ext2fs | |
parent | 29e3e2171efab34d58295ebde8c714976f68cbd3 (diff) |
Cannot pledge() in the hotroot case
Discovered by krw
Diffstat (limited to 'sbin/fsck_ext2fs')
-rw-r--r-- | sbin/fsck_ext2fs/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/fsck_ext2fs/main.c b/sbin/fsck_ext2fs/main.c index 2c2ecefdca3..f7c38ce4956 100644 --- a/sbin/fsck_ext2fs/main.c +++ b/sbin/fsck_ext2fs/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.24 2015/11/23 19:19:30 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.25 2015/11/23 23:01:20 deraadt Exp $ */ /* $NetBSD: main.c,v 1.1 1997/06/11 11:21:50 bouyer Exp $ */ /* @@ -158,8 +158,9 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child) if (debug && preen) pwarn("starting\n"); - if (pledge("stdio rpath wpath getpw disklabel", NULL) == -1) - err(1, "pledge"); + if (!hotroot()) + if (pledge("stdio rpath wpath getpw disklabel", NULL) == -1) + err(1, "pledge"); switch (setup(filesys)) { case 0: |