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 #if !defined(lint) && !defined(__CODECENTER__)
26 static char *rcsid
= "$Header$";
28 #include "server_internal.h"
29 #include <kadm5/admin.h>
33 kadm5_free_policy_ent(void *server_handle
, kadm5_policy_ent_t val
)
35 kadm5_server_handle_t handle
= server_handle
;
37 _KADM5_CHECK_HANDLE(server_handle
);
42 if (handle
->api_version
== KADM5_API_VERSION_1
)
49 kadm5_free_name_list(void *server_handle
, char **names
, int count
)
51 _KADM5_CHECK_HANDLE(server_handle
);
59 /* XXX this ought to be in libkrb5.a, but isn't */
60 kadm5_ret_t
krb5_free_key_data_contents(context
, key
)
66 idx
= (key
->key_data_ver
== 1 ? 1 : 2);
67 for (i
= 0; i
< idx
; i
++) {
68 if (key
->key_data_contents
[i
]) {
69 memset(key
->key_data_contents
[i
], 0, key
->key_data_length
[i
]);
70 free(key
->key_data_contents
[i
]);
76 kadm5_ret_t
kadm5_free_key_data(void *server_handle
,
77 krb5_int16
*n_key_data
,
78 krb5_key_data
*key_data
)
80 kadm5_server_handle_t handle
= server_handle
;
81 int i
, nkeys
= (int) *n_key_data
;
83 _KADM5_CHECK_HANDLE(server_handle
);
88 for (i
= 0; i
< nkeys
; i
++)
89 krb5_free_key_data_contents(handle
->context
, &key_data
[i
]);
95 kadm5_free_principal_ent(void *server_handle
,
96 kadm5_principal_ent_t val
)
98 kadm5_server_handle_t handle
= server_handle
;
101 _KADM5_CHECK_HANDLE(server_handle
);
105 krb5_free_principal(handle
->context
, val
->principal
);
107 krb5_free_principal(handle
->context
, val
->mod_name
);
110 if (handle
->api_version
> KADM5_API_VERSION_1
) {
111 if (val
->n_key_data
) {
112 for (i
= 0; i
< val
->n_key_data
; i
++)
113 krb5_free_key_data_contents(handle
->context
,
120 while (val
->tl_data
) {
121 tl
= val
->tl_data
->tl_data_next
;
122 free(val
->tl_data
->tl_data_contents
);
129 if (handle
->api_version
== KADM5_API_VERSION_1
)