summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/credentials/credentials_krb5.c14
-rw-r--r--source4/auth/gensec/gensec_gssapi.c3
-rw-r--r--source4/auth/gensec/gensec_krb5.c4
-rw-r--r--source4/auth/kerberos/kerberos_util.c12
-rw-r--r--source4/auth/kerberos/krb5_init_context.c9
5 files changed, 17 insertions, 25 deletions
diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c
index 29b70d9a53..7d53caddfa 100644
--- a/source4/auth/credentials/credentials_krb5.c
+++ b/source4/auth/credentials/credentials_krb5.c
@@ -104,16 +104,15 @@ int cli_credentials_set_from_ccache(struct cli_credentials *cred,
}
/* Free a memory ccache */
-static int free_mccache(void *ptr) {
- struct ccache_container *ccc = ptr;
+static int free_mccache(struct ccache_container *ccc)
+{
krb5_cc_destroy(ccc->smb_krb5_context->krb5_context, ccc->ccache);
return 0;
}
/* Free a disk-based ccache */
-static int free_dccache(void *ptr) {
- struct ccache_container *ccc = ptr;
+static int free_dccache(struct ccache_container *ccc) {
krb5_cc_close(ccc->smb_krb5_context->krb5_context, ccc->ccache);
return 0;
@@ -273,11 +272,10 @@ int cli_credentials_get_ccache(struct cli_credentials *cred,
return ret;
}
-static int free_gssapi_creds(void *ptr) {
+static int free_gssapi_creds(struct gssapi_creds_container *gcc)
+{
OM_uint32 min_stat, maj_stat;
- struct gssapi_creds_container *gcc = ptr;
- maj_stat = gss_release_cred(&min_stat,
- &gcc->creds);
+ maj_stat = gss_release_cred(&min_stat, &gcc->creds);
return 0;
}
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 070e83e97c..270ae37703 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -95,9 +95,8 @@ static char *gssapi_error_string(TALLOC_CTX *mem_ctx,
}
-static int gensec_gssapi_destory(void *ptr)
+static int gensec_gssapi_destory(struct gensec_gssapi_state *gensec_gssapi_state)
{
- struct gensec_gssapi_state *gensec_gssapi_state = ptr;
OM_uint32 maj_stat, min_stat;
if (gensec_gssapi_state->delegated_cred_handle != GSS_C_NO_CREDENTIAL) {
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index abb46ab7f7..918950302e 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -54,10 +54,8 @@ struct gensec_krb5_state {
BOOL gssapi;
};
-static int gensec_krb5_destroy(void *ptr)
+static int gensec_krb5_destroy(struct gensec_krb5_state *gensec_krb5_state)
{
- struct gensec_krb5_state *gensec_krb5_state = ptr;
-
if (!gensec_krb5_state->smb_krb5_context) {
/* We can't clean anything else up unless we started up this far */
return 0;
diff --git a/source4/auth/kerberos/kerberos_util.c b/source4/auth/kerberos/kerberos_util.c
index 113f41a35f..413bef822b 100644
--- a/source4/auth/kerberos/kerberos_util.c
+++ b/source4/auth/kerberos/kerberos_util.c
@@ -31,8 +31,8 @@ struct principal_container {
krb5_principal principal;
};
-static int free_principal(void *ptr) {
- struct principal_container *pc = ptr;
+static int free_principal(struct principal_container *pc)
+{
/* current heimdal - 0.6.3, which we need anyway, fixes segfaults here */
krb5_free_principal(pc->smb_krb5_context->krb5_context, pc->principal);
@@ -227,8 +227,8 @@ krb5_error_code principal_from_credentials(TALLOC_CTX *parent_ctx,
return 0;
}
-static int free_keytab(void *ptr) {
- struct keytab_container *ktc = ptr;
+static int free_keytab(struct keytab_container *ktc)
+{
krb5_kt_close(ktc->smb_krb5_context->krb5_context, ktc->keytab);
return 0;
@@ -265,8 +265,8 @@ struct enctypes_container {
krb5_enctype *enctypes;
};
-static int free_enctypes(void *ptr) {
- struct enctypes_container *etc = ptr;
+static int free_enctypes(struct enctypes_container *etc)
+{
free_kerberos_etypes(etc->smb_krb5_context->krb5_context, etc->enctypes);
return 0;
}
diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c
index aefa8fbfbc..fa2975a647 100644
--- a/source4/auth/kerberos/krb5_init_context.c
+++ b/source4/auth/kerberos/krb5_init_context.c
@@ -47,21 +47,18 @@ struct smb_krb5_socket {
krb5_krbhst_info *hi;
};
-static int smb_krb5_context_destroy_1(void *ptr)
+static int smb_krb5_context_destroy_1(struct smb_krb5_context *ctx)
{
- struct smb_krb5_context *ctx = ptr;
krb5_free_context(ctx->krb5_context);
return 0;
}
-static int smb_krb5_context_destroy_2(void *ptr)
+static int smb_krb5_context_destroy_2(struct smb_krb5_context *ctx)
{
- struct smb_krb5_context *ctx = ptr;
-
/* Otherwise krb5_free_context will try and close what we have already free()ed */
krb5_set_warn_dest(ctx->krb5_context, NULL);
krb5_closelog(ctx->krb5_context, ctx->logf);
- smb_krb5_context_destroy_1(ptr);
+ smb_krb5_context_destroy_1(ctx);
return 0;
}