diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/messaging/messaging.c | 2 | ||||
-rw-r--r-- | source4/lib/samba3/share_info.c | 2 | ||||
-rw-r--r-- | source4/libcli/raw/rawacl.c | 3 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr.c | 12 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_spoolss_buf.c | 4 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 4 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 2 | ||||
-rw-r--r-- | source4/librpc/tools/ndrdump.c | 6 | ||||
-rw-r--r-- | source4/ntvfs/ipc/ipc_rap.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 5 | ||||
-rw-r--r-- | source4/rpc_server/dcesrv_auth.c | 2 | ||||
-rw-r--r-- | source4/torture/ndr/ndr.c | 7 | ||||
-rw-r--r-- | source4/torture/rap/rap.c | 6 | ||||
-rw-r--r-- | source4/torture/rpc/eventlog.c | 3 | ||||
-rw-r--r-- | source4/utils/getntacl.c | 3 |
15 files changed, 36 insertions, 29 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 9497e5248c..af742f7374 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -798,7 +798,7 @@ static void irpc_handler(struct messaging_context *msg_ctx, void *private, m->from = src; - m->ndr = ndr_pull_init_blob(packet, m); + m->ndr = ndr_pull_init_blob(packet, m, lp_iconv_convenience(global_loadparm)); if (m->ndr == NULL) goto failed; m->ndr->flags |= LIBNDR_FLAG_REF_ALLOC; diff --git a/source4/lib/samba3/share_info.c b/source4/lib/samba3/share_info.c index e0778fafb5..4dd15aa918 100644 --- a/source4/lib/samba3/share_info.c +++ b/source4/lib/samba3/share_info.c @@ -76,7 +76,7 @@ NTSTATUS samba3_read_share_info(const char *fn, TALLOC_CTX *ctx, struct samba3 * blob.data = (uint8_t *)vbuf.dptr; blob.length = vbuf.dsize; - pull = ndr_pull_init_blob(&blob, ctx); + pull = ndr_pull_init_blob(&blob, ctx, lp_iconv_convenience(global_loadparm)); ndr_pull_security_descriptor(pull, NDR_SCALARS|NDR_BUFFERS, &share->secdesc); diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c index e7747de94c..9d2068f35f 100644 --- a/source4/libcli/raw/rawacl.c +++ b/source4/libcli/raw/rawacl.c @@ -77,7 +77,8 @@ NTSTATUS smb_raw_query_secdesc_recv(struct smbcli_request *req, nt.out.data.length = IVAL(nt.out.params.data, 0); - ndr = ndr_pull_init_blob(&nt.out.data, mem_ctx); + ndr = ndr_pull_init_blob(&nt.out.data, mem_ctx, + lp_iconv_convenience(global_loadparm)); if (!ndr) { return NT_STATUS_INVALID_PARAMETER; } diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index f547bd3d0f..0dafda7086 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -57,7 +57,7 @@ _PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n) /* initialise a ndr parse structure from a data blob */ -_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx) +_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience) { struct ndr_pull *ndr; @@ -67,7 +67,7 @@ _PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX * ndr->data = blob->data; ndr->data_size = blob->length; - ndr->iconv_convenience = talloc_reference(ndr, lp_iconv_convenience(global_loadparm)); + ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience); return ndr; } @@ -694,7 +694,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CT ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - ndr = ndr_pull_init_blob(blob, mem_ctx); + ndr = ndr_pull_init_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm)); NDR_ERR_HAVE_NO_MEMORY(ndr); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); return NDR_ERR_SUCCESS; @@ -707,7 +707,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLO ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - ndr = ndr_pull_init_blob(blob, mem_ctx); + ndr = ndr_pull_init_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm)); NDR_ERR_HAVE_NO_MEMORY(ndr); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); if (ndr->offset < ndr->data_size) { @@ -725,7 +725,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX uint32_t level, ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - ndr = ndr_pull_init_blob(blob, mem_ctx); + ndr = ndr_pull_init_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm)); NDR_ERR_HAVE_NO_MEMORY(ndr); NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level)); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); @@ -740,7 +740,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC uint32_t level, ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - ndr = ndr_pull_init_blob(blob, mem_ctx); + ndr = ndr_pull_init_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm)); NDR_ERR_HAVE_NO_MEMORY(ndr); NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level)); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c index d389c26255..e01c5fd225 100644 --- a/source4/librpc/ndr/ndr_spoolss_buf.c +++ b/source4/librpc/ndr/ndr_spoolss_buf.c @@ -121,7 +121,7 @@ r->out.count = _r.out.count;\ r->out.result = _r.out.result;\ if (_r.out.info) {\ - struct ndr_pull *_ndr_info = ndr_pull_init_blob(_r.out.info, ndr);\ + struct ndr_pull *_ndr_info = ndr_pull_init_blob(_r.out.info, ndr, ndr->iconv_convenience);\ NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\ _ndr_info->flags= ndr->flags;\ if (r->in.offered != _ndr_info->data_size) {\ @@ -470,7 +470,7 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag } if (_r.out.data.length > 0 && r->out.needed <= _r.out.data.length) { struct __spoolss_GetPrinterData __r; - struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr); + struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr, ndr->iconv_convenience); NDR_ERR_HAVE_NO_MEMORY(_ndr_data); _ndr_data->flags= ndr->flags; __r.in.type = r->out.type; diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index a1b1f6e825..f5eae1b09a 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -164,13 +164,13 @@ void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v) } -/* +/** setup for a ndr pull, also setting up any flags from the binding string */ static struct ndr_pull *ndr_pull_init_flags(struct dcerpc_connection *c, DATA_BLOB *blob, TALLOC_CTX *mem_ctx) { - struct ndr_pull *ndr = ndr_pull_init_blob(blob, mem_ctx); + struct ndr_pull *ndr = ndr_pull_init_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm)); if (ndr == NULL) return ndr; diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index c53bdca9d1..b8fcfb904a 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -439,7 +439,7 @@ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax) { TALLOC_CTX *mem_ctx = talloc_init("floor_get_lhs_data"); - struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx); + struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, lp_iconv_convenience(global_loadparm)); enum ndr_err_code ndr_err; uint16_t if_version=0; diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c index 7ee702fefb..bc1436916f 100644 --- a/source4/librpc/tools/ndrdump.c +++ b/source4/librpc/tools/ndrdump.c @@ -304,7 +304,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) blob.data = data; blob.length = size; - ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); + ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx)); ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = f->ndr_pull(ndr_pull, NDR_IN, st); @@ -341,7 +341,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) blob.data = data; blob.length = size; - ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); + ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx)); ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = f->ndr_pull(ndr_pull, flags, st); @@ -397,7 +397,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) ndrdump_data(v_blob.data, v_blob.length, dumpdata); } - ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx); + ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx)); ndr_v_pull->flags |= LIBNDR_FLAG_REF_ALLOC; ndr_err = f->ndr_pull(ndr_v_pull, flags, v_st); diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c index 0636e42e16..85bc5c212f 100644 --- a/source4/ntvfs/ipc/ipc_rap.c +++ b/source4/ntvfs/ipc/ipc_rap.c @@ -116,10 +116,10 @@ static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx, call->mem_ctx = mem_ctx; - call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx); + call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx, lp_iconv_convenience(global_loadparm)); call->ndr_pull_param->flags = RAPNDR_FLAGS; - call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx); + call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx, lp_iconv_convenience(global_loadparm)); call->ndr_pull_data->flags = RAPNDR_FLAGS; call->heap = talloc(mem_ctx, struct rap_string_heap); diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index db4136a853..cf89143b34 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -821,7 +821,8 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call) return dcesrv_fault(call, DCERPC_FAULT_UNK_IF); } - pull = ndr_pull_init_blob(&call->pkt.u.request.stub_and_verifier, call); + pull = ndr_pull_init_blob(&call->pkt.u.request.stub_and_verifier, call, + lp_iconv_convenience(global_loadparm)); NT_STATUS_HAVE_NO_MEMORY(pull); pull->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -1049,7 +1050,7 @@ NTSTATUS dcesrv_input_process(struct dcesrv_connection *dce_conn) blob = dce_conn->partial_input; blob.length = dcerpc_get_frag_length(&blob); - ndr = ndr_pull_init_blob(&blob, call); + ndr = ndr_pull_init_blob(&blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); if (!ndr) { talloc_free(dce_conn->partial_input.data); talloc_free(call); diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index b7c0e2a833..b32481a1b7 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -326,7 +326,7 @@ bool dcesrv_auth_request(struct dcesrv_call_state *call, DATA_BLOB *full_packet) pkt->u.request.stub_and_verifier.length -= auth_blob.length; /* pull the auth structure */ - ndr = ndr_pull_init_blob(&auth_blob, call); + ndr = ndr_pull_init_blob(&auth_blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); if (!ndr) { return false; } diff --git a/source4/torture/ndr/ndr.c b/source4/torture/ndr/ndr.c index e1e2918cba..55b00d1fb8 100644 --- a/source4/torture/ndr/ndr.c +++ b/source4/torture/ndr/ndr.c @@ -23,6 +23,7 @@ #include "torture/ndr/proto.h" #include "torture/ui.h" #include "util/dlinklist.h" +#include "param/param.h" struct ndr_pull_test_data { DATA_BLOB data; @@ -38,7 +39,7 @@ static bool wrap_ndr_pull_test(struct torture_context *tctx, bool (*check_fn) (struct torture_context *ctx, void *data) = test->fn; const struct ndr_pull_test_data *data = (const struct ndr_pull_test_data *)test->data; void *ds = talloc_zero_size(tctx, data->struct_size); - struct ndr_pull *ndr = ndr_pull_init_blob(&(data->data), tctx); + struct ndr_pull *ndr = ndr_pull_init_blob(&(data->data), tctx, lp_iconv_convenience(tctx->lp_ctx)); ndr->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -97,7 +98,7 @@ static bool test_check_string_terminator(struct torture_context *tctx) /* Simple test */ blob = strhex_to_data_blob("0000"); - ndr = ndr_pull_init_blob(&blob, mem_ctx); + ndr = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); torture_assert_ndr_success(tctx, ndr_check_string_terminator(ndr, 1, 2), "simple check_string_terminator test failed"); @@ -115,7 +116,7 @@ static bool test_check_string_terminator(struct torture_context *tctx) talloc_free(ndr); blob = strhex_to_data_blob("11220000"); - ndr = ndr_pull_init_blob(&blob, mem_ctx); + ndr = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); torture_assert_ndr_success(tctx, ndr_check_string_terminator(ndr, 4, 1), diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c index 8e630b6781..5294e00df9 100644 --- a/source4/torture/rap/rap.c +++ b/source4/torture/rap/rap.c @@ -229,10 +229,12 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, struct rap_call *call) if (!NT_STATUS_IS_OK(result)) return result; - call->ndr_pull_param = ndr_pull_init_blob(&trans.out.params, call); + call->ndr_pull_param = ndr_pull_init_blob(&trans.out.params, call, + lp_iconv_convenience(global_loadparm)); call->ndr_pull_param->flags = RAPNDR_FLAGS; - call->ndr_pull_data = ndr_pull_init_blob(&trans.out.data, call); + call->ndr_pull_data = ndr_pull_init_blob(&trans.out.data, call, + lp_iconv_convenience(global_loadparm)); call->ndr_pull_data->flags = RAPNDR_FLAGS; return result; diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 64b012fba6..047146edaf 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -25,6 +25,7 @@ #include "librpc/gen_ndr/ndr_eventlog_c.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "torture/rpc/rpc.h" +#include "param/param.h" static void init_lsa_String(struct lsa_String *name, const char *s) { @@ -137,7 +138,7 @@ static bool test_ReadEventLog(struct torture_context *tctx, blob.length = *r.out.sent_size; blob.data = talloc_steal(tctx, r.out.data); - ndr = ndr_pull_init_blob(&blob, tctx); + ndr = ndr_pull_init_blob(&blob, tctx, lp_iconv_convenience(tctx->lp_ctx)); ndr_err = ndr_pull_eventlog_Record( ndr, NDR_SCALARS|NDR_BUFFERS, &rec); diff --git a/source4/utils/getntacl.c b/source4/utils/getntacl.c index 382a020c40..e1ab97b4d5 100644 --- a/source4/utils/getntacl.c +++ b/source4/utils/getntacl.c @@ -23,6 +23,7 @@ #include "system/filesys.h" #include "librpc/gen_ndr/ndr_xattr.h" #include "lib/util/wrap_xattr.h" +#include "param/param.h" static void ntacl_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); @@ -71,7 +72,7 @@ static NTSTATUS get_ntacl(TALLOC_CTX *mem_ctx, } blob.length = size; - ndr = ndr_pull_init_blob(&blob, NULL); + ndr = ndr_pull_init_blob(&blob, NULL, lp_iconv_convenience(global_loadparm)); ndr_err = ndr_pull_xattr_NTACL(ndr, NDR_SCALARS|NDR_BUFFERS, *ntacl); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { |