diff options
author | Luk Claes <luk@debian.org> | 2012-05-10 18:39:11 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-05-12 01:01:33 +0200 |
commit | c140c5e4590ab49c0bd8ccce791450b0dbcc74aa (patch) | |
tree | 0741438af6db97a19a9bc57dfa28af5051f14e7e /source3/libsmb | |
parent | c7a129262857ede4d4985a1c368b7066811ed2c3 (diff) | |
download | samba-c140c5e4590ab49c0bd8ccce791450b0dbcc74aa.tar.gz samba-c140c5e4590ab49c0bd8ccce791450b0dbcc74aa.tar.bz2 samba-c140c5e4590ab49c0bd8ccce791450b0dbcc74aa.zip |
s3/libsmb: Generalise cli_state in smb2 logoff calls
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/smb2cli.h | 8 | ||||
-rw-r--r-- | source3/libsmb/smb2cli_session.c | 23 |
2 files changed, 18 insertions, 13 deletions
diff --git a/source3/libsmb/smb2cli.h b/source3/libsmb/smb2cli.h index 6fa77f4ff3..bd6b131669 100644 --- a/source3/libsmb/smb2cli.h +++ b/source3/libsmb/smb2cli.h @@ -26,9 +26,13 @@ struct cli_state; struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct cli_state *cli); + struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session); NTSTATUS smb2cli_logoff_recv(struct tevent_req *req); -NTSTATUS smb2cli_logoff(struct cli_state *cli); +NTSTATUS smb2cli_logoff(struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session); struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, diff --git a/source3/libsmb/smb2cli_session.c b/source3/libsmb/smb2cli_session.c index 0de82f6d83..077ba9a52e 100644 --- a/source3/libsmb/smb2cli_session.c +++ b/source3/libsmb/smb2cli_session.c @@ -28,7 +28,6 @@ #include "../auth/ntlmssp/ntlmssp.h" struct smb2cli_logoff_state { - struct cli_state *cli; uint8_t fixed[4]; }; @@ -36,7 +35,9 @@ static void smb2cli_logoff_done(struct tevent_req *subreq); struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct cli_state *cli) + struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session) { struct tevent_req *req, *subreq; struct smb2cli_logoff_state *state; @@ -46,16 +47,15 @@ struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } - state->cli = cli; SSVAL(state->fixed, 0, 4); subreq = smb2cli_req_send(state, ev, - cli->conn, SMB2_OP_LOGOFF, + conn, SMB2_OP_LOGOFF, 0, 0, /* flags */ - cli->timeout, - cli->smb2.pid, + timeout_msec, + 0xFEFF, /* pid */ 0, /* tid */ - cli->smb2.session, + session, state->fixed, sizeof(state->fixed), NULL, 0); if (tevent_req_nomem(subreq, req)) { @@ -85,7 +85,6 @@ static void smb2cli_logoff_done(struct tevent_req *subreq) status = smb2cli_req_recv(subreq, state, &iov, expected, ARRAY_SIZE(expected)); TALLOC_FREE(subreq); - TALLOC_FREE(state->cli->smb2.session); if (tevent_req_nterror(req, status)) { return; } @@ -97,14 +96,16 @@ NTSTATUS smb2cli_logoff_recv(struct tevent_req *req) return tevent_req_simple_recv_ntstatus(req); } -NTSTATUS smb2cli_logoff(struct cli_state *cli) +NTSTATUS smb2cli_logoff(struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session) { TALLOC_CTX *frame = talloc_stackframe(); struct event_context *ev; struct tevent_req *req; NTSTATUS status = NT_STATUS_NO_MEMORY; - if (cli_has_async_calls(cli)) { + if (smbXcli_conn_has_async_calls(conn)) { /* * Can't use sync call while an async call is in flight */ @@ -115,7 +116,7 @@ NTSTATUS smb2cli_logoff(struct cli_state *cli) if (ev == NULL) { goto fail; } - req = smb2cli_logoff_send(frame, ev, cli); + req = smb2cli_logoff_send(frame, ev, conn, timeout_msec, session); if (req == NULL) { goto fail; } |