summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2016-06-01 16:51:55 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2016-06-01 16:51:55 +0000
commit33af5fc9759ca511783d12d79e2be8fceecb4570 (patch)
tree6fb50690089e441be2e8aa4052856f5b2e2386ac /sbin
parentde57394e9bbd1d7de2b09b7bdb01350f8ade26c3 (diff)
Fix automatic disk allocation based on a template which I broke in the
previous commit. readlabel() calls editor_allocspace() which will use the default label unless a template was provided beforehand. Thus, call parse_autolabel() before redlabel(). Problem found and fix provided by Mark Patruck, thanks! Fix asap, deraadt@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/disklabel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index b8d1419d746..38e785efd07 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.219 2016/05/29 17:02:21 tb Exp $ */
+/* $OpenBSD: disklabel.c,v 1.220 2016/06/01 16:51:54 tb Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -206,6 +206,9 @@ main(int argc, char *argv[])
if (f < 0)
err(4, "%s", specname);
+ if (autotable != NULL)
+ parse_autotable(autotable);
+
if (op != WRITE || aflag || dflag)
readlabel(f);
else if (argc == 2 || argc == 3)
@@ -221,9 +224,6 @@ main(int argc, char *argv[])
err(1, "pledge");
}
- if (autotable != NULL)
- parse_autotable(autotable);
-
switch (op) {
case EDIT:
if (argc != 1)