The branch, master has been updated via e84c7a2 s3-rpc_server: Use talloc for pipe_rpc_fns via 48a7166 s3-rpc_server: remove useless code via 262af47 s3-rpc_server: remove unnecessary talloc_free via 0a72744 s3-rpc_server: Remove dead code from a97fef3 s3-spoolss: Use existing handle in printer_driver_files_in_use().
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e84c7a2e26d206f38bcb94d4d1b6c854cdd4094c Author: Simo Sorce <i...@samba.org> Date: Wed Jul 27 16:40:21 2011 -0400 s3-rpc_server: Use talloc for pipe_rpc_fns Everything uses talloc in the rpc server nowadays, remove this ancient use of malloc. This also allows us to remove the free fucntion and let talloc handle it properly. Autobuild-User: Simo Sorce <i...@samba.org> Autobuild-Date: Thu Jul 28 17:41:08 CEST 2011 on sn-devel-104 commit 48a71664f21f50616749b467e6f082b6c20036a1 Author: Simo Sorce <i...@samba.org> Date: Wed Jul 27 16:30:42 2011 -0400 s3-rpc_server: remove useless code We do not reuse pies_struct so there is no reason to SERO_STRUCT() it when we are freeing it as we are done using it anyways. commit 262af4713e192ba80327c1e6607ba8f92d3cc7ea Author: Simo Sorce <i...@samba.org> Date: Wed Jul 27 16:27:17 2011 -0400 s3-rpc_server: remove unnecessary talloc_free The auth_ctx is a child of pipes_struct, and this function is a used only as a destructor on pipes_struct. So it is not really necessary to free this struct in the destructor as it will be freed soon enough anyway. commit 0a72744dd247298fe6aff160d77ae50dc97b8c4f Author: Simo Sorce <i...@samba.org> Date: Wed Jul 27 15:51:17 2011 -0400 s3-rpc_server: Remove dead code srv_str and cli_str are not used anymore. ----------------------------------------------------------------------- Summary of changes: source3/rpc_server/rpc_handles.c | 20 -------------------- source3/rpc_server/rpc_ncacn_np.c | 7 ++++--- source3/rpc_server/rpc_server.c | 16 ---------------- source3/rpc_server/srv_pipe.c | 6 +++--- 4 files changed, 7 insertions(+), 42 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c index f9251ee..87145ca 100644 --- a/source3/rpc_server/rpc_handles.c +++ b/source3/rpc_server/rpc_handles.c @@ -107,20 +107,6 @@ bool check_open_pipes(void) Close an rpc pipe. ****************************************************************************/ -static void free_pipe_rpc_context_internal(struct pipe_rpc_fns *list) -{ - struct pipe_rpc_fns *tmp = list; - struct pipe_rpc_fns *tmp2; - - while (tmp) { - tmp2 = tmp->next; - SAFE_FREE(tmp); - tmp = tmp2; - } - - return; -} - int close_internal_rpc_pipe_hnd(struct pipes_struct *p) { if (!p) { @@ -128,17 +114,11 @@ int close_internal_rpc_pipe_hnd(struct pipes_struct *p) return False; } - TALLOC_FREE(p->auth.auth_ctx); - /* Free the handles database. */ close_policy_by_pipe(p); - free_pipe_rpc_context_internal( p->contexts ); - DLIST_REMOVE(InternalPipes, p); - ZERO_STRUCTP(p); - return 0; } diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c index 2ed4a01..1080a98 100644 --- a/source3/rpc_server/rpc_ncacn_np.c +++ b/source3/rpc_server/rpc_ncacn_np.c @@ -80,10 +80,11 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, return NULL; } - context_fns = SMB_MALLOC_P(struct pipe_rpc_fns); + context_fns = talloc(p, struct pipe_rpc_fns); if (context_fns == NULL) { - DEBUG(0,("malloc() failed!\n")); - return False; + DEBUG(0,("talloc() failed!\n")); + TALLOC_FREE(p); + return NULL; } context_fns->next = context_fns->prev = NULL; diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index 269b701..2e109a5 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -934,8 +934,6 @@ static void dcerpc_ncacn_accept(struct tevent_context *ev_ctx, dcerpc_ncacn_disconnect_fn fn) { struct dcerpc_ncacn_conn *ncacn_conn; struct tevent_req *subreq; - const char *cli_str; - const char *srv_str = NULL; bool system_user = false; char *pipe_name; NTSTATUS status; @@ -1046,20 +1044,6 @@ static void dcerpc_ncacn_accept(struct tevent_context *ev_ctx, return; } - if (tsocket_address_is_inet(ncacn_conn->client, "ip")) { - cli_str = ncacn_conn->client_name; - } else { - cli_str = ""; - } - - if (ncacn_conn->server != NULL) { - if (tsocket_address_is_inet(ncacn_conn->server, "ip")) { - srv_str = ncacn_conn->server_name; - } else { - srv_str = NULL; - } - } - if (ncacn_conn->session_info == NULL) { status = auth_anonymous_session_info(ncacn_conn, &ncacn_conn->session_info); diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 233dfdf..058f1b8 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -356,10 +356,10 @@ static bool check_bind_req(struct pipes_struct *p, return false; } - context_fns = SMB_MALLOC_P(struct pipe_rpc_fns); + context_fns = talloc(p, struct pipe_rpc_fns); if (context_fns == NULL) { - DEBUG(0,("check_bind_req: malloc() failed!\n")); - return False; + DEBUG(0,("check_bind_req: talloc() failed!\n")); + return false; } context_fns->next = context_fns->prev = NULL; -- Samba Shared Repository