summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/raw/rawnegotiate.c4
-rw-r--r--source4/param/loadparm.c4
-rw-r--r--source4/torture/util_smb.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c
index ec2ada53ff..6c16935f21 100644
--- a/source4/libcli/raw/rawnegotiate.c
+++ b/source4/libcli/raw/rawnegotiate.c
@@ -187,6 +187,10 @@ NTSTATUS smb_raw_negotiate_recv(struct smbcli_request *req)
transport->negotiate.capabilities &= ~CAP_STATUS32;
}
+ if (!transport->options.use_level2_oplocks) {
+ transport->negotiate.capabilities &= ~CAP_LEVEL_II_OPLOCKS;
+ }
+
failed:
return smbcli_request_destroy(req);
}
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index d94ab92ac9..65ce7595fc 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2614,6 +2614,6 @@ void lp_smbcli_options(struct loadparm_context *lp_ctx,
options->ntstatus_support = lp_nt_status_support(lp_ctx);
options->max_protocol = lp_cli_maxprotocol(lp_ctx);
options->unicode = lp_unicode(lp_ctx);
- options->use_oplocks = false;
- options->use_level2_oplocks = false;
+ options->use_oplocks = true;
+ options->use_level2_oplocks = true;
}
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index ddf7b85c63..ba62f3789c 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -478,6 +478,9 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
lp_smbcli_options(tctx->lp_ctx, &options);
+ options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", true);
+ options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true);
+
status = smbcli_full_connection(mem_ctx, c, hostname,
lp_smb_ports(tctx->lp_ctx),
sharename, NULL,
@@ -489,9 +492,6 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
return false;
}
- (*c)->transport->options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", false);
- (*c)->transport->options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", false);
-
return true;
}