};
char *Err_no_master_msg = "Master key not entered!\n";
+char *Err_no_database = "Database not currently opened!\n";
char *current_dbname = NULL;
/* krb5_kvno may be narrow */
}
cur_realm = defrealm;
}
- if (retval = set_dbname_help(progname, dbname))
- exit(retval);
+ (void) set_dbname_help(progname, dbname);
if (request) {
(void) ss_execute_line(sci_idx, request, &code);
(void) krb5_finish_key(&master_encblock);
(void) krb5_finish_random_key(&master_encblock,
&master_random);
+ memset((char *)master_keyblock.contents, 0,
+ master_keyblock.length);
+ free((char *) master_keyblock.contents);
+ master_keyblock.contents = NULL;
}
krb5_free_principal(master_princ);
dbactive = FALSE;
if (retval = krb5_db_verify_master_key(master_princ, &master_keyblock,
&master_encblock)) {
com_err(pname, retval, "while verifying master key");
- (void) krb5_db_fini();
+ memset((char *)master_keyblock.contents, 0, master_keyblock.length);
+ free((char *)master_keyblock.contents);
+ valid_master_key = 0;
+ dbactive = TRUE;
return(1);
}
if (retval = krb5_process_key(&master_encblock,
&master_keyblock)) {
com_err(pname, retval, "while processing master key");
- (void) krb5_db_fini();
+ memset((char *)master_keyblock.contents, 0, master_keyblock.length);
+ free((char *)master_keyblock.contents);
+ valid_master_key = 0;
+ dbactive = TRUE;
return(1);
}
if (retval = krb5_init_random_key(&master_encblock,
&master_random)) {
com_err(pname, retval, "while initializing random key generator");
(void) krb5_finish_key(&master_encblock);
- (void) krb5_db_fini();
+ memset((char *)master_keyblock.contents, 0, master_keyblock.length);
+ free((char *)master_keyblock.contents);
+ valid_master_key = 0;
+ dbactive = TRUE;
return(1);
}
dbactive = TRUE;
krb5_error_code retval;
if (!dbactive) {
- com_err(pname, 0, "Kerberos database not selected");
+ com_err(pname, 0, Err_no_database);
return;
}
if (retval = krb5_db_fetch_mkey(master_princ, &master_encblock,
com_err(argv[0], 0, "Usage: %s instance name [name ...]", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
com_err(argv[0], 0, "Usage: %s instance name [name ...]", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
int argc;
char *argv[];
{
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
com_err(argv[0], 0, "Usage: %s principal", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
com_err(argv[0], 0, "Usage: %s principal", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
com_err(argv[0], 0, "Usage: %s principal", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;
com_err(argv[0], 0, "Usage: %s principal", argv[0]);
return;
}
+ if (!dbactive) {
+ com_err(argv[0], 0, Err_no_database);
+ return;
+ }
if (!valid_master_key) {
com_err(argv[0], 0, Err_no_master_msg);
return;