From: deraadt Date: Sun, 11 Oct 2015 04:36:22 +0000 (+0000) Subject: If only displaying the disklabel (the normal thing to do against potentially X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c6798c7b25eaabe54c74cfdba8f1ec2220395152;p=openbsd If only displaying the disklabel (the normal thing to do against potentially unknown disks...), after opening & reading the disklabel, pledge "stdio" ok doug --- 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