summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-09-25 06:46:47 +0200
committerStefan Metzmacher <metze@samba.org>2013-10-05 14:04:07 +0200
commit4e99a0fbfeb1330f67059caaef25669410510617 (patch)
tree1a7ab591581146e6d885479d2d14f2952b210f6f /source4
parent39a965ac83ed8c6ad48c77519b47f6ca544ec713 (diff)
downloadsamba-4e99a0fbfeb1330f67059caaef25669410510617.tar.gz
samba-4e99a0fbfeb1330f67059caaef25669410510617.tar.bz2
samba-4e99a0fbfeb1330f67059caaef25669410510617.zip
s4:libcli:smb2: add the client_guid to the smbcli_options
and initialize it in lpcfg_smbcli_options() instead of in smb2_transport_init() as previously. Having the client guid in the smbcli_options 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>
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/raw/libcliraw.h1
-rw-r--r--source4/libcli/smb2/transport.c5
-rw-r--r--source4/param/loadparm.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h
index a246ade7b6..d2ff90d0e4 100644
--- a/source4/libcli/raw/libcliraw.h
+++ b/source4/libcli/raw/libcliraw.h
@@ -100,6 +100,7 @@ struct smbcli_options {
uint16_t max_mux;
int request_timeout;
enum smb_signing_setting signing;
+ struct GUID client_guid;
};
/* this is the context for the client transport layer */
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 2ad16a9123..380c9cd2d1 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -48,7 +48,6 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
struct smbcli_options *options)
{
struct smb2_transport *transport;
- struct GUID client_guid;
uint32_t smb2_capabilities = 0;
transport = talloc_zero(parent_ctx, struct smb2_transport);
@@ -60,8 +59,6 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
TALLOC_FREE(sock->event.fde);
TALLOC_FREE(sock->event.te);
- client_guid = GUID_random();
-
/* TODO: hand this in via the options? */
smb2_capabilities = SMB2_CAP_ALL;
@@ -70,7 +67,7 @@ struct smb2_transport *smb2_transport_init(struct smbcli_socket *sock,
sock->hostname,
options->signing,
0, /* smb1_capabilities */
- &client_guid,
+ &options->client_guid,
smb2_capabilities);
if (transport->conn == NULL) {
talloc_free(transport);
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 3fbf852899..900db7d40a 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -29,6 +29,7 @@
#include "includes.h"
#include "lib/param/param.h"
#include "libcli/raw/libcliraw.h"
+#include "librpc/ndr/libndr.h"
void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
struct smbcli_options *options)
@@ -43,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->client_guid = GUID_random();
}
void lpcfg_smbcli_session_options(struct loadparm_context *lp_ctx,