Skip to content

Commit

Permalink
Use retval, not errno, when stashing master keys
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
kaduk committed Nov 4, 2013
1 parent bfec067 commit 51b5cef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/kadmin/dbutil/kdb5_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void kdb5_create(argc, argv)
&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 */
Expand Down
2 changes: 1 addition & 1 deletion src/kadmin/dbutil/kdb5_mkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ kdb5_add_mkey(int argc, char *argv[])
&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"));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/kadmin/dbutil/kdb5_stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ kdb5_stash(argc, argv)
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;
}

Expand Down

0 comments on commit 51b5cef

Please sign in to comment.