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_ffs | |
parent | 29e3e2171efab34d58295ebde8c714976f68cbd3 (diff) |
Cannot pledge() in the hotroot case
Discovered by krw
Diffstat (limited to 'sbin/fsck_ffs')
-rw-r--r-- | sbin/fsck_ffs/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index c373b416bc4..d2d0c86d4a4 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.47 2015/11/23 19:19:30 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.48 2015/11/23 23:01:20 deraadt Exp $ */ /* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */ /* @@ -170,8 +170,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: |