Skip to content

Commit

Permalink
s4:libcli/smb2: remove unused 'primary' argument of smb2_session_init()
Browse files Browse the repository at this point in the history
This also gets rid of a talloc_reference() usage.

Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
  • Loading branch information
metze-samba committed Jul 24, 2014
1 parent cd95937 commit 78e46d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source4/libcli/smb2/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static void smb2_connect_negprot_done(struct tevent_req *subreq)
/* This is a hack... */
smb2cli_conn_set_max_credits(transport->conn, 30);

state->session = smb2_session_init(transport, state->gensec_settings, state, true);
state->session = smb2_session_init(transport, state->gensec_settings, state);
if (tevent_req_nomem(state->session, req)) {
return;
}
Expand Down
8 changes: 2 additions & 6 deletions source4/libcli/smb2/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
struct smb2_session *smb2_session_init(struct smb2_transport *transport,
struct gensec_settings *settings,
TALLOC_CTX *parent_ctx, bool primary)
TALLOC_CTX *parent_ctx)
{
struct smb2_session *session;
NTSTATUS status;
Expand All @@ -45,11 +45,7 @@ struct smb2_session *smb2_session_init(struct smb2_transport *transport,
if (!session) {
return NULL;
}
if (primary) {
session->transport = talloc_steal(session, transport);
} else {
session->transport = talloc_reference(session, transport);
}
session->transport = talloc_steal(session, transport);

session->smbXcli = smbXcli_session_create(session, transport->conn);
if (session->smbXcli == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/smb2/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ bool torture_smb2_session_setup(struct torture_context *tctx,

session = smb2_session_init(transport,
lpcfg_gensec_settings(tctx, tctx->lp_ctx),
mem_ctx, true);
mem_ctx);

if (session == NULL) {
return false;
Expand Down

0 comments on commit 78e46d7

Please sign in to comment.