summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2015-11-24 01:17:03 +0000
committerkrw <krw@openbsd.org>2015-11-24 01:17:03 +0000
commitb64d8bbd6b5dddc7686a037bef9b6cb9e2fbe830 (patch)
treeacaa7388ee93233afc05b22d220feed1d598c088
parentCache values from getpwnam() done at initialization, which need to be (diff)
downloadwireguard-openbsd-b64d8bbd6b5dddc7686a037bef9b6cb9e2fbe830.tar.xz
wireguard-openbsd-b64d8bbd6b5dddc7686a037bef9b6cb9e2fbe830.zip
Need 'cpath' for op == EDITOR, as '-F' to write out the ascii label in
an arbitrary location is a possibility. Suggested by & ok deraadt@
-rw-r--r--sbin/disklabel/disklabel.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 5e5d5b31b2e..8183c0876a9 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.212 2015/11/23 19:19:29 deraadt Exp $ */
+/* $OpenBSD: disklabel.c,v 1.213 2015/11/24 01:17:03 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -191,17 +191,13 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (op == EDIT) {
+ if (op == EDIT || op == EDITOR) {
if (pledge("stdio rpath wpath cpath disklabel proc exec", NULL) == -1)
err(1, "pledge");
- } else if (op == EDITOR) {
- /* "proc exec" for man page in editor */
- if (pledge("stdio rpath wpath disklabel proc exec", NULL) == -1)
- err(1, "pledge");
} else {
if (pledge("stdio rpath wpath disklabel", NULL) == -1)
err(1, "pledge");
- }
+ }
if (op == UNSPEC)
op = READ;