Path: blob/main/crypto/heimdal/lib/kadm5/common_glue.c
34870 views
/*1* Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233#include "kadm5_locl.h"3435RCSID("$Id$");3637#define __CALL(F, P) (*((kadm5_common_context*)server_handle)->funcs.F)P;3839kadm5_ret_t40kadm5_chpass_principal(void *server_handle,41krb5_principal princ,42const char *password)43{44return __CALL(chpass_principal, (server_handle, princ, password));45}4647kadm5_ret_t48kadm5_chpass_principal_with_key(void *server_handle,49krb5_principal princ,50int n_key_data,51krb5_key_data *key_data)52{53return __CALL(chpass_principal_with_key,54(server_handle, princ, n_key_data, key_data));55}5657kadm5_ret_t58kadm5_create_principal(void *server_handle,59kadm5_principal_ent_t princ,60uint32_t mask,61const char *password)62{63return __CALL(create_principal, (server_handle, princ, mask, password));64}6566kadm5_ret_t67kadm5_delete_principal(void *server_handle,68krb5_principal princ)69{70return __CALL(delete_principal, (server_handle, princ));71}7273kadm5_ret_t74kadm5_destroy (void *server_handle)75{76return __CALL(destroy, (server_handle));77}7879kadm5_ret_t80kadm5_flush (void *server_handle)81{82return __CALL(flush, (server_handle));83}8485kadm5_ret_t86kadm5_get_principal(void *server_handle,87krb5_principal princ,88kadm5_principal_ent_t out,89uint32_t mask)90{91return __CALL(get_principal, (server_handle, princ, out, mask));92}9394kadm5_ret_t95kadm5_modify_principal(void *server_handle,96kadm5_principal_ent_t princ,97uint32_t mask)98{99return __CALL(modify_principal, (server_handle, princ, mask));100}101102kadm5_ret_t103kadm5_randkey_principal(void *server_handle,104krb5_principal princ,105krb5_keyblock **new_keys,106int *n_keys)107{108return __CALL(randkey_principal, (server_handle, princ, new_keys, n_keys));109}110111kadm5_ret_t112kadm5_rename_principal(void *server_handle,113krb5_principal source,114krb5_principal target)115{116return __CALL(rename_principal, (server_handle, source, target));117}118119kadm5_ret_t120kadm5_get_principals(void *server_handle,121const char *expression,122char ***princs,123int *count)124{125return __CALL(get_principals, (server_handle, expression, princs, count));126}127128kadm5_ret_t129kadm5_get_privs(void *server_handle,130uint32_t *privs)131{132return __CALL(get_privs, (server_handle, privs));133}134135136