summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-06-09 21:57:05 +0200
committerStefan Metzmacher <metze@samba.org>2008-07-28 14:09:46 +0200
commit0251096a89d9740f6bf2dfcf41594957424f887d (patch)
tree34a1e50a2adc7ccc5bcd15a323773612339d8397 /source4
parent8623e2cc4ca3b7fefcdc943c1da8a89b805f5d29 (diff)
downloadsamba-0251096a89d9740f6bf2dfcf41594957424f887d.tar.gz
samba-0251096a89d9740f6bf2dfcf41594957424f887d.tar.bz2
samba-0251096a89d9740f6bf2dfcf41594957424f887d.zip
smb2srv: sign SMB2 Logoff replies
metze (This used to be commit 2844e361730a6bc640ea89d0e10059deca1ca867)
Diffstat (limited to 'source4')
-rw-r--r--source4/smb_server/smb2/sesssetup.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source4/smb_server/smb2/sesssetup.c b/source4/smb_server/smb2/sesssetup.c
index 6e3e963794..9f8765d6e9 100644
--- a/source4/smb_server/smb2/sesssetup.c
+++ b/source4/smb_server/smb2/sesssetup.c
@@ -224,11 +224,25 @@ void smb2srv_sesssetup_recv(struct smb2srv_request *req)
smb2srv_sesssetup_backend(req, io);
}
-static NTSTATUS smb2srv_logoff_backend(struct smb2srv_request *req)
+static int smb2srv_cleanup_session_destructor(struct smbsrv_session **session)
{
/* TODO: call ntvfs backends to close file of this session */
- talloc_free(req->session);
- req->session = NULL;
+ DEBUG(0,("free session[%p]\n", *session));
+ talloc_free(*session);
+ return 0;
+}
+
+static NTSTATUS smb2srv_logoff_backend(struct smb2srv_request *req)
+{
+ struct smbsrv_session **session_ptr;
+
+ /* we need to destroy the session after sending the reply */
+ session_ptr = talloc(req, struct smbsrv_session *);
+ NT_STATUS_HAVE_NO_MEMORY(session_ptr);
+
+ *session_ptr = req->session;
+ talloc_set_destructor(session_ptr, smb2srv_cleanup_session_destructor);
+
return NT_STATUS_OK;
}