Make kerberos code more verbose

This commit is contained in:
Michael Spang 2009-07-25 05:29:21 -04:00
parent e75390b7de
commit 0c828122ac
2 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,8 @@ void ceo_kadm_init() {
kadm5_config_params params;
memset((void *) &params, 0, sizeof(params));
debug("kadmin: initializing using keytab for %s", admin_principal);
retval = kadm5_init_with_skey(admin_principal, NULL /*admin_keytab */,
KADM5_ADMIN_SERVICE, &params, KADM5_STRUCT_VERSION,
KADM5_API_VERSION_2, &handle);
@ -24,6 +26,7 @@ void ceo_kadm_init() {
}
void ceo_kadm_cleanup() {
debug("kadmin: cleaning up");
kadm5_destroy(handle);
}
@ -32,6 +35,8 @@ int ceo_add_princ(char *user, char *password) {
kadm5_principal_ent_rec princ;
memset((void *) &princ, 0, sizeof(princ));
debug("kadmin: adding principal %s", user);
if ((retval = krb5_parse_name(context, user, &princ.principal))) {
com_err(prog, retval, "while parsing principal name");
return retval;
@ -50,6 +55,8 @@ int ceo_del_princ(char *user) {
krb5_error_code retval;
krb5_principal princ;
debug("kadmin: deleting principal %s", user);
if ((retval = krb5_parse_name(context, user, &princ))) {
com_err(prog, retval, "while parsing principal name");
return retval;

View File

@ -35,6 +35,8 @@ void ceo_krb5_init() {
set_com_err_hook(com_err_hk);
debug("krb5: initializing context");
retval = krb5_init_context(&context);
if (retval)
com_err(prog, retval, "while initializing krb5");
@ -54,6 +56,8 @@ void ceo_krb5_auth(char *principal) {
krb5_get_init_creds_opt_init(&options);
memset(&creds, 0, sizeof(creds));
debug("krb5: getting TGT using keytab for %s", principal);
if ((retval = krb5_parse_name(context, principal, &princ)))
com_err(prog, retval, "while resolving user %s", admin_bind_userid);
@ -78,6 +82,8 @@ void ceo_krb5_deauth() {
krb5_error_code retval;
krb5_ccache cache;
debug("krb5: destroying credentials");
if ((retval = krb5_cc_default(context, &cache)))
com_err(prog, retval, "while resolving credentials cache");
@ -86,6 +92,7 @@ void ceo_krb5_deauth() {
}
void ceo_krb5_cleanup() {
debug("krb5: cleaning up");
krb5_free_context(context);
}