24#ifndef _KRB5_INTERFACE_H_
25#define _KRB5_INTERFACE_H_
43 krb5_principal *princ,
45 const char *realm, ...);
51 krb5_context context, krb5_ccache cache, krb5_principal *principal);
54 krb5_principal principal);
80 krb5_error_code code);
82 krb5_error_code (*)(krb5_context context, krb5_get_init_creds_opt **opt);
84 void (*)(krb5_context context, krb5_get_init_creds_opt *opt);
86 krb5_context context, krb5_creds *creds, krb5_principal client,
87 const char *
password, krb5_prompter_fct prompter,
void *data,
88 krb5_deltat start_time,
const char *in_tkt_service,
89 krb5_get_init_creds_opt *k5_gic_options);
91 struct _profile_t **profile);
96 krb5_principal *principal_out);
98 krb5_timestamp *timeret);
100 krb5_context context, krb5_const_principal principal,
char **
name);
102 krb5_context context, krb5_creds *creds, krb5_principal
server,
103 krb5_keytab keytab, krb5_ccache *ccache,
104 krb5_verify_init_creds_opt *
options);
106 void (*)(krb5_context context,
const char *appname,
const krb5_data *realm,
107 const char *option,
int default_value,
int *ret_value);
109 void (*)(krb5_context context,
const char *appname,
const krb5_data *realm,
110 const char *option,
const char *default_value,
char **ret_value);
114 const char *subsubname,
124#define KRB5_INTERFACE_DECLARE_FUNCTION(FUNCTION) \
126 assert(FUNCTION##_ptr); \
127 return FUNCTION##_ptr; \
133#define KRB5_INTERFACE_DECLARE_FUNCTION_PTR(FUNCTION) \
134 FUNCTION##_type FUNCTION##_ptr;
280 function =
reinterpret_cast<T
>(dlsym(lib_handle,
name));
281 if (
function ==
nullptr) {
285 log_dbg(
"Successfuly loaded function ",
name,
".");
Class representing interface to KRB5 functions.
Definition: krb5_interface.h:141
~Krb5_interface()
Destructor.
Definition: krb5_interface.cc:73
void * profile_lib_handle
Handle to the library providing profile_* functions.
Definition: krb5_interface.h:212
bool initialize()
Initialize the object by loading the libraries and setting pointers to the interface functions.
Definition: krb5_interface.cc:75
void close_libs()
Closes the libraries.
Definition: krb5_interface.cc:211
Krb5_interface()
Constructor.
Definition: krb5_interface.cc:38
bool get_function(void *lib_handle, const char *name, T &function)
Get pointer to the interface function by its name.
Definition: krb5_interface.h:279
bool load_lib(const char *name, void *&handle)
Loads single library.
Definition: krb5_interface.cc:187
void * krb5_lib_handle
Handle to the library providing krb5_* functions.
Definition: krb5_interface.h:207
void(*)(profile_t profile) profile_release_type
Definition: krb5_interface.h:117
krb5_error_code(*)(krb5_context context, krb5_ccache cache) krb5_cc_close_type
Definition: krb5_interface.h:47
void(*)(krb5_context context, krb5_creds *val) krb5_free_cred_contents_type
Definition: krb5_interface.h:69
void(*)(krb5_context context, char *val) krb5_free_string_type
Definition: krb5_interface.h:111
krb5_error_code(*)(krb5_context context, krb5_ccache cache, krb5_flags flags, krb5_creds *mcreds, krb5_creds *creds) krb5_cc_retrieve_cred_type
Definition: krb5_interface.h:63
krb5_error_code(*)(krb5_context context, krb5_get_init_creds_opt **opt) krb5_get_init_creds_opt_alloc_type
Definition: krb5_interface.h:82
void(*)(krb5_context context, const char *appname, const krb5_data *realm, const char *option, const char *default_value, char **ret_value) krb5_appdefault_string_type
Definition: krb5_interface.h:110
void(*)(krb5_context ctx, const char *msg) krb5_free_error_message_type
Definition: krb5_interface.h:73
krb5_error_code(*)(krb5_context context, krb5_ccache cache, krb5_creds *creds) krb5_cc_store_cred_type
Definition: krb5_interface.h:66
void(*)(krb5_context context, krb5_get_init_creds_opt *opt) krb5_get_init_creds_opt_free_type
Definition: krb5_interface.h:84
krb5_error_code(*)(krb5_context context, krb5_timestamp *timeret) krb5_timeofday_type
Definition: krb5_interface.h:98
const char *(*)(krb5_context ctx, krb5_error_code code) krb5_get_error_message_type
Definition: krb5_interface.h:80
krb5_error_code(*)(krb5_context context, krb5_ccache cache, krb5_flags flags, krb5_creds *creds) krb5_cc_remove_cred_type
Definition: krb5_interface.h:58
krb5_error_code(*)(krb5_context context, krb5_ccache cache, krb5_principal *principal) krb5_cc_get_principal_type
Definition: krb5_interface.h:51
void(*)(krb5_context context) krb5_free_context_type
Definition: krb5_interface.h:67
krb5_error_code(*)(krb5_context context, krb5_principal *princ, unsigned int rlen, const char *realm,...) krb5_build_principal_type
Definition: krb5_interface.h:45
void(*)(krb5_context context, char *val) krb5_free_unparsed_name_type
Definition: krb5_interface.h:76
void(*)(char *str) profile_release_string_type
Definition: krb5_interface.h:118
krb5_error_code(*)(krb5_context context, krb5_ccache *ccache) krb5_cc_default_type
Definition: krb5_interface.h:49
krb5_error_code(*)(krb5_context context, krb5_creds *creds, krb5_principal server, krb5_keytab keytab, krb5_ccache *ccache, krb5_verify_init_creds_opt *options) krb5_verify_init_creds_type
Definition: krb5_interface.h:104
krb5_error_code(*)(krb5_context context, krb5_ccache cache, krb5_principal principal) krb5_cc_initialize_type
Definition: krb5_interface.h:54
krb5_error_code(*)(krb5_context context, char **lrealm) krb5_get_default_realm_type
Definition: krb5_interface.h:78
void(*)(krb5_context context, const char *appname, const krb5_data *realm, const char *option, int default_value, int *ret_value) krb5_appdefault_boolean_type
Definition: krb5_interface.h:107
void(*)(krb5_context context, krb5_principal val) krb5_free_principal_type
Definition: krb5_interface.h:75
krb5_error_code(*)(krb5_context context, krb5_creds *creds, krb5_principal client, const char *password, krb5_prompter_fct prompter, void *data, krb5_deltat start_time, const char *in_tkt_service, krb5_get_init_creds_opt *k5_gic_options) krb5_get_init_creds_password_type
Definition: krb5_interface.h:89
krb5_error_code(*)(krb5_context context, const char *name, krb5_principal *principal_out) krb5_parse_name_type
Definition: krb5_interface.h:96
void(*)(krb5_context context, char *lrealm) krb5_free_default_realm_type
Definition: krb5_interface.h:71
long(*)(profile_t profile, const char *name, const char *subname, const char *subsubname, const char *def_val, char **ret_string) profile_get_string_type
Definition: krb5_interface.h:116
krb5_error_code(*)(krb5_context context, struct _profile_t **profile) krb5_get_profile_type
Definition: krb5_interface.h:91
krb5_error_code(*)(krb5_context context, krb5_const_principal principal, char **name) krb5_unparse_name_type
Definition: krb5_interface.h:100
krb5_error_code(*)(krb5_context *context) krb5_init_context_type
Definition: krb5_interface.h:93
#define log_dbg(...)
Definition: log_client.h:152
#define log_error(...)
Definition: log_client.h:155
static int flags[50]
Definition: hp_test1.cc:40
#define KRB5_INTERFACE_DECLARE_FUNCTION(FUNCTION)
Shortcut macro defining getter of the interfacee function.
Definition: krb5_interface.h:124
#define KRB5_INTERFACE_DECLARE_FUNCTION_PTR(FUNCTION)
Shortcut macro defining pointer to the interfacee function.
Definition: krb5_interface.h:133
Functions related to handling of plugins and other dynamically loaded libraries.
static char * password
Definition: mysql_secure_installation.cc:58
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: auth_ldap_kerberos.cc:30
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
struct server server
Definition: server_struct.h:59
static const Query_options options
Definition: sql_show_processlist.cc:69
case opt name
Definition: sslopt-case.h:29