s4:libcli:smb2: add the smb2_capabilities to the smbcli_options
authorMichael Adam <obnox@samba.org>
Wed, 25 Sep 2013 04:57:23 +0000 (06:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 5 Oct 2013 12:04:07 +0000 (14:04 +0200)
and initialize them in lpcfg_smbcli_options() instead of
in smb2_transport_init() as previously.

This will allow us to control them from callers later.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/libcli/raw/libcliraw.h
source4/libcli/smb2/transport.c
source4/param/loadparm.c

index d2ff90d0e48b06bd701f8304cc97e7894781e347..95e69431c1ef99743b8212781c75dc340e941b78 100644 (file)
@@ -100,6 +100,7 @@ struct smbcli_options {
        uint16_t max_mux;
        int request_timeout;
        enum smb_signing_setting signing;
+       uint32_t smb2_capabilities;
        struct GUID client_guid;
 };
 
index 380c9cd2d127d99f10cfd0fba9d91bb3b4a96b3f..b4a6c943dd19f5b9fdb2ea193f9f3761512ab31c 100644 (file)
@@ -59,16 +59,13 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
        TALLOC_FREE(sock->event.fde);
        TALLOC_FREE(sock->event.te);
 
-       /* TODO: hand this in via the options? */
-       smb2_capabilities = SMB2_CAP_ALL;
-
        transport->conn = smbXcli_conn_create(transport,
                                              sock->sock->fd,
                                              sock->hostname,
                                              options->signing,
                                              0, /* smb1_capabilities */
                                              &options->client_guid,
-                                             smb2_capabilities);
+                                             options->smb2_capabilities);
        if (transport->conn == NULL) {
                talloc_free(transport);
                return NULL;
index 900db7d40a7562744eb60e05bcb09def36b9d800..5f4f4181ccd4e9a09334049564905e618ca1434a 100644 (file)
@@ -44,6 +44,7 @@ void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
        options->unicode = lpcfg_unicode(lp_ctx);
        options->use_oplocks = true;
        options->use_level2_oplocks = true;
+       options->smb2_capabilities = SMB2_CAP_ALL;
        options->client_guid = GUID_random();
 }