#include "com_err.h"
#include "adm.h"
#include "adm_proto.h"
+#include "kadm5_defs.h"
#ifdef LANGUAGES_SUPPORTED
static const char *usage_format = "%s: usage is %s [-a aclfile] [-d database] [-e enctype] [-m]\n\t[-k mkeytype] [-l langlist] [-p portnum] [-r realm] [-s stash] [-t timeout] [-n]\n\t[-D dbg] [-M mkeyname] [-T ktabname].\n";
krb5_flags def_flags;
krb5_boolean exp_valid, flags_valid;
krb5_realm_params *rparams;
+ krb5_int32 realm_num_keysalts;
+ krb5_key_salt_tuple *realm_keysalts;
/* Kerberatic contexts */
krb5_context kcontext;
*/
error = 0;
exp_valid = flags_valid = FALSE;
+ realm_keysalts = (krb5_key_salt_tuple *) NULL;
+ realm_num_keysalts = 0;
while ((option = getopt(argc, argv, getopt_string)) != EOF) {
switch (option) {
case 'a':
flags_valid = TRUE;
}
+ /* Clone the value of the keysalt array */
+ if (realm_num_keysalts = rparams->realm_num_keysalts) {
+ if (realm_keysalts =
+ (krb5_key_salt_tuple *) malloc(realm_num_keysalts *
+ sizeof(krb5_key_salt_tuple))) {
+ memcpy(realm_keysalts, rparams->realm_keysalts,
+ (realm_num_keysalts * sizeof(krb5_key_salt_tuple)));
+ }
+ else
+ realm_num_keysalts = 0;
+ }
+
krb5_free_realm_params(kcontext, rparams);
}
/*
* Initialize our modules.
*/
- error = key_init(kcontext, debug_level, enc_type, key_type,
- master_key_name, manual_entry, db_file, db_realm,
- keytab_name, stash_name);
+ error = key_init(kcontext,
+ debug_level,
+ enc_type,
+ key_type,
+ master_key_name,
+ manual_entry,
+ db_file,
+ db_realm,
+ keytab_name,
+ stash_name,
+ realm_num_keysalts,
+ realm_keysalts);
if (!error) {
error = acl_init(kcontext, debug_level, acl_file);
if (!error) {
/*
* We've successfully initialized here.
*/
-#ifndef DEBUG
com_err(programname, 0, begin_op_msg, server_name_msg);
-#endif /* DEBUG */
/*
* net_dispatch() only returns when we're done for some reason.