summaryrefslogtreecommitdiff
path: root/source3/libsmb/cliconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/cliconnect.c')
-rw-r--r--source3/libsmb/cliconnect.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index e2d0a2b8bd..91e613affb 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2600,6 +2600,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
struct cli_negprot_state *state = tevent_req_data(
req, struct cli_negprot_state);
struct cli_state *cli = state->cli;
+ uint8_t flags;
uint8_t wct;
uint16_t *vwv;
uint32_t num_bytes;
@@ -2618,6 +2619,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
uint16_t server_security_mode = 0;
bool server_readbraw = false;
bool server_writebraw = false;
+ bool server_lockread = false;
+ bool server_writeunlock = false;
enum protocol_types protocol;
status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
@@ -2628,6 +2631,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
return;
}
+ flags = CVAL(inbuf, smb_flg);
+
protnum = SVAL(vwv, 0);
if ((protnum >= ARRAY_SIZE(prots))
@@ -2645,6 +2650,11 @@ static void cli_negprot_done(struct tevent_req *subreq)
return;
}
+ if (flags & FLAG_SUPPORT_LOCKREAD) {
+ server_lockread = true;
+ server_writeunlock = true;
+ }
+
if (protocol >= PROTOCOL_NT1) {
struct timespec ts;
const char *client_signing = NULL;
@@ -2674,6 +2684,9 @@ static void cli_negprot_done(struct tevent_req *subreq)
server_readbraw = true;
server_writebraw = true;
}
+ if (server_capabilities & CAP_LOCK_AND_READ) {
+ server_lockread = true;
+ }
/* work out if they sent us a workgroup */
if (!(server_capabilities & CAP_EXTENDED_SECURITY) &&
smb_buflen(inbuf) > 8) {
@@ -2779,6 +2792,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
cli->conn.smb1.server.readbraw = server_readbraw;
cli->conn.smb1.server.writebraw = server_writebraw;
+ cli->conn.smb1.server.lockread = server_lockread;
+ cli->conn.smb1.server.writeunlock = server_writeunlock;
tevent_req_done(req);
}