diff options
author | Michael Adam <obnox@samba.org> | 2012-02-29 02:02:29 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-03-03 17:03:07 +0100 |
commit | ac43937ce4d5100a82df9d76d50d72b97daaedd3 (patch) | |
tree | 75d936c89c6b82b93e3f706b52b119afcc936879 /libcli | |
parent | 5a5f98dc70bcca088af061473b8cb465e5aa6ff0 (diff) | |
download | samba-ac43937ce4d5100a82df9d76d50d72b97daaedd3.tar.gz samba-ac43937ce4d5100a82df9d76d50d72b97daaedd3.tar.bz2 samba-ac43937ce4d5100a82df9d76d50d72b97daaedd3.zip |
smbXcli: add the possiblilty to negotiate client capabilites in smb >= 2.2
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 11 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.h | 3 |
2 files changed, 11 insertions, 3 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); |