diff options
-rw-r--r-- | libcli/smb/smbXcli_base.c | 11 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.h | 3 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 3 | ||||
-rw-r--r-- | source4/libcli/raw/clitransport.c | 3 | ||||
-rw-r--r-- | source4/libcli/smb2/transport.c | 3 |
5 files changed, 17 insertions, 6 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index bdb6e48030..b54d7e45ea 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -102,6 +102,7 @@ struct smbXcli_conn { struct { struct { + uint32_t capabilities; uint16_t security_mode; struct GUID guid; } client; @@ -225,7 +226,8 @@ struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx, const char *remote_name, enum smb_signing_setting signing_state, uint32_t smb1_capabilities, - struct GUID *client_guid) + struct GUID *client_guid, + uint32_t smb2_capabilities) { struct smbXcli_conn *conn = NULL; void *ss = NULL; @@ -319,6 +321,7 @@ struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx, if (client_guid) { conn->smb2.client.guid = *client_guid; } + conn->smb2.client.capabilities = smb2_capabilities; conn->smb2.cur_credits = 1; conn->smb2.max_credits = 0; @@ -3796,7 +3799,11 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta SSVAL(buf, 2, dialect_count); SSVAL(buf, 4, state->conn->smb2.client.security_mode); SSVAL(buf, 6, 0); /* Reserved */ - SSVAL(buf, 8, 0); /* Capabilities */ + if (state->max_protocol >= PROTOCOL_SMB2_22) { + SIVAL(buf, 8, state->conn->smb2.client.capabilities); + } else { + SIVAL(buf, 8, 0); /* Capabilities */ + } if (state->max_protocol >= PROTOCOL_SMB2_10) { NTSTATUS status; DATA_BLOB blob; diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index 27f3425cad..dafd83639b 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -31,7 +31,8 @@ struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx, const char *remote_name, enum smb_signing_setting signing_state, uint32_t smb1_capabilities, - struct GUID *client_guid); + struct GUID *client_guid, + uint32_t smb2_capabilities); bool smbXcli_conn_is_connected(struct smbXcli_conn *conn); void smbXcli_conn_disconnect(struct smbXcli_conn *conn, NTSTATUS status); diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 29a26d2f76..481d9f729b 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -260,7 +260,8 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, cli->conn = smbXcli_conn_create(cli, fd, remote_name, signing_state, smb1_capabilities, - NULL); /* client_guid */ + NULL, /* client_guid */ + 0 /* smb1_capabilites */); if (cli->conn == NULL) { goto error; } diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index a9ff8f33c5..f9759b1b7f 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -90,7 +90,8 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock, sock->hostname, options->signing, smb1_capabilities, - NULL); /* client_guid */ + NULL, /* client_guid */ + 0); /* smb2_capabilities */ if (transport->conn == NULL) { TALLOC_FREE(sock); TALLOC_FREE(transport); diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c index 14d1fc541e..d3e17025c0 100644 --- a/source4/libcli/smb2/transport.c +++ b/source4/libcli/smb2/transport.c @@ -67,7 +67,8 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock, sock->hostname, options->signing, 0, /* smb1_capabilities */ - &client_guid); + &client_guid, + 0 /* smb2_capabilities */); if (transport->conn == NULL) { talloc_free(transport); return NULL; |