diff options
author | Volker Lendecke <vl@samba.org> | 2008-04-20 13:51:46 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-04-20 14:08:16 +0200 |
commit | e73e8297f5484b6c7f525917679414c09a145cf0 (patch) | |
tree | ad69021ee87c51500ddafbf3fc9aad96e05243d9 /source3/libsmb | |
parent | 33592bdcb97c05a85a9c5a8e11b351d63c326f0e (diff) | |
download | samba-e73e8297f5484b6c7f525917679414c09a145cf0.tar.gz samba-e73e8297f5484b6c7f525917679414c09a145cf0.tar.bz2 samba-e73e8297f5484b6c7f525917679414c09a145cf0.zip |
Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
(This used to be commit 99fc3283c4ecc791f5a242bd1983b4352ce3e6cf)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 48 | ||||
-rw-r--r-- | source3/libsmb/libsmb_dir.c | 2 | ||||
-rw-r--r-- | source3/libsmb/passchange.c | 2 |
3 files changed, 7 insertions, 45 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index ef2c2639cd..e64b6fa278 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -617,54 +617,16 @@ struct cli_state *cli_initialise(void) } /**************************************************************************** - External interface. - Close an open named pipe over SMB. Free any authentication data. - Returns false if the cli_close call failed. - ****************************************************************************/ - -bool cli_rpc_pipe_close(struct rpc_pipe_client *cli) -{ - bool ret; - - if (!cli) { - return false; - } - - ret = cli_close(cli->cli, cli->fnum); - - if (!ret) { - DEBUG(1,("cli_rpc_pipe_close: cli_close failed on pipe %s, " - "fnum 0x%x " - "to machine %s. Error was %s\n", - cli->pipe_name, - (int) cli->fnum, - cli->desthost, - cli_errstr(cli->cli))); - } - - if (cli->auth.cli_auth_data_free_func) { - (*cli->auth.cli_auth_data_free_func)(&cli->auth); - } - - DEBUG(10,("cli_rpc_pipe_close: closed pipe %s to machine %s\n", - cli->pipe_name, cli->desthost )); - - DLIST_REMOVE(cli->cli->pipe_list, cli); - talloc_destroy(cli); - return ret; -} - -/**************************************************************************** Close all pipes open on this session. ****************************************************************************/ void cli_nt_pipes_close(struct cli_state *cli) { - struct rpc_pipe_client *cp, *next; - - for (cp = cli->pipe_list; cp; cp = next) { - next = cp->next; - cli_rpc_pipe_close(cp); + while (cli->pipe_list != NULL) { + /* + * No TALLOC_FREE here! + */ + talloc_free(cli->pipe_list); } } diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index 612a8772c0..aea4f103b6 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -319,7 +319,7 @@ net_share_enum_rpc(struct cli_state *cli, done: /* Close the server service pipe */ - cli_rpc_pipe_close(pipe_hnd); + TALLOC_FREE(pipe_hnd); /* Tell 'em if it worked */ return W_ERROR_IS_OK(result) ? 0 : -1; diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index 2f9a87dee4..8f7cbf265e 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -196,7 +196,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam } /* OK, that failed, so try again... */ - cli_rpc_pipe_close(pipe_hnd); + TALLOC_FREE(pipe_hnd); /* Try anonymous NTLMSSP... */ cli_init_creds(cli, "", "", NULL); |