The krb5_db_store_master_key{,_list} functions return a
krb5_error_code, and do not necessarily set errno on failure.
Use the correct variable while reporting errors with com_err().
&master_keyblock,
mkey_password);
if (retval) {
- com_err(progname, errno, _("while storing key"));
+ com_err(progname, retval, _("while storing key"));
printf(_("Warning: couldn't stash master key.\n"));
}
/* clean up */
&new_mkeyblock,
mkey_password);
if (retval) {
- com_err(progname, errno, _("while storing key"));
+ com_err(progname, retval, _("while storing key"));
printf(_("Warning: couldn't stash master key.\n"));
}
}
retval = krb5_db_store_master_key_list(util_context, keyfile, master_princ,
NULL);
if (retval) {
- com_err(progname, errno, _("while storing key"));
+ com_err(progname, retval, _("while storing key"));
exit_status++; return;
}