diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-02-04 10:02:28 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2014-02-13 11:54:17 +0100 |
commit | 26c2a27c2d723c4bace1017a392ba66ec57d5c0e (patch) | |
tree | 6d5ea5044d3a0ad8bda1423e857ed206bef9be83 /source4/librpc/rpc | |
parent | 57476e4e224a441fc88e504778d47ab0c9657955 (diff) | |
download | samba-26c2a27c2d723c4bace1017a392ba66ec57d5c0e.tar.gz samba-26c2a27c2d723c4bace1017a392ba66ec57d5c0e.tar.xz samba-26c2a27c2d723c4bace1017a392ba66ec57d5c0e.zip |
s4:librpc/rpc: make use of dcerpc_binding_get_flags()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 20 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_connect.c | 13 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 14 |
3 files changed, 31 insertions, 16 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index b84ac83783d..919be770cdb 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -1174,6 +1174,7 @@ struct tevent_req *dcerpc_bind_send(TALLOC_CTX *mem_ctx, DATA_BLOB blob; NTSTATUS status; struct rpc_request *subreq; + uint32_t flags; req = tevent_req_create(mem_ctx, &state, struct dcerpc_bind_state); @@ -1187,6 +1188,8 @@ struct tevent_req *dcerpc_bind_send(TALLOC_CTX *mem_ctx, p->syntax = *syntax; p->transfer_syntax = *transfer_syntax; + flags = dcerpc_binding_get_flags(p->binding); + init_ncacn_hdr(p->conn, &pkt); pkt.ptype = DCERPC_PKT_BIND; @@ -1194,7 +1197,7 @@ struct tevent_req *dcerpc_bind_send(TALLOC_CTX *mem_ctx, pkt.call_id = p->conn->call_id; pkt.auth_length = 0; - if (p->binding->flags & DCERPC_CONCURRENT_MULTIPLEX) { + if (flags & DCERPC_CONCURRENT_MULTIPLEX) { pkt.pfc_flags |= DCERPC_PFC_FLAG_CONC_MPX; } @@ -1292,6 +1295,7 @@ static void dcerpc_bind_recv_handler(struct rpc_request *subreq, struct dcerpc_bind_state); struct dcecli_connection *conn = state->p->conn; NTSTATUS status; + uint32_t flags; /* * Note that pkt is allocated under raw_packet->data, @@ -1349,7 +1353,9 @@ static void dcerpc_bind_recv_handler(struct rpc_request *subreq, conn->srv_max_recv_frag = MIN(conn->srv_max_recv_frag, pkt->u.bind_ack.max_recv_frag); - if ((state->p->binding->flags & DCERPC_CONCURRENT_MULTIPLEX) && + flags = dcerpc_binding_get_flags(state->p->binding); + + if ((flags & DCERPC_CONCURRENT_MULTIPLEX) && (pkt->pfc_flags & DCERPC_PFC_FLAG_CONC_MPX)) { conn->flags |= DCERPC_CONCURRENT_MULTIPLEX; } @@ -1394,6 +1400,9 @@ NTSTATUS dcerpc_auth3(struct dcerpc_pipe *p, struct ncacn_packet pkt; NTSTATUS status; DATA_BLOB blob; + uint32_t flags; + + flags = dcerpc_binding_get_flags(p->binding); init_ncacn_hdr(p->conn, &pkt); @@ -1403,7 +1412,7 @@ NTSTATUS dcerpc_auth3(struct dcerpc_pipe *p, pkt.auth_length = 0; pkt.u.auth3.auth_info = data_blob(NULL, 0); - if (p->binding->flags & DCERPC_CONCURRENT_MULTIPLEX) { + if (flags & DCERPC_CONCURRENT_MULTIPLEX) { pkt.pfc_flags |= DCERPC_PFC_FLAG_CONC_MPX; } @@ -2056,6 +2065,7 @@ struct tevent_req *dcerpc_alter_context_send(TALLOC_CTX *mem_ctx, DATA_BLOB blob; NTSTATUS status; struct rpc_request *subreq; + uint32_t flags; req = tevent_req_create(mem_ctx, &state, struct dcerpc_alter_context_state); @@ -2069,6 +2079,8 @@ struct tevent_req *dcerpc_alter_context_send(TALLOC_CTX *mem_ctx, p->syntax = *syntax; p->transfer_syntax = *transfer_syntax; + flags = dcerpc_binding_get_flags(p->binding); + init_ncacn_hdr(p->conn, &pkt); pkt.ptype = DCERPC_PKT_ALTER; @@ -2076,7 +2088,7 @@ struct tevent_req *dcerpc_alter_context_send(TALLOC_CTX *mem_ctx, pkt.call_id = p->conn->call_id; pkt.auth_length = 0; - if (p->binding->flags & DCERPC_CONCURRENT_MULTIPLEX) { + if (flags & DCERPC_CONCURRENT_MULTIPLEX) { pkt.pfc_flags |= DCERPC_PFC_FLAG_CONC_MPX; } diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 36a81a690a9..325a1c4c712 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -131,6 +131,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT struct pipe_np_smb_state *s; struct composite_context *conn_req; struct smb_composite_connect *conn; + uint32_t flags; /* composite context allocation and setup */ c = composite_create(mem_ctx, io->pipe->conn->event_ctx); @@ -167,7 +168,8 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT * setup) or if asked to do so by the caller (perhaps a SAMR password change?) */ s->conn.in.credentials = s->io.creds; - if (s->io.binding->flags & (DCERPC_SCHANNEL|DCERPC_ANON_FALLBACK)) { + flags = dcerpc_binding_get_flags(s->io.binding); + if (flags & (DCERPC_SCHANNEL|DCERPC_ANON_FALLBACK)) { conn->in.fallback_to_anonymous = true; } else { conn->in.fallback_to_anonymous = false; @@ -284,6 +286,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send( struct pipe_np_smb2_state *s; struct tevent_req *subreq; struct smbcli_options options; + uint32_t flags; /* composite context allocation and setup */ c = composite_create(mem_ctx, io->pipe->conn->event_ctx); @@ -295,15 +298,15 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send( s->io = *io; + flags = dcerpc_binding_get_flags(s->io.binding); + /* * provide proper credentials - user supplied or anonymous in case this is * schannel connection */ - if (s->io.binding->flags & DCERPC_SCHANNEL) { - s->io.creds = cli_credentials_init(mem_ctx); + if (flags & DCERPC_SCHANNEL) { + s->io.creds = cli_credentials_init_anon(mem_ctx); if (composite_nomem(s->io.creds, c)) return c; - - cli_credentials_guess(s->io.creds, lp_ctx); } lpcfg_smbcli_options(lp_ctx, &options); diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index ff04e67d446..1cfd6aa8a74 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -614,7 +614,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, s->lp_ctx = lp_ctx; conn = s->pipe->conn; - conn->flags = binding->flags; + conn->flags = dcerpc_binding_get_flags(binding); if (DEBUGLVL(100)) { conn->flags |= DCERPC_DEBUG_PRINT_BOTH; @@ -629,7 +629,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, return c; } - if ((binding->flags & DCERPC_SCHANNEL) && + if ((conn->flags & DCERPC_SCHANNEL) && !cli_credentials_get_netlogon_creds(s->credentials)) { /* If we don't already have netlogon credentials for * the schannel bind, then we have to get these @@ -646,7 +646,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, * if not doing sign or seal */ if (conn->transport.transport == NCACN_NP && - !(s->binding->flags & (DCERPC_SIGN|DCERPC_SEAL))) { + !(conn->flags & (DCERPC_SIGN|DCERPC_SEAL))) { auth_none_req = dcerpc_bind_auth_none_send(c, s->pipe, s->table); composite_continue(c, auth_none_req, continue_auth_none, c); return c; @@ -666,16 +666,16 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p, conn->flags |= DCERPC_CONNECT; } - if (s->binding->flags & DCERPC_AUTH_SPNEGO) { + if (conn->flags & DCERPC_AUTH_SPNEGO) { auth_type = DCERPC_AUTH_TYPE_SPNEGO; - } else if (s->binding->flags & DCERPC_AUTH_KRB5) { + } else if (conn->flags & DCERPC_AUTH_KRB5) { auth_type = DCERPC_AUTH_TYPE_KRB5; - } else if (s->binding->flags & DCERPC_SCHANNEL) { + } else if (conn->flags & DCERPC_SCHANNEL) { auth_type = DCERPC_AUTH_TYPE_SCHANNEL; - } else if (s->binding->flags & DCERPC_AUTH_NTLM) { + } else if (conn->flags & DCERPC_AUTH_NTLM) { auth_type = DCERPC_AUTH_TYPE_NTLMSSP; } else { |