mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r12114: - smb2_keepalive() acts on the smb2_transport
- smb2_logoff() acts on the smb2_session
metze
(This used to be commit ae1ca2bb4a
)
This commit is contained in:
parent
3edfa552a2
commit
89f5d66dfe
@ -28,11 +28,11 @@
|
||||
/*
|
||||
send a keepalive request
|
||||
*/
|
||||
struct smb2_request *smb2_keepalive_send(struct smb2_tree *tree)
|
||||
struct smb2_request *smb2_keepalive_send(struct smb2_transport *transport)
|
||||
{
|
||||
struct smb2_request *req;
|
||||
|
||||
req = smb2_request_init_tree(tree, SMB2_OP_KEEPALIVE, 0x04, 0);
|
||||
req = smb2_request_init(transport, SMB2_OP_KEEPALIVE, 0x04, 0);
|
||||
if (req == NULL) return NULL;
|
||||
|
||||
SSVAL(req->out.body, 0x02, 0);
|
||||
@ -60,8 +60,8 @@ NTSTATUS smb2_keepalive_recv(struct smb2_request *req)
|
||||
/*
|
||||
sync keepalive request
|
||||
*/
|
||||
NTSTATUS smb2_keepalive(struct smb2_tree *tree)
|
||||
NTSTATUS smb2_keepalive(struct smb2_transport *transport)
|
||||
{
|
||||
struct smb2_request *req = smb2_keepalive_send(tree);
|
||||
struct smb2_request *req = smb2_keepalive_send(transport);
|
||||
return smb2_keepalive_recv(req);
|
||||
}
|
||||
|
@ -28,13 +28,15 @@
|
||||
/*
|
||||
send a logoff request
|
||||
*/
|
||||
struct smb2_request *smb2_logoff_send(struct smb2_tree *tree)
|
||||
struct smb2_request *smb2_logoff_send(struct smb2_session *session)
|
||||
{
|
||||
struct smb2_request *req;
|
||||
|
||||
req = smb2_request_init_tree(tree, SMB2_OP_LOGOFF, 0x04, 0);
|
||||
req = smb2_request_init(session->transport, SMB2_OP_LOGOFF, 0x04, 0);
|
||||
if (req == NULL) return NULL;
|
||||
|
||||
SBVAL(req->out.hdr, SMB2_HDR_UID, session->uid);
|
||||
|
||||
SSVAL(req->out.body, 0x02, 0);
|
||||
|
||||
smb2_transport_send(req);
|
||||
@ -60,8 +62,8 @@ NTSTATUS smb2_logoff_recv(struct smb2_request *req)
|
||||
/*
|
||||
sync logoff request
|
||||
*/
|
||||
NTSTATUS smb2_logoff(struct smb2_tree *tree)
|
||||
NTSTATUS smb2_logoff(struct smb2_session *session)
|
||||
{
|
||||
struct smb2_request *req = smb2_logoff_send(tree);
|
||||
struct smb2_request *req = smb2_logoff_send(session);
|
||||
return smb2_logoff_recv(req);
|
||||
}
|
||||
|
@ -216,19 +216,19 @@ BOOL torture_smb2_connect(void)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = smb2_logoff(tree);
|
||||
status = smb2_logoff(tree->session);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("Logoff failed - %s\n", nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = smb2_logoff(tree);
|
||||
status = smb2_logoff(tree->session);
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_USER_SESSION_DELETED)) {
|
||||
printf("Logoff should have disabled session - %s\n", nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = smb2_keepalive(tree);
|
||||
status = smb2_keepalive(tree->session->transport);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("keepalive failed? - %s\n", nt_errstr(status));
|
||||
return False;
|
||||
|
Loading…
Reference in New Issue
Block a user