kadm5_server_handle_t handle;
kadm5_server_handle_rec orig_handle;
kadm5_policy_ent_rec pol;
- kadm5_principal_ent_t princ;
+ kadm5_principal_ent_t princ;
+ kadm5_principal_ent_rec kprinc;
krb5_keyblock *key;
krb5_principal tprinc;
krb5_context context;
orig_handle = *handle;
handle->magic_number = KADM5_STRUCT_VERSION;
krb5_parse_name(context, "testuser", &tprinc);
- ret = kadm5_get_principal(server_handle, tprinc, &princ,
+ ret = kadm5_get_principal(server_handle, tprinc, &kprinc,
KADM5_PRINCIPAL_NORMAL_MASK);
if(ret != KADM5_BAD_SERVER_HANDLE) {
fprintf(stderr, "%s -- returned -- %s\n", "get-principal",
exit(1);
}
+ princ = &kprinc;
ret = kadm5_create_principal(server_handle, princ, KADM5_PRINCIPAL, "pass");
if(ret != KADM5_BAD_SERVER_HANDLE) {
fprintf(stderr, "%s -- returned -- %s\n", "create-principal",
exit(1);
}
+ krb5_free_principal(context, tprinc);
+ krb5_free_context(context);
exit(0);
}