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') 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 12476223c6aa7473c55bcf529639eefce8450680 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:26:40 +0200 Subject: s3-tsocket: only include ../lib/tsocket/tsocket.h where needed. Guenther --- source3/rpc_client/rpc_transport_sock.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/rpc_transport_sock.c b/source3/rpc_client/rpc_transport_sock.c index 71f979c2af..1dd0132583 100644 --- a/source3/rpc_client/rpc_transport_sock.c +++ b/source3/rpc_client/rpc_transport_sock.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "../lib/tsocket/tsocket.h" #include "rpc_client/rpc_transport.h" #include "../lib/async_req/async_sock.h" -- 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 + source3/rpc_client/rpc_transport_np.c | 1 + source3/rpc_client/rpc_transport_tstream.c | 1 + 3 files changed, 3 insertions(+) (limited to 'source3/rpc_client') 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" diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c index 2be0162144..c66d4b8022 100644 --- a/source3/rpc_client/rpc_transport_np.c +++ b/source3/rpc_client/rpc_transport_np.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "../lib/util/tevent_ntstatus.h" #include "rpc_client/rpc_transport.h" #include "libsmb/cli_np_tstream.h" diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c index 248b09f049..e62ab4b2bb 100644 --- a/source3/rpc_client/rpc_transport_tstream.c +++ b/source3/rpc_client/rpc_transport_tstream.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "../lib/util/tevent_ntstatus.h" #include "rpc_client/rpc_transport.h" #include "lib/tsocket/tsocket.h" #include "libsmb/cli_np_tstream.h" -- cgit From bc781bf7d98baca57c8043bf7dc0a95f8ffd1345 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 16:20:27 +0200 Subject: s3-proto: remove duplicate prototypes. Guenther --- source3/rpc_client/cli_winreg_int.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_winreg_int.h b/source3/rpc_client/cli_winreg_int.h index f175c17f5c..6e9d07f95c 100644 --- a/source3/rpc_client/cli_winreg_int.h +++ b/source3/rpc_client/cli_winreg_int.h @@ -23,6 +23,7 @@ #define CLI_WINREG_INT_H struct auth_serversupplied_info; +struct dcerpc_binding_handle; /** * @brief Connect to the interal winreg server and open the given key. -- 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 - source3/rpc_client/cli_spoolss.c | 1 - 2 files changed, 2 deletions(-) (limited to 'source3/rpc_client') 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 diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 831da85205..3c15e2ffb0 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -26,7 +26,6 @@ #include "rpc_client/rpc_client.h" #include "../librpc/gen_ndr/ndr_spoolss_c.h" #include "rpc_client/cli_spoolss.h" -#include "ntdomain.h" /********************************************************************** convencience wrapper around rpccli_spoolss_OpenPrinterEx -- 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 - source3/rpc_client/cli_winreg_int.c | 1 - source3/rpc_client/rpc_transport_sock.c | 1 - 3 files changed, 3 deletions(-) (limited to 'source3/rpc_client') 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" diff --git a/source3/rpc_client/cli_winreg_int.c b/source3/rpc_client/cli_winreg_int.c index 8e11ae832d..1828b419a9 100644 --- a/source3/rpc_client/cli_winreg_int.c +++ b/source3/rpc_client/cli_winreg_int.c @@ -21,7 +21,6 @@ #include "includes.h" #include "include/registry.h" -#include "utils/net_registry_util.h" #include "librpc/gen_ndr/ndr_winreg_c.h" #include "rpc_client/cli_winreg_int.h" #include "rpc_server/rpc_ncacn_np.h" diff --git a/source3/rpc_client/rpc_transport_sock.c b/source3/rpc_client/rpc_transport_sock.c index 1dd0132583..a833e4469a 100644 --- a/source3/rpc_client/rpc_transport_sock.c +++ b/source3/rpc_client/rpc_transport_sock.c @@ -20,7 +20,6 @@ #include "includes.h" #include "../lib/tsocket/tsocket.h" #include "rpc_client/rpc_transport.h" -#include "../lib/async_req/async_sock.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_CLI -- 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') 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 + source3/rpc_client/cli_pipe_schannel.c | 1 + 2 files changed, 2 insertions(+) (limited to 'source3/rpc_client') 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 diff --git a/source3/rpc_client/cli_pipe_schannel.c b/source3/rpc_client/cli_pipe_schannel.c index 0535e930be..b7ef39f8e6 100644 --- a/source3/rpc_client/cli_pipe_schannel.c +++ b/source3/rpc_client/cli_pipe_schannel.c @@ -26,6 +26,7 @@ #include "librpc/gen_ndr/ndr_dcerpc.h" #include "librpc/rpc/dcerpc.h" #include "passdb.h" +#include "client.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_CLI -- cgit From 56e72337b01216dc7cba418f040a5cc928e5fc6f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Jun 2011 11:21:15 +0930 Subject: lib/util/time.c: timeval_current_ofs_msec Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell --- source3/rpc_client/rpc_transport_tstream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c index e62ab4b2bb..488c093d3b 100644 --- a/source3/rpc_client/rpc_transport_tstream.c +++ b/source3/rpc_client/rpc_transport_tstream.c @@ -202,7 +202,7 @@ static struct tevent_req *rpc_tstream_read_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); if (!tevent_req_set_endtime(subreq, ev, endtime)) { goto fail; } @@ -286,7 +286,7 @@ static struct tevent_req *rpc_tstream_write_send(TALLOC_CTX *mem_ctx, goto fail; } - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); if (!tevent_req_set_endtime(subreq, ev, endtime)) { goto fail; } @@ -374,7 +374,7 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx, state->req.iov_base = discard_const_p(void *, data); state->max_rdata_len = max_rdata_len; - endtime = timeval_current_ofs(0, transp->timeout * 1000); + endtime = timeval_current_ofs_msec(transp->timeout); subreq = tstream_writev_queue_send(state, ev, transp->stream, -- cgit From 73b377432c5efb8451f09f6d25d8aa1b28c239c9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:10:15 +1000 Subject: s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc() Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett --- source3/rpc_client/cli_winreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_winreg.c b/source3/rpc_client/cli_winreg.c index 2517dbc50a..3731fc7e79 100644 --- a/source3/rpc_client/cli_winreg.c +++ b/source3/rpc_client/cli_winreg.c @@ -615,7 +615,7 @@ NTSTATUS dcerpc_winreg_add_multi_sz(TALLOC_CTX *mem_ctx, /* count the elements */ for (p = a, i = 0; p && *p; p++, i++); - p = TALLOC_REALLOC_ARRAY(mem_ctx, a, const char *, i + 2); + p = talloc_realloc(mem_ctx, a, const char *, i + 2); if (p == NULL) { *pwerr = WERR_NOMEM; return NT_STATUS_OK; -- 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_lsarpc.c | 16 ++++++++-------- source3/rpc_client/cli_pipe.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index e599571181..66192bdf54 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -187,7 +187,7 @@ static NTSTATUS dcerpc_lsa_lookup_sids_noalloc(struct dcerpc_binding_handle *h, ZERO_STRUCT(lsa_names); sid_array.num_sids = num_sids; - sid_array.sids = TALLOC_ARRAY(mem_ctx, struct lsa_SidPtr, num_sids); + sid_array.sids = talloc_array(mem_ctx, struct lsa_SidPtr, num_sids); if (sid_array.sids == NULL) { return NT_STATUS_NO_MEMORY; } @@ -354,19 +354,19 @@ static NTSTATUS dcerpc_lsa_lookup_sids_generic(struct dcerpc_binding_handle *h, bool have_unmapped = false; if (num_sids) { - if (!(domains = TALLOC_ARRAY(mem_ctx, char *, num_sids))) { + if (!(domains = talloc_array(mem_ctx, char *, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; } - if (!(names = TALLOC_ARRAY(mem_ctx, char *, num_sids))) { + if (!(names = talloc_array(mem_ctx, char *, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; } - if (!(types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_sids))) { + if (!(types = talloc_array(mem_ctx, enum lsa_SidType, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n")); status = NT_STATUS_NO_MEMORY; goto fail; @@ -589,7 +589,7 @@ static NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h, ZERO_STRUCT(sid_array); ZERO_STRUCT(sid_array3); - lsa_names = TALLOC_ARRAY(mem_ctx, struct lsa_String, num_names); + lsa_names = talloc_array(mem_ctx, struct lsa_String, num_names); if (lsa_names == NULL) { return NT_STATUS_NO_MEMORY; } @@ -639,20 +639,20 @@ static NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h, } if (num_names) { - if (!((*sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_names)))) { + if (!((*sids = talloc_array(mem_ctx, struct dom_sid, num_names)))) { DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); *presult = NT_STATUS_NO_MEMORY; goto done; } - if (!((*types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_names)))) { + if (!((*types = talloc_array(mem_ctx, enum lsa_SidType, num_names)))) { DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); *presult = NT_STATUS_NO_MEMORY; goto done; } if (dom_names != NULL) { - *dom_names = TALLOC_ARRAY(mem_ctx, const char *, num_names); + *dom_names = talloc_array(mem_ctx, const char *, num_names); if (*dom_names == NULL) { DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); *presult = NT_STATUS_NO_MEMORY; 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_netlogon.c | 14 +++++++------- source3/rpc_client/cli_pipe.c | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index bd3232d2cd..b519358558 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -177,7 +177,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, ZERO_STRUCT(ret_creds); - logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel); + logon = talloc_zero(mem_ctx, union netr_LogonLevel); if (!logon) { return NT_STATUS_NO_MEMORY; } @@ -200,7 +200,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, struct samr_Password lmpassword; struct samr_Password ntpassword; - password_info = TALLOC_ZERO_P(mem_ctx, struct netr_PasswordInfo); + password_info = talloc_zero(mem_ctx, struct netr_PasswordInfo); if (!password_info) { return NT_STATUS_NO_MEMORY; } @@ -240,7 +240,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, ZERO_STRUCT(lm); ZERO_STRUCT(nt); - network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo); + network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo); if (!network_info) { return NT_STATUS_NO_MEMORY; } @@ -388,12 +388,12 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli, ZERO_STRUCT(lm); ZERO_STRUCT(nt); - logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel); + logon = talloc_zero(mem_ctx, union netr_LogonLevel); if (!logon) { return NT_STATUS_NO_MEMORY; } - network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo); + network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo); if (!network_info) { return NT_STATUS_NO_MEMORY; } @@ -505,12 +505,12 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli, ZERO_STRUCT(lm); ZERO_STRUCT(nt); - logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel); + logon = talloc_zero(mem_ctx, union netr_LogonLevel); if (!logon) { return NT_STATUS_NO_MEMORY; } - network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo); + network_info = talloc_zero(mem_ctx, struct netr_NetworkInfo); if (!network_info) { return NT_STATUS_NO_MEMORY; } 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_netlogon.c | 10 +++++----- source3/rpc_client/cli_pipe.c | 4 ++-- source3/rpc_client/cli_pipe_schannel.c | 2 +- source3/rpc_client/cli_spoolss.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index b519358558..3c685fd9a7 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -185,7 +185,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, if (workstation) { fstr_sprintf( clnt_name_slash, "\\\\%s", workstation ); } else { - fstr_sprintf( clnt_name_slash, "\\\\%s", global_myname() ); + fstr_sprintf( clnt_name_slash, "\\\\%s", lp_netbios_name() ); } /* Initialise input parameters */ @@ -279,7 +279,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, status = dcerpc_netr_LogonSamLogon(b, mem_ctx, cli->srv_name_slash, - global_myname(), + lp_netbios_name(), &clnt_creds, &ret_creds, logon_type, @@ -441,7 +441,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli, status = dcerpc_netr_LogonSamLogon(b, mem_ctx, server_name_slash, - global_myname(), + lp_netbios_name(), &clnt_creds, &ret_creds, NetlogonNetworkInformation, @@ -556,7 +556,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli, status = dcerpc_netr_LogonSamLogonEx(b, mem_ctx, server_name_slash, - global_myname(), + lp_netbios_name(), NetlogonNetworkInformation, logon, validation_level, @@ -608,7 +608,7 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli, result = rpccli_netlogon_setup_creds(cli, cli->desthost, /* server name */ lp_workgroup(), /* domain */ - global_myname(), /* client name */ + lp_netbios_name(), /* client name */ account_name, /* machine account name */ orig_trust_passwd_hash, sec_channel_type, 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); diff --git a/source3/rpc_client/cli_pipe_schannel.c b/source3/rpc_client/cli_pipe_schannel.c index b7ef39f8e6..f48c4c7318 100644 --- a/source3/rpc_client/cli_pipe_schannel.c +++ b/source3/rpc_client/cli_pipe_schannel.c @@ -58,7 +58,7 @@ static NTSTATUS get_schannel_session_key_common(struct rpc_pipe_client *netlogon status = rpccli_netlogon_setup_creds(netlogon_pipe, cli->desthost, /* server name */ domain, /* domain */ - global_myname(), /* client name */ + lp_netbios_name(), /* client name */ machine_account, /* machine account name */ machine_pwd, sec_chan_type, diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 3c15e2ffb0..5c8448b29b 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -47,7 +47,7 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli, ZERO_STRUCT(devmode_ctr); level1.size = 28; - level1.client = talloc_asprintf(mem_ctx, "\\\\%s", global_myname()); + level1.client = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name()); W_ERROR_HAVE_NO_MEMORY(level1.client); level1.user = cli->auth->user_name; level1.build = 1381; @@ -230,7 +230,7 @@ WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli, level1.major = 2; level1.minor = 0; level1.processor = 0; - level1.client = talloc_asprintf(mem_ctx, "\\\\%s", global_myname()); + level1.client = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name()); W_ERROR_HAVE_NO_MEMORY(level1.client); level1.user = cli->auth->user_name; -- cgit From 2d10c48259ec234ae110c60405a9da5e720302cb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:07:16 +0200 Subject: source3/rpc_client/cli_netlogon.h: fix licence/copyright Guenther --- source3/rpc_client/cli_netlogon.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_netlogon.h b/source3/rpc_client/cli_netlogon.h index 808a4283ce..ad59d5b203 100644 --- a/source3/rpc_client/cli_netlogon.h +++ b/source3/rpc_client/cli_netlogon.h @@ -1,3 +1,28 @@ +/* + Unix SMB/CIFS implementation. + NT Domain Authentication SMB / MSRPC client + Copyright (C) Andrew Tridgell 1992-2000 + Copyright (C) Jeremy Allison 1998. + Largely re-written by Jeremy Allison (C) 2005. + Copyright (C) Guenther Deschner 2008. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _RPC_CLIENT_CLI_NETLOGON_H_ +#define _RPC_CLIENT_CLI_NETLOGON_H_ + /* The following definitions come from rpc_client/cli_netlogon.c */ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli, @@ -49,3 +74,4 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli, const unsigned char new_trust_passwd_hash[16], enum netr_SchannelType sec_channel_type); +#endif /* _RPC_CLIENT_CLI_NETLOGON_H_ */ -- cgit From b95b1813b9ab53b9490d8b37af4f6ced7fea7bdb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:07:27 +0200 Subject: source3/rpc_client/cli_spoolss.h: fix licence/copyright Guenther --- source3/rpc_client/cli_spoolss.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_spoolss.h b/source3/rpc_client/cli_spoolss.h index 285a34fab4..9883874cd6 100644 --- a/source3/rpc_client/cli_spoolss.h +++ b/source3/rpc_client/cli_spoolss.h @@ -1,3 +1,30 @@ +/* + Unix SMB/CIFS implementation. + RPC pipe client + + Copyright (C) Gerald Carter 2001-2005, + Copyright (C) Tim Potter 2000-2002, + Copyright (C) Andrew Tridgell 1994-2000, + Copyright (C) Jean-Francois Micouleau 1999-2000. + Copyright (C) Jeremy Allison 2005. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _RPC_CLIENT_CLI_SPOOLSS_H_ +#define _RPC_CLIENT_CLI_SPOOLSS_H_ + /* The following definitions come from rpc_client/cli_spoolss.c */ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli, @@ -122,3 +149,5 @@ WERROR rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client *cli, uint32_t offered, uint32_t *count, struct spoolss_PrinterEnumValues **info); + +#endif /* _RPC_CLIENT_CLI_SPOOLSS_H_ */ -- cgit From 9284036ce17b569c1f2203362eacd99ebc362af6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:07:39 +0200 Subject: source3/rpc_client/init_lsa.h: fix licence/copyright Guenther --- source3/rpc_client/init_lsa.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/init_lsa.h b/source3/rpc_client/init_lsa.h index 670caed212..e4e5c11963 100644 --- a/source3/rpc_client/init_lsa.h +++ b/source3/rpc_client/init_lsa.h @@ -1,3 +1,25 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Guenther Deschner 2008. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _RPC_CLIENT_INIT_LSA_H_ +#define _RPC_CLIENT_INIT_LSA_H_ + struct lsa_String; struct lsa_StringLarge; struct lsa_AsciiString; @@ -9,3 +31,5 @@ void init_lsa_String(struct lsa_String *name, const char *s); void init_lsa_StringLarge(struct lsa_StringLarge *name, const char *s); void init_lsa_AsciiString(struct lsa_AsciiString *name, const char *s); void init_lsa_AsciiStringLarge(struct lsa_AsciiStringLarge *name, const char *s); + +#endif /* _RPC_CLIENT_INIT_LSA_H_ */ -- cgit From f3ca8ff2bfb61cfa4b9ce2e4be93653f7b309351 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:07:48 +0200 Subject: source3/rpc_client/init_netlogon.h: fix licence/copyright Guenther --- source3/rpc_client/init_netlogon.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/init_netlogon.h b/source3/rpc_client/init_netlogon.h index d87a9ea493..826d0c56bb 100644 --- a/source3/rpc_client/init_netlogon.h +++ b/source3/rpc_client/init_netlogon.h @@ -1,5 +1,29 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Guenther Deschner 2008. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _RPC_CLIENT_INIT_NETLOGON_H_ +#define _RPC_CLIENT_INIT_NETLOGON_H_ + /* The following definitions come from rpc_client/init_netlogon.c */ void init_netr_CryptPassword(const char *pwd, unsigned char session_key[16], struct netr_CryptPassword *pwd_buf); + +#endif /* _RPC_CLIENT_INIT_NETLOGON_H_ */ -- cgit From 054e54e881eeab18387ae6e94cf04ecf205ebe64 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:07:57 +0200 Subject: source3/rpc_client/init_samr.h: fix licence/copyright Guenther --- source3/rpc_client/init_samr.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/init_samr.h b/source3/rpc_client/init_samr.h index 1ddaef6615..223fa91e3d 100644 --- a/source3/rpc_client/init_samr.h +++ b/source3/rpc_client/init_samr.h @@ -1,3 +1,25 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Guenther Deschner 2008. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _RPC_CLIENT_INIT_SAMR_H_ +#define _RPC_CLIENT_INIT_SAMR_H_ + /* The following definitions come from rpc_client/init_samr.c */ void init_samr_CryptPasswordEx(const char *pwd, @@ -7,3 +29,4 @@ void init_samr_CryptPassword(const char *pwd, DATA_BLOB *session_key, struct samr_CryptPassword *pwd_buf); +#endif /* _RPC_CLIENT_INIT_SAMR_H_ */ -- cgit From 4942aeb9b562f3621cbe6adc8e79366887f0d4b9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:08:07 +0200 Subject: source3/rpc_client/init_spoolss.h: fix licence/copyright Guenther --- source3/rpc_client/init_spoolss.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/init_spoolss.h b/source3/rpc_client/init_spoolss.h index 60ee041ae5..a9374453e1 100644 --- a/source3/rpc_client/init_spoolss.h +++ b/source3/rpc_client/init_spoolss.h @@ -1,3 +1,24 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Guenther Deschner 2009. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _RPC_CLIENT_INIT_SPOOLSS_H_ +#define _RPC_CLIENT_INIT_SPOOLSS_H_ /* The following definitions come from rpc_client/init_spoolss.c */ @@ -14,3 +35,4 @@ WERROR push_spoolss_PrinterData(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, void spoolss_printerinfo2_to_setprinterinfo2(const struct spoolss_PrinterInfo2 *i, struct spoolss_SetPrinterInfo2 *s); +#endif /* _RPC_CLIENT_INIT_SPOOLSS_H_ */ -- cgit From cd16a1be9371448532be7362d3e5d3f2a1ae3df3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:08:17 +0200 Subject: source3/rpc_client/util_netlogon.h: fix licence/copyright MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Jun 10 16:27:24 CEST 2011 on sn-devel-104 --- source3/rpc_client/util_netlogon.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/util_netlogon.h b/source3/rpc_client/util_netlogon.h index 42e4326f7d..cea9787acb 100644 --- a/source3/rpc_client/util_netlogon.h +++ b/source3/rpc_client/util_netlogon.h @@ -1,5 +1,29 @@ +/* + Unix SMB/CIFS implementation. + Authentication utility functions + Copyright (C) Volker Lendecke 2010 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _RPC_CLIENT_UTIL_NETLOGON_H_ +#define _RPC_CLIENT_UTIL_NETLOGON_H_ + /* The following definitions come from rpc_client/util_netlogon.c */ NTSTATUS copy_netr_SamBaseInfo(TALLOC_CTX *mem_ctx, const struct netr_SamBaseInfo *in, struct netr_SamBaseInfo *out); + +#endif /* _RPC_CLIENT_UTIL_NETLOGON_H_ */ -- cgit From a45120aea75044fb58dd6ce267d852be9d2978af Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 20 Jun 2011 15:39:36 +0200 Subject: s3-rpc_client: Fix some valgrind warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are in/out values and need to be initialized. Signed-off-by: Günther Deschner --- source3/rpc_client/cli_winreg.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_winreg.c b/source3/rpc_client/cli_winreg.c index 3731fc7e79..e5ebc25ed8 100644 --- a/source3/rpc_client/cli_winreg.c +++ b/source3/rpc_client/cli_winreg.c @@ -33,7 +33,7 @@ NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx, WERROR *pwerr) { struct winreg_String wvalue; - enum winreg_Type type; + enum winreg_Type type = REG_NONE; uint32_t value_len = 0; uint32_t data_size = 0; WERROR result = WERR_OK; @@ -69,7 +69,7 @@ NTSTATUS dcerpc_winreg_query_dword(TALLOC_CTX *mem_ctx, return status; } - blob = data_blob_talloc(mem_ctx, NULL, data_size); + blob = data_blob_talloc_zero(mem_ctx, data_size); if (blob.data == NULL) { *pwerr = WERR_NOMEM; return status; @@ -108,13 +108,14 @@ NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx, WERROR *pwerr) { struct winreg_String wvalue; - enum winreg_Type type; + enum winreg_Type type = REG_NONE; WERROR result = WERR_OK; uint32_t value_len = 0; uint32_t data_size = 0; NTSTATUS status; DATA_BLOB blob; + ZERO_STRUCT(wvalue); wvalue.name = value; status = dcerpc_winreg_QueryValue(h, @@ -139,7 +140,7 @@ NTSTATUS dcerpc_winreg_query_binary(TALLOC_CTX *mem_ctx, return status; } - blob = data_blob_talloc(mem_ctx, NULL, data_size); + blob = data_blob_talloc_zero(mem_ctx, data_size); if (blob.data == NULL) { *pwerr = WERR_NOMEM; return status; @@ -179,7 +180,7 @@ NTSTATUS dcerpc_winreg_query_multi_sz(TALLOC_CTX *mem_ctx, WERROR *pwerr) { struct winreg_String wvalue; - enum winreg_Type type; + enum winreg_Type type = REG_NONE; WERROR result = WERR_OK; uint32_t value_len = 0; uint32_t data_size = 0; @@ -210,7 +211,7 @@ NTSTATUS dcerpc_winreg_query_multi_sz(TALLOC_CTX *mem_ctx, return status; } - blob = data_blob_talloc(mem_ctx, NULL, data_size); + blob = data_blob_talloc_zero(mem_ctx, data_size); if (blob.data == NULL) { *pwerr = WERR_NOMEM; return status; @@ -254,7 +255,7 @@ NTSTATUS dcerpc_winreg_query_sz(TALLOC_CTX *mem_ctx, WERROR *pwerr) { struct winreg_String wvalue; - enum winreg_Type type; + enum winreg_Type type = REG_NONE; WERROR result = WERR_OK; uint32_t value_len = 0; uint32_t data_size = 0; @@ -285,7 +286,7 @@ NTSTATUS dcerpc_winreg_query_sz(TALLOC_CTX *mem_ctx, return status; } - blob = data_blob_talloc(mem_ctx, NULL, data_size); + blob = data_blob_talloc_zero(mem_ctx, data_size); if (blob.data == NULL) { *pwerr = WERR_NOMEM; return status; @@ -380,13 +381,14 @@ NTSTATUS dcerpc_winreg_set_dword(TALLOC_CTX *mem_ctx, uint32_t data, WERROR *pwerr) { - struct winreg_String wvalue = { 0, }; + struct winreg_String wvalue; DATA_BLOB blob; WERROR result = WERR_OK; NTSTATUS status; + ZERO_STRUCT(wvalue); wvalue.name = value; - blob = data_blob_talloc(mem_ctx, NULL, 4); + blob = data_blob_talloc_zero(mem_ctx, 4); SIVAL(blob.data, 0, data); status = dcerpc_winreg_SetValue(h, -- cgit