+Tue Oct 14 21:06:16 1997 Ezra Peisach <epeisach@mit.edu>
+
+ * server_stubs.c (CHANGEPW_SERVICE): Modify to free allocated
+ memory in request.
+ (setup_gss_names): Free memory in case of failure.
+ (chrand_principal_1): Call free_server_handle for failure
+ cleanup.
+
+ * ovsec_kadmd.c (main): Cleanup memory by calling acl_finish,
+ gss_release_name, and krb5_free_context
+
Tue Jul 1 02:36:55 1997 Tom Yu <tlyu@mit.edu>
* kadm_rpc_svc.c, server_stubs.c: Add support for setv4key.
kadm_svc_run();
krb5_klog_syslog(LOG_INFO, "finished, exiting");
+
+ /* Clean up memory, etc */
kadm5_destroy(global_server_handle);
close(s);
+ acl_finish(context, 0);
+ if(gss_changepw_name) {
+ (void) gss_release_name(&OMret, &gss_changepw_name);
+ }
+ if(gss_oldchangepw_name) {
+ (void) gss_release_name(&OMret, &gss_oldchangepw_name);
+ }
+ for(s = 0 ; s < 4; s++) {
+ if (names[s].name) {
+ free(names[s].name);
+ }
+ }
+
krb5_klog_close();
+ krb5_free_context(context);
exit(2);
}
{
OM_uint32 gssstat, minor_stat;
gss_buffer_desc msg;
- int msg_ctx;
+ OM_uint32 msg_ctx;
msg_ctx = 0;
while (1) {
extern void * global_server_handle;
#define CHANGEPW_SERVICE(rqstp) \
- (cmp_gss_names(acceptor_name(rqstp->rq_svccred), gss_changepw_name) |\
+ (cmp_gss_names_rel_1(acceptor_name(rqstp->rq_svccred), gss_changepw_name) |\
(gss_oldchangepw_name && \
- cmp_gss_names(acceptor_name(rqstp->rq_svccred), \
+ cmp_gss_names_rel_1(acceptor_name(rqstp->rq_svccred), \
gss_oldchangepw_name)))
int cmp_gss_names(gss_name_t n1, gss_name_t n2)
return(equal);
}
+/* Does a comparison of the names and then releases the first entity */
+/* For use above in CHANGEPW_SERVICE */
+int cmp_gss_names_rel_1(gss_name_t n1, gss_name_t n2)
+{
+ OM_uint32 min_stat;
+ int ret;
+
+ ret = cmp_gss_names(n1, n2);
+ if (n1) (void) gss_release_name(&min_stat, &n1);
+ return ret;
+}
+
/*
* Function check_handle
*
NULL, NULL);
if (maj_stat != GSS_S_COMPLETE) {
gss_release_buffer(&min_stat, client_name);
+ gss_release_name(&min_stat, &server_gss_name);
return -1;
}
if (gss_name_to_string(server_gss_name, server_name) != 0) {
gss_release_buffer(&min_stat, client_name);
+ gss_release_name(&min_stat, &server_gss_name);
return -1;
}
+ gss_release_name(&min_stat, &server_gss_name);
return 0;
}
if (setup_gss_names(rqstp, &client_name, &service_name) < 0) {
ret.code = KADM5_FAILURE;
+ free_server_handle(handle);
return &ret;
}
krb5_unparse_name(handle->context, arg->princ, &prime_arg);