gssapi: fix dlsym() return value casting
Fix warnings on Windows (and possibly other platforms) but appropriately casting the return value of dlsym().
This commit is contained in:
@@ -277,28 +277,28 @@ typedef OM_uint32 GSSAPI_CALLCONV _gss_duplicate_name_t (
|
||||
gss_name_t * /* dest_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_sec_context_by_oid (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_sec_context_by_oid_t (
|
||||
OM_uint32 *minor_status,
|
||||
gss_const_ctx_id_t context_handle,
|
||||
const gss_OID desired_object,
|
||||
gss_buffer_set_t *data_set
|
||||
);
|
||||
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_oid (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_oid_t (
|
||||
OM_uint32 *minor_status,
|
||||
gss_const_cred_id_t cred,
|
||||
const gss_OID desired_object,
|
||||
gss_buffer_set_t *data_set
|
||||
);
|
||||
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_sec_context_option (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_sec_context_option_t (
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *cred_handle,
|
||||
const gss_OID desired_object,
|
||||
const gss_buffer_t value
|
||||
);
|
||||
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option_t (
|
||||
OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle,
|
||||
const gss_OID desired_object,
|
||||
@@ -306,7 +306,7 @@ typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option (
|
||||
);
|
||||
|
||||
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_pseudo_random(
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_pseudo_random_t (
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context,
|
||||
int prf_key,
|
||||
@@ -524,11 +524,11 @@ typedef struct gssapi_mech_interface_desc {
|
||||
_gss_inquire_mechs_for_name_t *gm_inquire_mechs_for_name;
|
||||
_gss_canonicalize_name_t *gm_canonicalize_name;
|
||||
_gss_duplicate_name_t *gm_duplicate_name;
|
||||
_gss_inquire_sec_context_by_oid *gm_inquire_sec_context_by_oid;
|
||||
_gss_inquire_cred_by_oid *gm_inquire_cred_by_oid;
|
||||
_gss_set_sec_context_option *gm_set_sec_context_option;
|
||||
_gss_set_cred_option *gm_set_cred_option;
|
||||
_gss_pseudo_random *gm_pseudo_random;
|
||||
_gss_inquire_sec_context_by_oid_t *gm_inquire_sec_context_by_oid;
|
||||
_gss_inquire_cred_by_oid_t *gm_inquire_cred_by_oid;
|
||||
_gss_set_sec_context_option_t *gm_set_sec_context_option;
|
||||
_gss_set_cred_option_t *gm_set_cred_option;
|
||||
_gss_pseudo_random_t *gm_pseudo_random;
|
||||
_gss_wrap_iov_t *gm_wrap_iov;
|
||||
_gss_unwrap_iov_t *gm_unwrap_iov;
|
||||
_gss_wrap_iov_length_t *gm_wrap_iov_length;
|
||||
|
@@ -164,7 +164,7 @@ _gss_string_to_oid(const char* s, gss_OID *oidp)
|
||||
|
||||
#define SYM(name) \
|
||||
do { \
|
||||
m->gm_mech.gm_ ## name = dlsym(so, "gss_" #name); \
|
||||
m->gm_mech.gm_ ## name = (_gss_##name##_t *)dlsym(so, "gss_" #name); \
|
||||
if (!m->gm_mech.gm_ ## name || \
|
||||
m->gm_mech.gm_ ##name == gss_ ## name) { \
|
||||
fprintf(stderr, "can't find symbol gss_" #name "\n"); \
|
||||
@@ -174,26 +174,26 @@ do { \
|
||||
|
||||
#define OPTSYM(name) \
|
||||
do { \
|
||||
m->gm_mech.gm_ ## name = dlsym(so, "gss_" #name); \
|
||||
m->gm_mech.gm_ ## name = (_gss_##name##_t *)dlsym(so, "gss_" #name); \
|
||||
if (m->gm_mech.gm_ ## name == gss_ ## name) \
|
||||
m->gm_mech.gm_ ## name = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define OPTSPISYM(name) \
|
||||
do { \
|
||||
m->gm_mech.gm_ ## name = dlsym(so, "gssspi_" #name); \
|
||||
m->gm_mech.gm_ ## name = (_gss_##name##_t *)dlsym(so, "gssspi_" #name); \
|
||||
} while (0)
|
||||
|
||||
#define COMPATSYM(name) \
|
||||
do { \
|
||||
m->gm_mech.gm_compat->gmc_ ## name = dlsym(so, "gss_" #name); \
|
||||
m->gm_mech.gm_compat->gmc_ ## name = (_gss_##name##_t *)dlsym(so, "gss_" #name); \
|
||||
if (m->gm_mech.gm_compat->gmc_ ## name == gss_ ## name) \
|
||||
m->gm_mech.gm_compat->gmc_ ## name = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define COMPATSPISYM(name) \
|
||||
do { \
|
||||
m->gm_mech.gm_compat->gmc_ ## name = dlsym(so, "gssspi_" #name);\
|
||||
m->gm_mech.gm_compat->gmc_ ## name = (_gss_##name##_t *)dlsym(so, "gssspi_" #name); \
|
||||
if (m->gm_mech.gm_compat->gmc_ ## name == gss_ ## name) \
|
||||
m->gm_mech.gm_compat->gmc_ ## name = NULL; \
|
||||
} while (0)
|
||||
@@ -405,7 +405,7 @@ _gss_load_mech(void)
|
||||
OPTSYM(duplicate_cred);
|
||||
OPTSPISYM(authorize_localname);
|
||||
|
||||
mi = dlsym(so, "gss_mo_init");
|
||||
mi = (_gss_mo_init *)dlsym(so, "gss_mo_init");
|
||||
if (mi != NULL) {
|
||||
major_status = mi(&minor_status, mech_oid,
|
||||
&m->gm_mech.gm_mo, &m->gm_mech.gm_mo_num);
|
||||
|
Reference in New Issue
Block a user