Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/cgdconfig In -G, refuse to operate if KEYGEN_URANDOM is...
details: https://anonhg.NetBSD.org/src/rev/f802d66e8a9d
branches: trunk
changeset: 759213:f802d66e8a9d
user: elric <elric%NetBSD.org@localhost>
date: Thu Dec 02 04:54:32 2010 +0000
description:
In -G, refuse to operate if KEYGEN_URANDOM is specified as we already do
for KEYGEN_RANDOMKEY.
Print a warning if such a refusal is made---this will help the user understand
why there is an error.
Patch provided by: Taylor R Campbell <campbell+netbsd%mumble.net@localhost>.
diffstat:
sbin/cgdconfig/cgdconfig.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (40 lines):
diff -r eb8a93cdda87 -r f802d66e8a9d sbin/cgdconfig/cgdconfig.c
--- a/sbin/cgdconfig/cgdconfig.c Thu Dec 02 04:42:46 2010 +0000
+++ b/sbin/cgdconfig/cgdconfig.c Thu Dec 02 04:54:32 2010 +0000
@@ -1,4 +1,6 @@
-/* $NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $ */
+#define opendisk1(x,y,z,t,u,v) opendisk(x,y,z,t,u)
+
+/* $NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +35,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 2002, 2003\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $");
#endif
#include <err.h>
@@ -872,11 +874,17 @@
/* for sanity, we ensure that none of the keygens are randomkey */
for (kg=p->keygen; kg; kg=kg->next)
- if (kg->kg_method == KEYGEN_RANDOMKEY)
+ if ((kg->kg_method == KEYGEN_RANDOMKEY) ||
+ (kg->kg_method == KEYGEN_URANDOMKEY)) {
+ warnx("can't preserve randomly generated key");
goto bail;
+ }
for (kg=oldp->keygen; kg; kg=kg->next)
- if (kg->kg_method == KEYGEN_RANDOMKEY)
+ if ((kg->kg_method == KEYGEN_RANDOMKEY) ||
+ (kg->kg_method == KEYGEN_URANDOMKEY)) {
+ warnx("can't preserve randomly generated key");
goto bail;
+ }
if (!params_verify(oldp)) {
warnx("invalid old parameters file \"%s\"", *argv);
- Prev by Date:
[src/trunk]: src/share/misc +FPS, GG, GGWP, OOC, TMJ, fix expansion of SFAICT.
- Next by Date:
[src/trunk]: src/crypto/external/bsd/openssh/bin/sshd Don't rely on the share...
- Previous by Thread:
[src/trunk]: src/share/misc +FPS, GG, GGWP, OOC, TMJ, fix expansion of SFAICT.
- Next by Thread:
[src/trunk]: src/crypto/external/bsd/openssh/bin/sshd Don't rely on the share...
- Indexes:
Home |
Main Index |
Thread Index |
Old Index