diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-12 01:43:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-12 01:43:53 +0000 |
commit | 66306797e15bc70263c4ef1142d4aa9c5a252d60 (patch) | |
tree | a3c94d66f04773c738d3dff54152e18c340ab2e2 /sbin/clri | |
parent | cb7acb501dd1106a743aada9d2189d01c9d5ce29 (diff) |
pledge "stdio" right after opening the device. The remainder is
is just read, write, fsync, and close.
ok doug
Diffstat (limited to 'sbin/clri')
-rw-r--r-- | sbin/clri/clri.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c index 4ad511304dc..a82238f6bad 100644 --- a/sbin/clri/clri.c +++ b/sbin/clri/clri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clri.c,v 1.16 2015/02/06 11:49:39 tedu Exp $ */ +/* $OpenBSD: clri.c,v 1.17 2015/10/12 01:43:52 deraadt Exp $ */ /* $NetBSD: clri.c,v 1.19 2005/01/20 15:50:47 xtraeme Exp $ */ /* @@ -78,6 +78,8 @@ main(int argc, char *argv[]) /* get the superblock. */ if ((fd = open(fs, O_RDWR, 0)) < 0) err(1, "%s", fs); + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); for (i = 0; sblock_try[i] != -1; i++) { offset = (off_t)(sblock_try[i]); if (pread(fd, sblock, sizeof(sblock), offset) != sizeof(sblock)) |