Change '-f" option to "-sf" to indicate stash file on
command line.
* kdb5_stash.c (kdb5_stash): Indicate that policy db should be
closed, free context when done.
* kadm5_create.c (kadm5_create): Fix up memory leaks.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10265
dc483132-0cff-0310-8789-
dd5450dbe970
+Sun Nov 2 19:09:17 1997 Ezra Peisach <epeisach@mit.edu>
+
+ * kdb5_util.c: Add flag indicating that policy db is to be closed.
+ Change '-f" option to "-sf" to indicate stash file on
+ command line.
+
+ * kdb5_stash.c (kdb5_stash): Indicate that policy db should be
+ closed, free context when done.
+
+ * kadm5_create.c (kadm5_create): Fix up memory leaks.
+
Wed Oct 22 15:39:38 1997 Ezra Peisach <epeisach@mit.edu>
* tcl_wrapper.c: Include either tcl.h or tcl/tcl.h
krb5_context context;
FILE *f;
+ kadm5_config_params lparams;
if (retval = krb5_init_context(&context))
exit(ERR);
* params->admin_lockfile may not be set yet...
*/
if (retval = kadm5_get_config_params(context, NULL, NULL,
- params, params)) {
+ params, &lparams)) {
com_err(progname, retval, str_INITING_KCONTEXT);
return 1;
}
- if (retval = osa_adb_create_policy_db(params)) {
+ if (retval = osa_adb_create_policy_db(&lparams)) {
com_err(progname, retval, str_CREATING_POLICY_DB);
return 1;
}
- retval = kadm5_create_magic_princs(params, context);
+ retval = kadm5_create_magic_princs(&lparams, context);
+ kadm5_free_config_params(context, &lparams);
krb5_free_context(context);
return retval;
extern kadm5_config_params global_params;
extern int exit_status;
+extern int close_policy_db;
void
kdb5_stash(argc, argv)
if (strrchr(argv[0], '/'))
argv[0] = strrchr(argv[0], '/')+1;
+ /* Tell upwards to close the policy db cause we don't */
+ close_policy_db = 1;
+
krb5_init_context(&context);
dbname = global_params.dbname;
exit_status++; return;
}
+ krb5_free_context(context);
exit_status = 0;
return;
}
krb5_db_entry master_entry;
krb5_pointer master_random;
int valid_master_key = 0;
+int close_policy_db = 0;
char *progname;
krb5_boolean manual_mkey = FALSE;
} else if (strcmp(*argv, "-M") == 0 && ARG_VAL) {
global_params.mkey_name = optarg;
global_params.mask |= KADM5_CONFIG_MKEY_NAME;
- } else if (strcmp(*argv, "-f") == 0 && ARG_VAL) {
+ } else if (strcmp(*argv, "-sf") == 0 && ARG_VAL) {
global_params.stash_file = optarg;
global_params.mask |= KADM5_CONFIG_STASH_FILE;
} else if (strcmp(*argv, "-m") == 0) {
return exit_status;
(*cmd->func)(cmd_argc, cmd_argv);
+
+ if(close_policy_db) {
+ (void) osa_adb_close_policy(policy_db);
+ }
+ kadm5_free_config_params(util_context, &global_params);
+ krb5_free_context(util_context);
return exit_status;
}