2 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4 * Openvision retains the copyright to derivative works of
5 * this source code. Do *NOT* create a derivative of this
6 * source code before consulting with your legal department.
7 * Do *NOT* integrate *ANY* of this source code into another
8 * product before consulting with your legal department.
10 * For further information, read the top-level Openvision
11 * copyright which is contained in the top-level MIT Kerberos
14 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
20 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
25 static char *rcsid
= "$Header$";
26 #include "server_internal.h"
27 #include <kadm5/admin.h>
31 kadm5_free_policy_ent(void *server_handle
, kadm5_policy_ent_t val
)
33 kadm5_server_handle_t handle
= server_handle
;
35 _KADM5_CHECK_HANDLE(server_handle
);
39 if (handle
->api_version
== KADM5_API_VERSION_1
)
46 kadm5_free_name_list(void *server_handle
, char **names
, int count
)
48 _KADM5_CHECK_HANDLE(server_handle
);
56 /* XXX this ought to be in libkrb5.a, but isn't */
57 kadm5_ret_t
krb5_free_key_data_contents(context
, key
)
63 idx
= (key
->key_data_ver
== 1 ? 1 : 2);
64 for (i
= 0; i
< idx
; i
++) {
65 if (key
->key_data_contents
[i
]) {
66 memset(key
->key_data_contents
[i
], 0, key
->key_data_length
[i
]);
67 free(key
->key_data_contents
[i
]);
73 kadm5_ret_t
kadm5_free_key_data(void *server_handle
,
74 krb5_int16
*n_key_data
,
75 krb5_key_data
*key_data
)
77 kadm5_server_handle_t handle
= server_handle
;
78 int i
, nkeys
= (int) *n_key_data
;
80 _KADM5_CHECK_HANDLE(server_handle
);
85 for (i
= 0; i
< nkeys
; i
++)
86 krb5_free_key_data_contents(handle
->context
, &key_data
[i
]);
92 kadm5_free_principal_ent(void *server_handle
,
93 kadm5_principal_ent_t val
)
95 kadm5_server_handle_t handle
= server_handle
;
98 _KADM5_CHECK_HANDLE(server_handle
);
102 krb5_free_principal(handle
->context
, val
->principal
);
104 krb5_free_principal(handle
->context
, val
->mod_name
);
106 if (handle
->api_version
> KADM5_API_VERSION_1
) {
107 if (val
->n_key_data
) {
108 for (i
= 0; i
< val
->n_key_data
; i
++)
109 krb5_free_key_data_contents(handle
->context
,
116 while (val
->tl_data
) {
117 tl
= val
->tl_data
->tl_data_next
;
118 free(val
->tl_data
->tl_data_contents
);
125 if (handle
->api_version
== KADM5_API_VERSION_1
)