From 910d61bcd1fbfc6fc406d4384f305f5210e92d56 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 18 Nov 2005 14:13:49 +0000 Subject: r11789: - add the start of a SMB2 server - it does Negprot and SessionSetup yet the rest returns NT_STATUS_NOT_IMPLEMENTED - it's off by default, enable with: smbsrv:enable smb2 = yes - negotition in the SMB Negprot isn't supported yet - it's only tested with smbtorture SMB2-CONNECT not with vista as client metze (This used to be commit 08b31d5f618d2e416cb9812ad3a49754cd7212b8) --- source4/smb_server/smb2/smb2_server.h | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 source4/smb_server/smb2/smb2_server.h (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h new file mode 100644 index 0000000000..913c7f2eab --- /dev/null +++ b/source4/smb_server/smb2/smb2_server.h @@ -0,0 +1,50 @@ +/* + Unix SMB2 implementation. + + Copyright (C) Stefan Metzmacher 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* the context for a single SMB2 request. This is passed to any request-context + functions */ +struct smb2srv_request { + /* the smbsrv_connection needs a list of requests queued for send */ + struct smb2srv_request *next, *prev; + + /* the server_context contains all context specific to this SMB socket */ + struct smbsrv_connection *smb_conn; + + /* the smbsrv_session for the request */ + struct smbsrv_session *session; + + /* the smbsrv_tcon for the request */ + struct smbsrv_tcon *tcon; + + /* the system time when the request arrived */ + struct timeval request_time; + + /* for matching request and reply */ + uint64_t seqnum; + + /* the status the backend returned */ + NTSTATUS status; + +#define SMB2SRV_REQ_CTRL_FLAG_NOT_REPLY (1<<0) + uint32_t control_flags; + + struct smb2_request_buffer in; + struct smb2_request_buffer out; +}; -- cgit From 2cd5ca7d25f12aa9198bf8c2deb6aea282f573ee Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Dec 2005 15:38:36 +0000 Subject: r12542: Move some more prototypes out to seperate headers (This used to be commit 0aca5fd5130d980d07398f3291d294202aefe3c2) --- source4/smb_server/smb2/smb2_server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 913c7f2eab..1c544bfe82 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -48,3 +48,5 @@ struct smb2srv_request { struct smb2_request_buffer in; struct smb2_request_buffer out; }; + +#include "smb_server/smb2/smb2_proto.h" -- cgit From e3f2414cf9e582a4e4deecc662b64a7bb2679a34 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 15:03:25 +0000 Subject: r14380: Reduce the size of structs.h (This used to be commit 1a16a6f1dfa66499af43a6b88b3ea69a6a75f1fe) --- source4/smb_server/smb2/smb2_server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 1c544bfe82..5f30c8141d 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -49,4 +49,6 @@ struct smb2srv_request { struct smb2_request_buffer out; }; +struct smbsrv_request; + #include "smb_server/smb2/smb2_proto.h" -- cgit From 607e97bef0df1db588c888e21ac6b8826c9282d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 20 May 2006 12:11:46 +0000 Subject: r15746: - reorder elements of smb2srv_request - move SMB2 specific elements to the end metze (This used to be commit 7d2087bd1b5036f79e205d6e17f2bca78576299e) --- source4/smb_server/smb2/smb2_server.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 5f30c8141d..86b4f146be 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -27,23 +27,31 @@ struct smb2srv_request { /* the server_context contains all context specific to this SMB socket */ struct smbsrv_connection *smb_conn; - /* the smbsrv_session for the request */ + /* conn is only set for operations that have a valid TID */ + struct smbsrv_tcon *tcon; + + /* the session context is derived from the vuid */ struct smbsrv_session *session; - /* the smbsrv_tcon for the request */ - struct smbsrv_tcon *tcon; +#define SMB2SRV_REQ_CTRL_FLAG_NOT_REPLY (1<<0) + uint32_t control_flags; /* the system time when the request arrived */ struct timeval request_time; - /* for matching request and reply */ - uint64_t seqnum; + /* a pointer to the per request union smb_* io structure */ + void *io_ptr; + + /* the ntvfs_request */ + struct ntvfs_request *ntvfs; + + /* Now the SMB2 specific stuff */ /* the status the backend returned */ NTSTATUS status; -#define SMB2SRV_REQ_CTRL_FLAG_NOT_REPLY (1<<0) - uint32_t control_flags; + /* for matching request and reply */ + uint64_t seqnum; struct smb2_request_buffer in; struct smb2_request_buffer out; -- cgit From c2c5f78f11e026d56f09a9142906d3921539204f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 20 May 2006 17:06:28 +0000 Subject: r15753: implement SMB2 Create metze (This used to be commit 65b67a8af6b661fe6eeabf45563c6aba12a6660a) --- source4/smb_server/smb2/smb2_server.h | 97 +++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 86b4f146be..6eea4e7e05 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -60,3 +60,100 @@ struct smb2srv_request { struct smbsrv_request; #include "smb_server/smb2/smb2_proto.h" + +/* useful way of catching wct errors with file and line number */ +#define SMB2SRV_CHECK_BODY_SIZE(req, size, dynamic) do { \ + size_t is_size = req->in.body_size; \ + uint16_t field_size = SVAL(req->in.body, 0); \ + uint16_t want_size = ((dynamic)?(size)+1:(size)); \ + if (is_size < (size)) { \ + DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \ + __location__, is_size, want_size)); \ + smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + }\ + if (field_size != want_size) { \ + DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \ + __location__, field_size, want_size)); \ + smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + } \ +} while (0) + +#define SMB2SRV_CHECK(cmd) do {\ + NTSTATUS _status; \ + _status = cmd; \ + if (!NT_STATUS_IS_OK(_status)) { \ + smb2srv_send_error(req, _status); \ + return; \ + } \ +} while (0) + +/* useful wrapper for talloc with NO_MEMORY reply */ +#define SMB2SRV_TALLOC_IO_PTR(ptr, type) do { \ + ptr = talloc(req, type); \ + if (!ptr) { \ + smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ + return; \ + } \ + req->io_ptr = ptr; \ +} while (0) + +#define SMB2SRV_SETUP_NTVFS_REQUEST(send_fn, state) do { \ + req->ntvfs = ntvfs_request_create(req->tcon->ntvfs, req, \ + req->session->session_info,\ + 0, \ + 0, \ + req->request_time, \ + req, send_fn, state); \ + if (!req->ntvfs) { \ + smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ + return; \ + } \ + if (!talloc_reference(req->ntvfs, req)) { \ + smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ + return; \ + } \ + req->ntvfs->frontend_data.private_data = req; \ +} while (0) + +#define SMB2SRV_CHECK_FILE_HANDLE(handle) do { \ + if (!handle) { \ + smb2srv_send_error(req, NT_STATUS_INVALID_HANDLE); \ + return; \ + } \ +} while (0) + +/* + check if the backend wants to handle the request asynchronously. + if it wants it handled synchronously then call the send function + immediately +*/ +#define SMB2SRV_CALL_NTVFS_BACKEND(cmd) do { \ + req->ntvfs->async_states->status = cmd; \ + if (!(req->ntvfs->async_states->state & NTVFS_ASYNC_STATE_ASYNC)) { \ + req->ntvfs->async_states->send_fn(req->ntvfs); \ + } \ +} while (0) + +/* check req->ntvfs->async_states->status and if not OK then send an error reply */ +#define SMB2SRV_CHECK_ASYNC_STATUS_ERR_SIMPLE do { \ + req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + if (NT_STATUS_IS_ERR(ntvfs->async_states->status)) { \ + smb2srv_send_error(req, ntvfs->async_states->status); \ + return; \ + } \ +} while (0) +#define SMB2SRV_CHECK_ASYNC_STATUS_ERR(ptr, type) do { \ + SMB2SRV_CHECK_ASYNC_STATUS_ERR_SIMPLE; \ + ptr = talloc_get_type(req->io_ptr, type); \ +} while (0) +#define SMB2SRV_CHECK_ASYNC_STATUS_SIMPLE do { \ + req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + if (!NT_STATUS_IS_OK(ntvfs->async_states->status)) { \ + smb2srv_send_error(req, ntvfs->async_states->status); \ + return; \ + } \ +} while (0) +#define SMB2SRV_CHECK_ASYNC_STATUS(ptr, type) do { \ + SMB2SRV_CHECK_ASYNC_STATUS_SIMPLE; \ + ptr = talloc_get_type(req->io_ptr, type); \ +} while (0) -- cgit From c51dfa7926c7c961605e341b34c01ec744b60e39 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 22 May 2006 14:14:23 +0000 Subject: r15802: merge tridge's fix to the SMB2 server metze (This used to be commit 2ea15e9d28bca358989a565576ea7e8d9462e924) --- source4/smb_server/smb2/smb2_server.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 6eea4e7e05..4f4e769940 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -108,10 +108,7 @@ struct smbsrv_request; smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ return; \ } \ - if (!talloc_reference(req->ntvfs, req)) { \ - smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ - return; \ - } \ + talloc_steal(req->tcon->ntvfs, req); \ req->ntvfs->frontend_data.private_data = req; \ } while (0) -- cgit From 184c28844d9a2186053ea23920607831299100a7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 22 May 2006 14:18:17 +0000 Subject: r15803: the SMB2 server gives NT_STATUS_NOT_FOUND instead of NT_STATUS_INVALID_HANDLE metze (This used to be commit aa98aad0975e59fc8cf56c624f728b33ab54e099) --- source4/smb_server/smb2/smb2_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 4f4e769940..daf7e315c2 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -114,7 +114,7 @@ struct smbsrv_request; #define SMB2SRV_CHECK_FILE_HANDLE(handle) do { \ if (!handle) { \ - smb2srv_send_error(req, NT_STATUS_INVALID_HANDLE); \ + smb2srv_send_error(req, NT_STATUS_NOT_FOUND); \ return; \ } \ } while (0) -- cgit From f8dc3bbf9f1f5073c9d6a5992371feb60ebfd811 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 20 Jun 2006 09:57:00 +0000 Subject: r16410: remove some warnings of talloc_steal() usage without target I only commit this as this is used in a global macro tridge: we should try to get rid of this warning without using (void)talloc_steal(ctx, ptr); everywhere!!! metze (This used to be commit 3f8ce6d680b0c86abc698b8f9c6d8840da3ffd35) --- source4/smb_server/smb2/smb2_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index daf7e315c2..57563cf0f5 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -108,7 +108,7 @@ struct smbsrv_request; smb2srv_send_error(req, NT_STATUS_NO_MEMORY); \ return; \ } \ - talloc_steal(req->tcon->ntvfs, req); \ + (void)talloc_steal(req->tcon->ntvfs, req); \ req->ntvfs->frontend_data.private_data = req; \ } while (0) -- cgit From 74d58ab06fab0f3f893b042dfaa88a1842043fd8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jun 2006 07:36:00 +0000 Subject: r16456: return on error... metze (This used to be commit 44ab067d146503bd1cc008cf01c08b91fb14b204) --- source4/smb_server/smb2/smb2_server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 57563cf0f5..f3ac78dee3 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -70,11 +70,13 @@ struct smbsrv_request; DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \ __location__, is_size, want_size)); \ smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + return; \ }\ if (field_size != want_size) { \ DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \ __location__, field_size, want_size)); \ smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + return; \ } \ } while (0) -- cgit From dd44e2415ce2f0c6afddbb88b0c069ade95dc99f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 1 Jul 2006 14:27:49 +0000 Subject: r16738: vista beta2 use FILE_CLOSED as error for an invalid file handle metze (This used to be commit fa35ddcaf9bbeaa4780aa3497cdff56b02af0ab9) --- source4/smb_server/smb2/smb2_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index f3ac78dee3..76d11e019c 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -116,7 +116,7 @@ struct smbsrv_request; #define SMB2SRV_CHECK_FILE_HANDLE(handle) do { \ if (!handle) { \ - smb2srv_send_error(req, NT_STATUS_NOT_FOUND); \ + smb2srv_send_error(req, NT_STATUS_FILE_CLOSED); \ return; \ } \ } while (0) -- cgit From f0f7070ad70c73a1e5c2cf7c5111e39c372845cd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 8 Jul 2006 07:42:25 +0000 Subject: r16870: copy over the status from the ntvfs request to the smb2 request so that smb2srv_setup_reply() doesn't push uninitialized data (found by valgrind) metze (This used to be commit 1a1fd2747d12663ff1084a3bc85e85c74188edb7) --- source4/smb_server/smb2/smb2_server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 76d11e019c..ce13756836 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -136,6 +136,7 @@ struct smbsrv_request; /* check req->ntvfs->async_states->status and if not OK then send an error reply */ #define SMB2SRV_CHECK_ASYNC_STATUS_ERR_SIMPLE do { \ req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + req->status = ntvfs->async_states->status; \ if (NT_STATUS_IS_ERR(ntvfs->async_states->status)) { \ smb2srv_send_error(req, ntvfs->async_states->status); \ return; \ @@ -147,6 +148,7 @@ struct smbsrv_request; } while (0) #define SMB2SRV_CHECK_ASYNC_STATUS_SIMPLE do { \ req = talloc_get_type(ntvfs->async_states->private_data, struct smb2srv_request); \ + req->status = ntvfs->async_states->status; \ if (!NT_STATUS_IS_OK(ntvfs->async_states->status)) { \ smb2srv_send_error(req, ntvfs->async_states->status); \ return; \ -- cgit From 3b36a857980b1f9fa5a6be0253e85c975f35c13f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 11 Jul 2006 18:15:42 +0000 Subject: r16950: remove the smb mid from the ntvfs layer and keep a list of pending requests on the smbsrv_connection, to be able to match then on ntcancel metze (This used to be commit 04f0d3d03179b6060fd013b867d13caa92ec6460) --- source4/smb_server/smb2/smb2_server.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index ce13756836..838abdf4d6 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -103,7 +103,6 @@ struct smbsrv_request; req->ntvfs = ntvfs_request_create(req->tcon->ntvfs, req, \ req->session->session_info,\ 0, \ - 0, \ req->request_time, \ req, send_fn, state); \ if (!req->ntvfs) { \ -- cgit From 8075ce63fdbaeb2fe508097a46d794a49138c307 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Jul 2006 09:44:13 +0000 Subject: r17084: implement SMB2 Cancel in the server, that makes it possible for clients to cancel async requests, like NOTIFY... metze (This used to be commit eaccd3c4353833daf584aaea4d7e8f11004a8072) --- source4/smb_server/smb2/smb2_server.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 838abdf4d6..b58bf5511a 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -53,6 +53,9 @@ struct smb2srv_request { /* for matching request and reply */ uint64_t seqnum; + /* the id that can be used to cancel the request */ + uint32_t pending_id; + struct smb2_request_buffer in; struct smb2_request_buffer out; }; @@ -127,7 +130,13 @@ struct smbsrv_request; */ #define SMB2SRV_CALL_NTVFS_BACKEND(cmd) do { \ req->ntvfs->async_states->status = cmd; \ - if (!(req->ntvfs->async_states->state & NTVFS_ASYNC_STATE_ASYNC)) { \ + if (req->ntvfs->async_states->state & NTVFS_ASYNC_STATE_ASYNC) { \ + NTSTATUS _status; \ + _status = smb2srv_queue_pending(req); \ + if (!NT_STATUS_IS_OK(_status)) { \ + ntvfs_cancel(req->ntvfs); \ + } \ + } else { \ req->ntvfs->async_states->send_fn(req->ntvfs); \ } \ } while (0) -- cgit From 30ee8beb9316a99e8a49993306252591106cb349 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 9 Sep 2006 10:05:58 +0000 Subject: r18301: I discovered how to load the warnings from a build farm build into emacs compile mode (hint, paste to a file, and compile as "cat filename"). This allowed me to fix nearly all the warnings for a IA_64 SuSE build very quickly. (This used to be commit eba6c84efff735bb0ca941ac4b755ce2b0591667) --- source4/smb_server/smb2/smb2_server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index b58bf5511a..353300681f 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -71,13 +71,13 @@ struct smbsrv_request; uint16_t want_size = ((dynamic)?(size)+1:(size)); \ if (is_size < (size)) { \ DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \ - __location__, is_size, want_size)); \ + __location__, (unsigned)is_size, (unsigned)want_size)); \ smb2srv_send_error(req, NT_STATUS_FOOBAR); \ return; \ }\ if (field_size != want_size) { \ DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \ - __location__, field_size, want_size)); \ + __location__, (unsigned)field_size, (unsigned)want_size)); \ smb2srv_send_error(req, NT_STATUS_FOOBAR); \ return; \ } \ -- cgit From bf62b6642c77e14142cdb724dc99dd3f8bfd89ac Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 14 May 2007 18:02:49 +0000 Subject: r22866: handle incoming chained smb2 requests in our server code to let the windows explorer in longhorn beta3 work. metze (This used to be commit 2390c9f24daccec917608cac0870890cdc73cb1c) --- source4/smb_server/smb2/smb2_server.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 353300681f..909a4228df 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -56,6 +56,13 @@ struct smb2srv_request { /* the id that can be used to cancel the request */ uint32_t pending_id; + /* the offset to the next SMB2 Header for chained requests */ + uint32_t chain_offset; + + /* chained file handle */ + uint8_t _chained_file_handle[16]; + uint8_t *chained_file_handle; + struct smb2_request_buffer in; struct smb2_request_buffer out; }; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/smb_server/smb2/smb2_server.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 909a4228df..2f347d3876 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* the context for a single SMB2 request. This is passed to any request-context -- cgit From 4d39976dddf2adf6a0d659050c3a21a6e0ff8ab2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 May 2008 22:12:20 +1000 Subject: fixed SMB2 locking - SMB2 locking is different in several ways from SMB locking. To fix it properly we will need a new generic mapping structure for locking, but for now do a best effort mapping - added locking to gentest_smb2 (This used to be commit ea6d9cf602302adafe0f9d5f5f90a9b26d1ead6f) --- source4/smb_server/smb2/smb2_server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index 2f347d3876..fc40a92efc 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -70,7 +70,7 @@ struct smbsrv_request; #include "smb_server/smb2/smb2_proto.h" -/* useful way of catching wct errors with file and line number */ +/* useful way of catching field size errors with file and line number */ #define SMB2SRV_CHECK_BODY_SIZE(req, size, dynamic) do { \ size_t is_size = req->in.body_size; \ uint16_t field_size = SVAL(req->in.body, 0); \ -- cgit From 72739ac0d0bdd965264a69a6e796fd412b42d628 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 May 2008 13:14:55 +1000 Subject: badly formed SMB2 packets get NT_STATUS_INVALID_PARAMETER (This used to be commit 1c5dd2d1b655218f875a4e512ed3e94fee624fe4) --- source4/smb_server/smb2/smb2_server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index fc40a92efc..ae4abbd71e 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -78,13 +78,13 @@ struct smbsrv_request; if (is_size < (size)) { \ DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \ __location__, (unsigned)is_size, (unsigned)want_size)); \ - smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + smb2srv_send_error(req, NT_STATUS_INVALID_PARAMETER); \ return; \ }\ if (field_size != want_size) { \ DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \ __location__, (unsigned)field_size, (unsigned)want_size)); \ - smb2srv_send_error(req, NT_STATUS_FOOBAR); \ + smb2srv_send_error(req, NT_STATUS_INVALID_PARAMETER); \ return; \ } \ } while (0) -- cgit From 0294c678c0665e675673ff477df26fddd8ed53dd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 13 Aug 2008 15:20:18 +0200 Subject: smb2srv: sign replies when the request was also signed metze (This used to be commit dd2f4f7a491debcc30e590f571272afd99e52940) --- source4/smb_server/smb2/smb2_server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/smb_server/smb2/smb2_server.h') diff --git a/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h index ae4abbd71e..d45e0861af 100644 --- a/source4/smb_server/smb2/smb2_server.h +++ b/source4/smb_server/smb2/smb2_server.h @@ -62,6 +62,8 @@ struct smb2srv_request { uint8_t _chained_file_handle[16]; uint8_t *chained_file_handle; + bool is_signed; + struct smb2_request_buffer in; struct smb2_request_buffer out; }; -- cgit