Lines Matching full:handle
63 get_init_creds(kadm5_server_handle_t handle, krb5_principal client,
68 gic_iter(kadm5_server_handle_t handle, enum init_type init_type,
76 setup_gss(kadm5_server_handle_t handle, kadm5_config_params *params_in,
80 rpc_auth(kadm5_server_handle_t handle, kadm5_config_params *params_in,
142 free_handle(kadm5_server_handle_t handle) in free_handle() argument
148 if (handle == NULL) in free_handle()
151 if (handle->destroy_cache && handle->cache_name != NULL) { in free_handle()
152 ret = krb5_cc_resolve(handle->context, handle->cache_name, &ccache); in free_handle()
154 ret = krb5_cc_destroy(handle->context, ccache); in free_handle()
156 free(handle->cache_name); in free_handle()
157 (void)gss_release_cred(&minor_stat, &handle->cred); in free_handle()
158 if (handle->clnt != NULL && handle->clnt->cl_auth != NULL) in free_handle()
159 AUTH_DESTROY(handle->clnt->cl_auth); in free_handle()
160 if (handle->clnt != NULL) in free_handle()
161 clnt_destroy(handle->clnt); in free_handle()
162 if (handle->client_socket != -1) in free_handle()
163 close(handle->client_socket); in free_handle()
164 free(handle->lhandle); in free_handle()
165 kadm5_free_config_params(handle->context, &handle->params); in free_handle()
166 free(handle); in free_handle()
185 kadm5_server_handle_t handle = NULL; in init_any() local
200 handle = k5alloc(sizeof(*handle), &code); in init_any()
201 if (handle == NULL) in init_any()
203 handle->lhandle = k5alloc(sizeof(*handle), &code); in init_any()
204 if (handle->lhandle == NULL) in init_any()
207 handle->magic_number = KADM5_SERVER_HANDLE_MAGIC; in init_any()
208 handle->struct_version = struct_version; in init_any()
209 handle->api_version = api_version; in init_any()
210 handle->clnt = 0; in init_any()
211 handle->client_socket = -1; in init_any()
212 handle->cache_name = 0; in init_any()
213 handle->destroy_cache = 0; in init_any()
214 handle->context = 0; in init_any()
215 handle->cred = GSS_C_NO_CREDENTIAL; in init_any()
216 *handle->lhandle = *handle; in init_any()
217 handle->lhandle->api_version = KADM5_API_VERSION_4; in init_any()
218 handle->lhandle->struct_version = KADM5_STRUCT_VERSION; in init_any()
219 handle->lhandle->lhandle = handle->lhandle; in init_any()
221 handle->context = context; in init_any()
225 code = kadm5_get_config_params(handle->context, 0, params_in, in init_any()
226 &handle->params); in init_any()
234 if ((handle->params.mask & REQUIRED_PARAMS) != REQUIRED_PARAMS) { in init_any()
246 code = krb5_parse_name(handle->context, client_name, &client); in init_any()
258 code = get_init_creds(handle, client, init_type, pass, ccache_in, in init_any()
259 service_name, handle->params.realm, &server); in init_any()
269 port = handle->params.iprop_port; in init_any()
273 port = handle->params.kadmind_port; in init_any()
278 code = connect_to_server(handle->params.admin_server, port, &fd); in init_any()
282 handle->clnt = clnttcp_create(NULL, rpc_prog, rpc_vers, &fd, 0, 0); in init_any()
283 if (handle->clnt == NULL) { in init_any()
294 (void)clnt_control(handle->clnt, CLSET_TIMEOUT, &timeout); in init_any()
296 handle->client_socket = fd; in init_any()
297 handle->lhandle->clnt = handle->clnt; in init_any()
298 handle->lhandle->client_socket = fd; in init_any()
304 code = setup_gss(handle, params_in, in init_any()
315 *server_handle = handle; in init_any()
316 handle = NULL; in init_any()
320 if (init_2(&handle->api_version, &r, handle->clnt)) { in init_any()
323 clnt_perror(handle->clnt, "init_2 null resp"); in init_any()
329 handle->api_version == KADM5_API_VERSION_4) { in init_any()
330 handle->api_version = KADM5_API_VERSION_3; in init_any()
332 if (init_2(&handle->api_version, &r, handle->clnt)) { in init_any()
339 handle->api_version == KADM5_API_VERSION_3) { in init_any()
340 handle->api_version = KADM5_API_VERSION_2; in init_any()
342 if (init_2(&handle->api_version, &r, handle->clnt)) { in init_any()
352 *server_handle = handle; in init_any()
353 handle = NULL; in init_any()
358 (void)free_handle(handle); in init_any()
366 get_init_creds(kadm5_server_handle_t handle, krb5_principal client, in get_init_creds() argument
383 if (asprintf(&handle->cache_name, "%s:%s", in get_init_creds()
384 krb5_cc_get_type(handle->context, ccache), in get_init_creds()
385 krb5_cc_get_name(handle->context, ccache)) < 0) { in get_init_creds()
386 handle->cache_name = NULL; in get_init_creds()
393 if (asprintf(&handle->cache_name, "MEMORY:kadm5_%u", counter++) < 0) { in get_init_creds()
394 handle->cache_name = NULL; in get_init_creds()
398 code = krb5_cc_resolve(handle->context, handle->cache_name, in get_init_creds()
403 code = krb5_cc_initialize (handle->context, ccache, client); in get_init_creds()
407 handle->destroy_cache = 1; in get_init_creds()
409 handle->lhandle->cache_name = handle->cache_name; in get_init_creds()
412 code = gic_iter(handle, init_type, ccache, client, pass, svcname, realm, in get_init_creds()
417 code = kadm5_get_admin_service_name(handle->context, in get_init_creds()
418 handle->params.realm, in get_init_creds()
422 code = gic_iter(handle, init_type, ccache, client, pass, svcbuf, realm, in get_init_creds()
432 krb5_cc_close(handle->context, ccache); in get_init_creds()
439 gic_iter(kadm5_server_handle_t handle, enum init_type init_type, in gic_iter() argument
450 ctx = handle->context; in gic_iter()
565 setup_gss(kadm5_server_handle_t handle, kadm5_config_params *params_in, in setup_gss() argument
579 gssstat = gss_krb5_ccache_name(&minor_stat, handle->cache_name, in setup_gss()
607 &handle->cred, NULL, NULL); in setup_gss()
612 * Do actual creation of RPC auth handle. Implements auth flavor in setup_gss()
615 rpc_auth(handle, params_in, handle->cred, gss_target); in setup_gss()
637 if (handle->clnt->cl_auth == NULL) { in setup_gss()
643 /* Create RPC auth handle. Do auth flavor fallback if needed. */
645 rpc_auth(kadm5_server_handle_t handle, kadm5_config_params *params_in, in rpc_auth() argument
664 handle->clnt->cl_auth = authgss_create(handle->clnt, in rpc_auth()
666 if (handle->clnt->cl_auth != NULL) in rpc_auth()
674 handle->clnt->cl_auth = auth_gssapi_create(handle->clnt, in rpc_auth()
708 int _kadm5_check_handle(void *handle) in _kadm5_check_handle() argument
710 CHECK_HANDLE(handle); in _kadm5_check_handle()
724 kadm5_init_iprop(void *handle, char **db_args) in kadm5_init_iprop() argument