summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-07-20 13:05:39 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-08-07 15:20:02 +0200
commitb5854ecc98c3db4aba56f91035b79aabde0fc266 (patch)
tree6bf516ce676da27cfc681043de46f4c5dc83da42 /source4/librpc
parent8d36bbe1874f47230d663e16de3c8e0e0800d997 (diff)
downloadsamba-b5854ecc98c3db4aba56f91035b79aabde0fc266.tar.gz
s4:librpc/rpc: pass down HTTP_AUTH_* values directly to dcerpc_pipe_open_roh_send()
They get passed to http_send_auth_request_send() unmodified. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c11
-rw-r--r--source4/librpc/rpc/dcerpc_roh.c10
-rw-r--r--source4/librpc/rpc/dcerpc_roh_channel_in.c5
-rw-r--r--source4/librpc/rpc/dcerpc_roh_channel_out.c5
4 files changed, 15 insertions, 16 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index bec7022f4d2..2206beff854 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -35,6 +35,7 @@
#include "auth/credentials/credentials.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
+#include "lib/http/http.h"
struct dcerpc_pipe_connect {
struct dcecli_connection *conn;
@@ -431,7 +432,7 @@ struct pipe_http_state {
uint32_t http_proxy_port;
bool use_tls;
bool use_proxy;
- bool use_ntlm;
+ enum http_auth_method http_auth;
struct loadparm_context *lp_ctx;
};
@@ -565,15 +566,15 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_http_send(
opt = dcerpc_binding_get_string_option(io->binding, "HttpAuthOption");
if (opt) {
if (strcasecmp(opt, "basic") == 0) {
- s->use_ntlm = false;
+ s->http_auth = HTTP_AUTH_BASIC;
} else if (strcasecmp(opt, "ntlm") == 0) {
- s->use_ntlm = true;
+ s->http_auth = HTTP_AUTH_NTLM;
} else {
composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
return c;
}
} else {
- s->use_ntlm = true;
+ s->http_auth = HTTP_AUTH_NTLM;
}
subreq = dcerpc_pipe_open_roh_send(s->io.conn, s->localaddr,
@@ -582,7 +583,7 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_http_send(
s->http_proxy, s->http_proxy_port,
s->use_tls, s->use_proxy,
s->io.creds, io->resolve_ctx,
- s->lp_ctx, s->use_ntlm);
+ s->lp_ctx, s->http_auth);
if (composite_nomem(subreq, c)) return c;
tevent_req_set_callback(subreq, continue_pipe_open_ncacn_http, c);
diff --git a/source4/librpc/rpc/dcerpc_roh.c b/source4/librpc/rpc/dcerpc_roh.c
index 6da29787fbe..f7e0ef843d3 100644
--- a/source4/librpc/rpc/dcerpc_roh.c
+++ b/source4/librpc/rpc/dcerpc_roh.c
@@ -89,7 +89,7 @@ struct roh_open_connection_state {
struct roh_connection *roh;
struct tstream_tls_params *tls_params;
struct loadparm_context *lp_ctx;
- bool use_ntlm;
+ uint8_t http_auth;
};
NTSTATUS dcerpc_pipe_open_roh_recv(struct tevent_req *req,
@@ -143,7 +143,7 @@ struct tevent_req *dcerpc_pipe_open_roh_send(struct dcecli_connection *conn,
struct cli_credentials *credentials,
struct resolve_context *resolve_ctx,
struct loadparm_context *lp_ctx,
- bool use_ntlm)
+ uint8_t http_auth)
{
NTSTATUS status;
struct tevent_req *req;
@@ -170,7 +170,7 @@ struct tevent_req *dcerpc_pipe_open_roh_send(struct dcecli_connection *conn,
state->rpc_server_port = rpc_server_port;
state->rpc_proxy = talloc_strdup(state, rpc_proxy);
state->rpc_proxy_port = rpc_proxy_port;
- state->use_ntlm = use_ntlm;
+ state->http_auth = http_auth;
state->roh = talloc_zero(state, struct roh_connection);
state->roh->protocol_version = ROH_V2;
@@ -313,7 +313,7 @@ static void roh_connect_channel_out_done(struct tevent_req *subreq)
state->rpc_server,
state->rpc_server_port,
state->rpc_proxy,
- state->use_ntlm);
+ state->http_auth);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -344,7 +344,7 @@ static void roh_send_RPC_DATA_IN_done(struct tevent_req *subreq)
state->rpc_server,
state->rpc_server_port,
state->rpc_proxy,
- state->use_ntlm);
+ state->http_auth);
if (tevent_req_nomem(subreq, req)) {
return;
}
diff --git a/source4/librpc/rpc/dcerpc_roh_channel_in.c b/source4/librpc/rpc/dcerpc_roh_channel_in.c
index 887a57b67f8..d6c37a33827 100644
--- a/source4/librpc/rpc/dcerpc_roh_channel_in.c
+++ b/source4/librpc/rpc/dcerpc_roh_channel_in.c
@@ -227,7 +227,7 @@ struct tevent_req *roh_send_RPC_DATA_IN_send(TALLOC_CTX *mem_ctx,
const char *rpc_server,
uint32_t rpc_server_port,
const char *rpc_proxy,
- bool use_ntlm)
+ uint8_t http_auth)
{
struct tevent_req *req;
struct tevent_req *subreq;
@@ -299,8 +299,7 @@ struct tevent_req *roh_send_RPC_DATA_IN_send(TALLOC_CTX *mem_ctx,
state->request,
credentials,
lp_ctx,
- use_ntlm ? HTTP_AUTH_NTLM :
- HTTP_AUTH_BASIC);
+ http_auth);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
diff --git a/source4/librpc/rpc/dcerpc_roh_channel_out.c b/source4/librpc/rpc/dcerpc_roh_channel_out.c
index 8a337ad167f..4e1c93445ce 100644
--- a/source4/librpc/rpc/dcerpc_roh_channel_out.c
+++ b/source4/librpc/rpc/dcerpc_roh_channel_out.c
@@ -227,7 +227,7 @@ struct tevent_req *roh_send_RPC_DATA_OUT_send(TALLOC_CTX *mem_ctx,
const char *rpc_server,
uint32_t rpc_server_port,
const char *rpc_proxy,
- bool use_ntlm)
+ uint8_t http_auth)
{
struct tevent_req *req;
struct tevent_req *subreq;
@@ -299,8 +299,7 @@ struct tevent_req *roh_send_RPC_DATA_OUT_send(TALLOC_CTX *mem_ctx,
state->request,
credentials,
lp_ctx,
- use_ntlm ? HTTP_AUTH_NTLM :
- HTTP_AUTH_BASIC);
+ http_auth);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}