samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r15853 - in branches/SAMBA_4_0/source: auth/credential

Subject: svn commit: samba r15853 - in branches/SAMBA_4_0/source: auth/credentials auth/gensec auth/kerberos gtk/common kdc lib
From:
Date: Wed, 24 May 2006 07:32:18 +0000 GMT
Author: tridge
Date: 2006-05-24 07:32:17 +0000 (Wed, 24 May 2006)
New Revision: 15853

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15853

Log:

started the process of removing the warnings now that
talloc_set_destructor() is type safe. The end result will be lots less
use of void*, and less calls to talloc_get_type()

Modified:
   branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c
   branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
   branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c
   branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
   branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c
   branches/SAMBA_4_0/source/gtk/common/gtk_events.c
   branches/SAMBA_4_0/source/kdc/hdb-ldb.c
   branches/SAMBA_4_0/source/lib/db_wrap.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c
===================================================================
--- branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c       
2006-05-24 07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c       
2006-05-24 07:32:17 UTC (rev 15853)
@@ -104,16 +104,15 @@
 }
 
 /* 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 @@
        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;
 }
 

Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
===================================================================
--- branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c       2006-05-24 
07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c       2006-05-24 
07:32:17 UTC (rev 15853)
@@ -95,9 +95,8 @@
 }
 
 
-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) {

Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c
===================================================================
--- branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c 2006-05-24 07:31:02 UTC 
(rev 15852)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c 2006-05-24 07:32:17 UTC 
(rev 15853)
@@ -54,10 +54,8 @@
        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;

Modified: branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
===================================================================
--- branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c     2006-05-24 
07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c     2006-05-24 
07:32:17 UTC (rev 15853)
@@ -31,8 +31,8 @@
        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 @@
        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 @@
        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;
 }

Modified: branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c
===================================================================
--- branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c 2006-05-24 
07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c 2006-05-24 
07:32:17 UTC (rev 15853)
@@ -47,21 +47,18 @@
        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;
 }
 

Modified: branches/SAMBA_4_0/source/gtk/common/gtk_events.c
===================================================================
--- branches/SAMBA_4_0/source/gtk/common/gtk_events.c   2006-05-24 07:31:02 UTC 
(rev 15852)
+++ branches/SAMBA_4_0/source/gtk/common/gtk_events.c   2006-05-24 07:32:17 UTC 
(rev 15853)
@@ -34,7 +34,7 @@
  */
 static struct event_context *gtk_event_context_global;
 
-static int gtk_event_context_destructor(void *ptr)
+static int gtk_event_context_destructor(struct event_context *ev)
 {
        gtk_event_context_global = NULL;
        return 0;
@@ -83,9 +83,8 @@
 /*
   destroy an fd_event
 */
-static int gtk_event_fd_destructor(void *ptr)
+static int gtk_event_fd_destructor(struct fd_event *fde)
 {
-       struct fd_event *fde = talloc_get_type(ptr, struct fd_event);
        struct gtk_fd_event *gtk_fd = talloc_get_type(fde->additional_data,
                                                      struct gtk_fd_event);
 
@@ -212,9 +211,8 @@
 /*
   destroy a timed event
 */
-static int gtk_event_timed_destructor(void *ptr)
+static int gtk_event_timed_destructor(struct timed_event *te)
 {
-       struct timed_event *te = talloc_get_type(ptr, struct timed_event);
        struct gtk_timed_event *gtk_te = talloc_get_type(te->additional_data,
                                                         struct 
gtk_timed_event);
 
@@ -223,7 +221,7 @@
        return 0;
 }
 
-static int gtk_event_timed_deny_destructor(void *ptr)
+static int gtk_event_timed_deny_destructor(struct timed_event *te)
 {
        return -1;
 }

Modified: branches/SAMBA_4_0/source/kdc/hdb-ldb.c
===================================================================
--- branches/SAMBA_4_0/source/kdc/hdb-ldb.c     2006-05-24 07:31:02 UTC (rev 
15852)
+++ branches/SAMBA_4_0/source/kdc/hdb-ldb.c     2006-05-24 07:32:17 UTC (rev 
15853)
@@ -198,9 +198,8 @@
        return flags;
 }
 
-static int hdb_ldb_destrutor(void *ptr)
+static int hdb_ldb_destrutor(struct hdb_ldb_private *private)
 {
-    struct hdb_ldb_private *private = ptr;
     hdb_entry_ex *entry_ex = private->entry_ex;
     free_hdb_entry(&entry_ex->entry);
     return 0;

Modified: branches/SAMBA_4_0/source/lib/db_wrap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/db_wrap.c     2006-05-24 07:31:02 UTC (rev 
15852)
+++ branches/SAMBA_4_0/source/lib/db_wrap.c     2006-05-24 07:32:17 UTC (rev 
15853)
@@ -166,9 +166,8 @@
 
 
 /* destroy the last connection to a tdb */
-static int tdb_wrap_destructor(void *ctx)
+static int tdb_wrap_destructor(struct tdb_wrap *w)
 {
-       struct tdb_wrap *w = ctx;
        tdb_close(w->tdb);
        DLIST_REMOVE(tdb_list, w);
        return 0;

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r15853 - in branches/SAMBA_4_0/source: auth/credentials auth/gensec auth/kerberos gtk/common kdc lib, tridge <=