summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-06 15:14:08 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-06 16:31:25 +0100
commit87f2925252b910f2f403bdbb3f9158202cb7a2c5 (patch)
treef84055e41da558ce7cfee769193b1e0455fe46d4
parent3cbe47b2aef427f7f1fe8f4aa2496fbbe31a3ade (diff)
downloadsamba-87f2925252b910f2f403bdbb3f9158202cb7a2c5.tar.gz
samba-87f2925252b910f2f403bdbb3f9158202cb7a2c5.tar.xz
samba-87f2925252b910f2f403bdbb3f9158202cb7a2c5.zip
ntvfs: pass down the client capabilities into the ntvfs layer
Note that we don't use any protocol specific values here. For now only NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS is defined others should be defined, when we find out that the ntvfs layer needs to know about it. metze (This used to be commit cc42cd5f6753ca582677fa6f403f0419eec5ab10)
-rw-r--r--source4/ntvfs/ntvfs.h16
-rw-r--r--source4/ntvfs/ntvfs_base.c2
-rw-r--r--source4/ntvfs/ntvfs_util.c1
-rw-r--r--source4/rpc_server/srvsvc/srvsvc_ntvfs.c1
-rw-r--r--source4/smb_server/smb/service.c6
-rw-r--r--source4/smb_server/smb2/tcon.c4
6 files changed, 30 insertions, 0 deletions
diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h
index a708dbff51..7a2edc7e2c 100644
--- a/source4/ntvfs/ntvfs.h
+++ b/source4/ntvfs/ntvfs.h
@@ -181,6 +181,14 @@ struct ntvfs_context {
enum protocol_types protocol;
+ /*
+ * client capabilities
+ * this field doesn't use protocol specific
+ * values!
+ */
+#define NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS 0x0000000000000001LLU
+ uint64_t client_caps;
+
/*
* linked list of module contexts
*/
@@ -257,6 +265,14 @@ struct ntvfs_request {
/* the smb pid is needed for locking contexts */
uint16_t smbpid;
+ /*
+ * client capabilities
+ * this field doesn't use protocol specific
+ * values!
+ * see NTVFS_CLIENT_CAP_*
+ */
+ uint64_t client_caps;
+
/* some statictics for the management tools */
struct {
/* the system time when the request arrived */
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c
index f5a24f23a0..35becabcf9 100644
--- a/source4/ntvfs/ntvfs_base.c
+++ b/source4/ntvfs/ntvfs_base.c
@@ -153,6 +153,7 @@ _PUBLIC_ bool ntvfs_interface_differs(const struct ntvfs_critical_sizes *const i
*/
NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, enum ntvfs_type type,
enum protocol_types protocol,
+ uint64_t ntvfs_client_caps,
struct event_context *ev, struct messaging_context *msg,
struct loadparm_context *lp_ctx,
struct server_id server_id, struct ntvfs_context **_ctx)
@@ -168,6 +169,7 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e
ctx = talloc_zero(mem_ctx, struct ntvfs_context);
NT_STATUS_HAVE_NO_MEMORY(ctx);
ctx->protocol = protocol;
+ ctx->client_caps = ntvfs_client_caps;
ctx->type = type;
ctx->config = talloc_steal(ctx, scfg);
ctx->event_ctx = ev;
diff --git a/source4/ntvfs/ntvfs_util.c b/source4/ntvfs/ntvfs_util.c
index 7432ac2c13..ebe8008edd 100644
--- a/source4/ntvfs/ntvfs_util.c
+++ b/source4/ntvfs/ntvfs_util.c
@@ -42,6 +42,7 @@ _PUBLIC_ struct ntvfs_request *ntvfs_request_create(struct ntvfs_context *ctx, T
req->async_states = NULL;
req->session_info = session_info;
req->smbpid = smbpid;
+ req->client_caps = ctx->client_caps;
req->statistics.request_time = request_time;
async = talloc(req, struct ntvfs_async_state);
diff --git a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c
index ccd6c4f74e..43fb24c0c3 100644
--- a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c
+++ b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c
@@ -98,6 +98,7 @@ NTSTATUS srvsvc_create_ntvfs_context(struct dcesrv_call_state *dce_call,
/* init ntvfs function pointers */
status = ntvfs_init_connection(c, scfg, type,
PROTOCOL_NT1,
+ 0,/* ntvfs_client_caps */
dce_call->event_ctx,
dce_call->conn->msg_ctx,
dce_call->conn->dce_ctx->lp_ctx,
diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c
index 35b3653026..52471c09c9 100644
--- a/source4/smb_server/smb/service.c
+++ b/source4/smb_server/smb/service.c
@@ -36,6 +36,7 @@ static NTSTATUS make_connection_scfg(struct smbsrv_request *req,
{
struct smbsrv_tcon *tcon;
NTSTATUS status;
+ uint64_t ntvfs_caps = 0;
tcon = smbsrv_smb_tcon_new(req->smb_conn, scfg->name);
if (!tcon) {
@@ -44,9 +45,14 @@ static NTSTATUS make_connection_scfg(struct smbsrv_request *req,
}
req->tcon = tcon;
+ if (req->smb_conn->negotiate.client_caps & CAP_LEVEL_II_OPLOCKS) {
+ ntvfs_caps |= NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS;
+ }
+
/* init ntvfs function pointers */
status = ntvfs_init_connection(tcon, scfg, type,
req->smb_conn->negotiate.protocol,
+ ntvfs_caps,
req->smb_conn->connection->event.ctx,
req->smb_conn->connection->msg_ctx,
req->smb_conn->lp_ctx,
diff --git a/source4/smb_server/smb2/tcon.c b/source4/smb_server/smb2/tcon.c
index 7f7d558b16..040947f84f 100644
--- a/source4/smb_server/smb2/tcon.c
+++ b/source4/smb_server/smb2/tcon.c
@@ -245,6 +245,7 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
const char *service = io->smb2.in.path;
struct share_config *scfg;
const char *sharetype;
+ uint64_t ntvfs_caps = 0;
if (strncmp(service, "\\\\", 2) == 0) {
const char *p = strchr(service+2, '\\');
@@ -283,9 +284,12 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
}
req->tcon = tcon;
+ ntvfs_caps = NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS;
+
/* init ntvfs function pointers */
status = ntvfs_init_connection(tcon, scfg, type,
req->smb_conn->negotiate.protocol,
+ ntvfs_caps,
req->smb_conn->connection->event.ctx,
req->smb_conn->connection->msg_ctx,
req->smb_conn->lp_ctx,