summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander von Gernler <grunk@cvs.openbsd.org>2007-02-08 16:21:10 +0000
committerAlexander von Gernler <grunk@cvs.openbsd.org>2007-02-08 16:21:10 +0000
commita3249c62acbbf240c238c1f5237e1e50aa465882 (patch)
treedb6575b2a19be9f18bc222a1f3d318393d9fd8ef /usr.sbin
parent0a289dde6d7a0ac669dbd63759e45050b4113552 (diff)
prevent vnconfig from asking for a key when unconfiguring or listing devices.
even clarify this further by supplying NULL and 0 to action() for -u case ok pedro@, no objections bluhm@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/vnconfig/vnconfig.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c
index 4b4672d748a..63dc7e54165 100644
--- a/usr.sbin/vnconfig/vnconfig.c
+++ b/usr.sbin/vnconfig/vnconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnconfig.c,v 1.22 2007/02/02 08:54:43 grunk Exp $ */
+/* $OpenBSD: vnconfig.c,v 1.23 2007/02/08 16:21:09 grunk Exp $ */
/*
* Copyright (c) 1993 University of Utah.
* Copyright (c) 1990, 1993
@@ -126,20 +126,19 @@ main(int argc, char **argv)
if (saltopt && (!opt_K))
errx(1, "-S only makes sense when used with -K");
- if (opt_k) {
- if (opt_K)
- errx(1, "-k and -K are mutually exclusive options");
- key = getpass("Encryption key: ");
- keylen = strlen(key);
- } else if (opt_K) {
- key = get_pkcs_key(rounds, saltopt);
- keylen = 128;
- }
-
- if (action == VND_CONFIG && argc == 2)
+ if (action == VND_CONFIG && argc == 2) {
+ if (opt_k) {
+ if (opt_K)
+ errx(1, "-k and -K are mutually exclusive");
+ key = getpass("Encryption key: ");
+ keylen = strlen(key);
+ } else if (opt_K) {
+ key = get_pkcs_key(rounds, saltopt);
+ keylen = 128;
+ }
rv = config(argv[0], argv[1], action, key, keylen);
- else if (action == VND_UNCONFIG && argc == 1)
- rv = config(argv[0], NULL, action, key, keylen);
+ } else if (action == VND_UNCONFIG && argc == 1)
+ rv = config(argv[0], NULL, action, NULL, 0);
else if (action == VND_GET)
rv = getinfo(argc ? argv[0] : NULL);
else