From f7bc84409a7a6736ec2cf1110dd7200a954e3b7e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 24 Apr 2011 00:00:40 +0200 Subject: s3:rpc_client: map fault codes to NTSTATUS with dcerpc_fault_to_nt_status() Most fault codes have a NTSTATUS representation, so use that. This brings the fault handling in common with the source4/librpc/rpc code, which make it possible to share more highlevel code, between source3 and source4 as the error checking can be the same now. metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sun Apr 24 10:44:53 CEST 2011 on sn-devel-104 --- source3/rpc_client/cli_pipe.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index d7f990af2c..55cc5f8b34 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -469,11 +469,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(TALLOC_CTX *mem_ctx, pkt->u.fault.status), rpccli_pipe_txt(talloc_tos(), cli))); - if (NT_STATUS_IS_OK(NT_STATUS(pkt->u.fault.status))) { - return NT_STATUS_UNSUCCESSFUL; - } else { - return NT_STATUS(pkt->u.fault.status); - } + return dcerpc_fault_to_nt_status(pkt->u.fault.status); default: DEBUG(0, (__location__ "Unknown packet type %u received " -- cgit From 50883cfeb4eed3d538f71443060745f8747044c9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:38:09 +0200 Subject: s3-tevent: only include ../lib/util/tevent wrappers where needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104 --- source3/rpc_client/cli_pipe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 55cc5f8b34..758f778656 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "../lib/util/tevent_ntstatus.h" #include "librpc/gen_ndr/ndr_epmapper_c.h" #include "../librpc/gen_ndr/ndr_schannel.h" #include "../librpc/gen_ndr/ndr_dssetup.h" -- cgit From 0bb4701a747599042242b0612bc392a6e6d777af Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 May 2011 12:36:55 +0200 Subject: s3: remove various references to server side dcerpc structs (which are not needed). Guenther --- source3/rpc_client/cli_pipe.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 758f778656..05f7d4474b 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -34,7 +34,6 @@ #include "librpc/crypto/spnego.h" #include "rpc_dce.h" #include "cli_pipe.h" -#include "ntdomain.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_CLI -- cgit From bd92826aa837f56119153b93cfce7f843e567896 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 5 May 2011 00:54:56 +0200 Subject: s3-rpc_client: run minimal_includes.pl. Guenther --- source3/rpc_client/cli_pipe.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 05f7d4474b..d5521da509 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -25,7 +25,6 @@ #include "../librpc/gen_ndr/ndr_dssetup.h" #include "../libcli/auth/schannel.h" #include "../libcli/auth/spnego.h" -#include "smb_krb5.h" #include "../libcli/auth/ntlmssp.h" #include "ntlmssp_wrap.h" #include "librpc/gen_ndr/ndr_dcerpc.h" -- cgit From 4f41be356a4e6b311d30de3b2e36e4c33aa72ca3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 10:41:59 -0700 Subject: Fix many const compiler warnings. --- source3/rpc_client/cli_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index d5521da509..24db5dcba6 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2581,7 +2581,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, status = dcerpc_epm_Map(epm_handle, tmp_ctx, - CONST_DISCARD(struct GUID *, + discard_const_p(struct GUID, &(abstract_syntax->uuid)), map_tower, entry_handle, -- cgit From 675573d54b717ffc24cf3b49301ff649aecc259a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 12:53:38 +0200 Subject: s3-includes: finally only include client.h when libsmb is used. Guenther --- source3/rpc_client/cli_pipe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 24db5dcba6..dcdf1f5a24 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -33,6 +33,7 @@ #include "librpc/crypto/spnego.h" #include "rpc_dce.h" #include "cli_pipe.h" +#include "client.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_CLI -- cgit From 3d15137653a7d1b593a9af2eef12f6e5b9a04c4f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:30:12 +1000 Subject: s3-talloc Change TALLOC_ARRAY() to talloc_array() Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc. --- source3/rpc_client/cli_pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index dcdf1f5a24..76d2cf164b 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -606,7 +606,7 @@ static void cli_api_pipe_write_done(struct tevent_req *subreq) return; } - state->rdata = TALLOC_ARRAY(state, uint8_t, RPC_HEADER_LEN); + state->rdata = talloc_array(state, uint8_t, RPC_HEADER_LEN); if (tevent_req_nomem(state->rdata, req)) { return; } @@ -2565,7 +2565,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, /* allocate further parameters for the epm_Map call */ - res_towers = TALLOC_ARRAY(tmp_ctx, struct epm_twr_t, max_towers); + res_towers = talloc_array(tmp_ctx, struct epm_twr_t, max_towers); if (res_towers == NULL) { status = NT_STATUS_NO_MEMORY; goto done; -- cgit From ad0a07c531fadd1639c5298951cfaf5cfe0cb10e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:44:43 +1000 Subject: s3-talloc Change TALLOC_ZERO_P() to talloc_zero() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc. --- source3/rpc_client/cli_pipe.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 76d2cf164b..682f35ece0 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2431,7 +2431,7 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host, NTSTATUS status; int fd; - result = TALLOC_ZERO_P(mem_ctx, struct rpc_pipe_client); + result = talloc_zero(mem_ctx, struct rpc_pipe_client); if (result == NULL) { return NT_STATUS_NO_MEMORY; } @@ -2540,7 +2540,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, /* create tower for asking the epmapper */ - map_binding = TALLOC_ZERO_P(tmp_ctx, struct dcerpc_binding); + map_binding = talloc_zero(tmp_ctx, struct dcerpc_binding); if (map_binding == NULL) { status = NT_STATUS_NO_MEMORY; goto done; @@ -2551,7 +2551,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, map_binding->host = host; /* needed? */ map_binding->endpoint = "0"; /* correct? needed? */ - map_tower = TALLOC_ZERO_P(tmp_ctx, struct epm_twr_t); + map_tower = talloc_zero(tmp_ctx, struct epm_twr_t); if (map_tower == NULL) { status = NT_STATUS_NO_MEMORY; goto done; @@ -2572,7 +2572,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host, } towers.twr = res_towers; - entry_handle = TALLOC_ZERO_P(tmp_ctx, struct policy_handle); + entry_handle = talloc_zero(tmp_ctx, struct policy_handle); if (entry_handle == NULL) { status = NT_STATUS_NO_MEMORY; goto done; @@ -2756,7 +2756,7 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli, return NT_STATUS_INVALID_HANDLE; } - result = TALLOC_ZERO_P(NULL, struct rpc_pipe_client); + result = talloc_zero(NULL, struct rpc_pipe_client); if (result == NULL) { return NT_STATUS_NO_MEMORY; } -- cgit From 74eed8f3ed5c333728350df1d23a4318e9104909 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 9 Jun 2011 15:31:03 +1000 Subject: s3-param Remove special case for global_myname(), rename to lp_netbios_name() There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett --- source3/rpc_client/cli_pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 682f35ece0..0b9470620d 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1087,7 +1087,7 @@ static NTSTATUS create_schannel_auth_rpc_bind_req(struct rpc_pipe_client *cli, r.Flags = NL_FLAG_OEM_NETBIOS_DOMAIN_NAME | NL_FLAG_OEM_NETBIOS_COMPUTER_NAME; r.oem_netbios_domain.a = cli->auth->domain; - r.oem_netbios_computer.a = global_myname(); + r.oem_netbios_computer.a = lp_netbios_name(); status = dcerpc_push_schannel_bind(cli, &r, auth_token); if (!NT_STATUS_IS_OK(status)) { @@ -2330,7 +2330,7 @@ static NTSTATUS rpccli_ntlmssp_bind_data(TALLOC_CTX *mem_ctx, } status = auth_ntlmssp_client_start(NULL, - global_myname(), + lp_netbios_name(), lp_workgroup(), lp_client_ntlmv2_auth(), &ntlmssp_ctx); -- cgit