From c6798c7b25eaabe54c74cfdba8f1ec2220395152 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 11 Oct 2015 04:36:22 +0000 Subject: [PATCH] If only displaying the disklabel (the normal thing to do against potentially unknown disks...), after opening & reading the disklabel, pledge "stdio" ok doug --- sbin/disklabel/disklabel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index b012c7ab5d6..0634bdc02d8 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.208 2015/10/05 12:49:58 krw Exp $ */ +/* $OpenBSD: disklabel.c,v 1.209 2015/10/11 04:36:22 deraadt Exp $ */ /* * Copyright (c) 1987, 1993 @@ -244,6 +244,10 @@ main(int argc, char *argv[]) if (argc != 1) usage(); readlabel(f); + + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + if (tflag) makedisktab(stdout, &lab); else -- 2.20.1