s3-dcerpc: remove auth_data_free_func
authorSimo Sorce <idra@samba.org>
Fri, 3 Sep 2010 20:33:45 +0000 (16:33 -0400)
committerSimo Sorce <idra@samba.org>
Fri, 17 Sep 2010 14:59:47 +0000 (10:59 -0400)
Everything is using a talloc pointer now, no need to have an
accessor function to free data anymore.

source3/include/ntdomain.h
source3/rpc_server/rpc_ncacn_np.c
source3/rpc_server/srv_pipe.c

index b0a462399f8ff4fbb1551652e4b063e234c1f7b8..ba4f3928d68a87809e10d08e7ef54459079931d4 100644 (file)
@@ -107,8 +107,6 @@ struct pipe_auth_data {
        char *domain;
        char *user_name;
        DATA_BLOB user_session_key;
-
-       void (*auth_data_free_func)(struct pipe_auth_data *);
 };
 
 /*
index ea65e042abfb6531a9866bba02a8410ea8f2a12d..cbf5248e82d0fc2433e03a4867ea6f286111b9db 100644 (file)
@@ -95,9 +95,7 @@ int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
                return False;
        }
 
-       if (p->auth.auth_data_free_func) {
-               (*p->auth.auth_data_free_func)(&p->auth);
-       }
+       TALLOC_FREE(p->auth.auth_ctx);
 
        free_pipe_rpc_context_internal( p->contexts );
 
index 1e7d0c95e623a7d0508af64c7adf6378304b674d..3595e324ba7b9e89d24b137ae761fc37010e3671 100644 (file)
@@ -86,11 +86,6 @@ static void dump_pdu_region(const char *name, int v,
        TALLOC_FREE(fname);
 }
 
-static void free_pipe_auth_data(struct pipe_auth_data *auth)
-{
-       TALLOC_FREE(auth->auth_ctx);
-}
-
 static DATA_BLOB generic_session_key(void)
 {
        return data_blob("SystemLibraryDTC", 16);
@@ -269,7 +264,7 @@ static bool setup_bind_nak(struct pipes_struct *p, struct ncacn_packet *pkt)
        p->out_data.data_sent_length = 0;
        p->out_data.current_pdu_sent = 0;
 
-       free_pipe_auth_data(&p->auth);
+       TALLOC_FREE(p->auth.auth_ctx);
        p->auth.auth_level = DCERPC_AUTH_LEVEL_NONE;
        p->auth.auth_type = DCERPC_AUTH_TYPE_NONE;
        p->pipe_bound = False;
@@ -444,7 +439,6 @@ static bool pipe_spnego_auth_bind(struct pipes_struct *p,
        talloc_steal(mem_ctx, response->data);
 
        p->auth.auth_ctx = spnego_ctx;
-       p->auth.auth_data_free_func = &free_pipe_auth_data;
        p->auth.auth_type = DCERPC_AUTH_TYPE_SPNEGO;
 
        DEBUG(10, ("SPNEGO auth started\n"));
@@ -565,7 +559,6 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p,
 
        /* We're finished with this bind - no more packets. */
        p->auth.auth_ctx = schannel_auth;
-       p->auth.auth_data_free_func = &free_pipe_auth_data;
        p->auth.auth_type = DCERPC_AUTH_TYPE_SCHANNEL;
 
        p->pipe_bound = True;
@@ -610,7 +603,6 @@ static bool pipe_ntlmssp_auth_bind(struct pipes_struct *p,
        talloc_steal(mem_ctx, response->data);
 
        p->auth.auth_ctx = ntlmssp_state;
-       p->auth.auth_data_free_func = &free_pipe_auth_data;
        p->auth.auth_type = DCERPC_AUTH_TYPE_NTLMSSP;
 
        DEBUG(10, (__location__ ": NTLMSSP auth started\n"));
@@ -722,7 +714,6 @@ static bool pipe_gssapi_auth_bind(struct pipes_struct *p,
        talloc_steal(mem_ctx, response->data);
 
        p->auth.auth_ctx = gse_ctx;
-       p->auth.auth_data_free_func = &free_pipe_auth_data;
        p->auth.auth_type = DCERPC_AUTH_TYPE_KRB5;
 
        DEBUG(10, ("KRB5 auth started\n"));
@@ -1263,7 +1254,7 @@ bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt)
 
 err:
 
-       free_pipe_auth_data(&p->auth);
+       TALLOC_FREE(p->auth.auth_ctx);
        return false;
 }