If only displaying the disklabel (the normal thing to do against potentially
authorderaadt <deraadt@openbsd.org>
Sun, 11 Oct 2015 04:36:22 +0000 (04:36 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 11 Oct 2015 04:36:22 +0000 (04:36 +0000)
unknown disks...), after opening & reading the disklabel, pledge "stdio"
ok doug

sbin/disklabel/disklabel.c

index b012c7a..0634bdc 100644 (file)
@@ -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