summaryrefslogtreecommitdiff
path: root/source4/libcli/smb_composite
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/smb_composite')
-rw-r--r--source4/libcli/smb_composite/connect.c6
-rw-r--r--source4/libcli/smb_composite/fetchfile.c2
-rw-r--r--source4/libcli/smb_composite/fsinfo.c2
-rw-r--r--source4/libcli/smb_composite/sesssetup.c12
-rw-r--r--source4/libcli/smb_composite/smb_composite.h7
5 files changed, 23 insertions, 6 deletions
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index 0d97a6c54b..980a418619 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -29,6 +29,7 @@
#include "libcli/resolve/resolve.h"
#include "auth/credentials/credentials.h"
#include "librpc/gen_ndr/ndr_nbt.h"
+#include "param/param.h"
/* the stages of this call */
enum connect_stage {CONNECT_RESOLVE,
@@ -256,6 +257,7 @@ static NTSTATUS connect_negprot(struct composite_context *c,
state->io_setup->in.capabilities = state->transport->negotiate.capabilities;
state->io_setup->in.credentials = io->in.credentials;
state->io_setup->in.workgroup = io->in.workgroup;
+ state->io_setup->in.gensec_settings = io->in.gensec_settings;
state->creq = smb_composite_sesssetup_send(state->session, state->io_setup);
NT_STATUS_HAVE_NO_MEMORY(state->creq);
@@ -375,7 +377,8 @@ static NTSTATUS connect_resolve(struct composite_context *c,
state->creq = smbcli_sock_connect_send(state, address,
io->in.dest_ports,
io->in.dest_host,
- NULL, c->event_ctx);
+ NULL, c->event_ctx,
+ io->in.socket_options);
NT_STATUS_HAVE_NO_MEMORY(state->creq);
state->stage = CONNECT_SOCKET;
@@ -467,6 +470,7 @@ struct composite_context *smb_composite_connect_send(struct smb_composite_connec
state = talloc_zero(c, struct connect_state);
if (state == NULL) goto failed;
+ if (io->in.gensec_settings == NULL) goto failed;
state->io = io;
c->state = COMPOSITE_STATE_IN_PROGRESS;
diff --git a/source4/libcli/smb_composite/fetchfile.c b/source4/libcli/smb_composite/fetchfile.c
index cbe2289a55..a19898efae 100644
--- a/source4/libcli/smb_composite/fetchfile.c
+++ b/source4/libcli/smb_composite/fetchfile.c
@@ -138,12 +138,14 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
state->connect->in.dest_host = io->in.dest_host;
state->connect->in.dest_ports = io->in.ports;
+ state->connect->in.socket_options = io->in.socket_options;
state->connect->in.called_name = io->in.called_name;
state->connect->in.service = io->in.service;
state->connect->in.service_type = io->in.service_type;
state->connect->in.credentials = io->in.credentials;
state->connect->in.fallback_to_anonymous = false;
state->connect->in.workgroup = io->in.workgroup;
+ state->connect->in.gensec_settings = io->in.gensec_settings;
state->connect->in.iconv_convenience = io->in.iconv_convenience;
state->connect->in.options = io->in.options;
diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c
index f148fb8bf6..7c9c7963f4 100644
--- a/source4/libcli/smb_composite/fsinfo.c
+++ b/source4/libcli/smb_composite/fsinfo.c
@@ -146,6 +146,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
state->connect->in.dest_host = io->in.dest_host;
state->connect->in.dest_ports = io->in.dest_ports;
+ state->connect->in.socket_options = io->in.socket_options;
state->connect->in.called_name = io->in.called_name;
state->connect->in.service = io->in.service;
state->connect->in.service_type = io->in.service_type;
@@ -153,6 +154,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
state->connect->in.fallback_to_anonymous = false;
state->connect->in.workgroup = io->in.workgroup;
state->connect->in.iconv_convenience = io->in.iconv_convenience;
+ state->connect->in.gensec_settings = io->in.gensec_settings;
state->connect->in.options = tree->session->transport->options;
state->connect->in.session_options = tree->session->options;
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 2ca12a5898..7c9d1fb731 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -408,7 +408,7 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
smbcli_temp_set_signing(session->transport);
status = gensec_client_start(session, &session->gensec, c->event_ctx,
- global_loadparm);
+ io->in.gensec_settings);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to start GENSEC client mode: %s\n", nt_errstr(status)));
return status;
@@ -442,12 +442,13 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
status = gensec_start_mech_by_oid(session->gensec, chosen_oid);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to start set GENSEC client mechanism %s: %s\n",
- gensec_get_name_by_oid(chosen_oid), nt_errstr(status)));
+ gensec_get_name_by_oid(session->gensec, chosen_oid), nt_errstr(status)));
chosen_oid = GENSEC_OID_NTLMSSP;
status = gensec_start_mech_by_oid(session->gensec, chosen_oid);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to start set (fallback) GENSEC client mechanism %s: %s\n",
- gensec_get_name_by_oid(chosen_oid), nt_errstr(status)));
+ gensec_get_name_by_oid(session->gensec, chosen_oid),
+ nt_errstr(status)));
return status;
}
}
@@ -457,7 +458,7 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
status = gensec_start_mech_by_oid(session->gensec, chosen_oid);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to start set GENSEC client mechanism %s: %s\n",
- gensec_get_name_by_oid(chosen_oid), nt_errstr(status)));
+ gensec_get_name_by_oid(session->gensec, chosen_oid), nt_errstr(status)));
}
}
@@ -475,7 +476,8 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) &&
!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed initial gensec_update with mechanism %s: %s\n",
- gensec_get_name_by_oid(chosen_oid), nt_errstr(status)));
+ gensec_get_name_by_oid(session->gensec, chosen_oid),
+ nt_errstr(status)));
return status;
}
state->gensec_status = status;
diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h
index fd1b95e64f..a1e1e99d7e 100644
--- a/source4/libcli/smb_composite/smb_composite.h
+++ b/source4/libcli/smb_composite/smb_composite.h
@@ -53,6 +53,7 @@ struct smb_composite_fetchfile {
const char *called_name;
const char *service;
const char *service_type;
+ const char *socket_options;
struct cli_credentials *credentials;
const char *workgroup;
const char *filename;
@@ -60,6 +61,7 @@ struct smb_composite_fetchfile {
struct smbcli_session_options session_options;
struct resolve_context *resolve_ctx;
struct smb_iconv_convenience *iconv_convenience;
+ struct gensec_settings *gensec_settings;
} in;
struct {
uint8_t *data;
@@ -93,6 +95,7 @@ struct smb_composite_connect {
struct {
const char *dest_host;
const char **dest_ports;
+ const char *socket_options;
const char *called_name;
const char *service;
const char *service_type;
@@ -102,6 +105,7 @@ struct smb_composite_connect {
struct smbcli_options options;
struct smbcli_session_options session_options;
struct smb_iconv_convenience *iconv_convenience;
+ struct gensec_settings *gensec_settings;
} in;
struct {
struct smbcli_tree *tree;
@@ -120,6 +124,7 @@ struct smb_composite_sesssetup {
uint32_t capabilities;
struct cli_credentials *credentials;
const char *workgroup;
+ struct gensec_settings *gensec_settings;
} in;
struct {
uint16_t vuid;
@@ -133,6 +138,7 @@ struct smb_composite_fsinfo {
struct {
const char *dest_host;
const char **dest_ports;
+ const char *socket_options;
const char *called_name;
const char *service;
const char *service_type;
@@ -140,6 +146,7 @@ struct smb_composite_fsinfo {
const char *workgroup;
enum smb_fsinfo_level level;
struct smb_iconv_convenience *iconv_convenience;
+ struct gensec_settings *gensec_settings;
} in;
struct {