summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-13 22:46:23 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:50:00 +0100
commit61873ce94c172c801a4831de5550a8e0fe54c5f5 (patch)
tree1adef0ad4078d98bd8529be8219af84938886f65 /source4/librpc
parenta2cea02584256e2cf59da5420e8e080e70c66939 (diff)
downloadsamba-61873ce94c172c801a4831de5550a8e0fe54c5f5.tar.gz
samba-61873ce94c172c801a4831de5550a8e0fe54c5f5.tar.bz2
samba-61873ce94c172c801a4831de5550a8e0fe54c5f5.zip
r26431: Require ndr_push creators to specify a iconv_convenience context.
(This used to be commit 7352206f4450fdf881b95bda064cedd9d2477e4c)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/ndr/ndr.c14
-rw-r--r--source4/librpc/ndr/ndr_compression.c6
-rw-r--r--source4/librpc/ndr/ndr_spoolss_buf.c9
-rw-r--r--source4/librpc/rpc/dcerpc.c10
-rw-r--r--source4/librpc/rpc/dcerpc_util.c4
-rw-r--r--source4/librpc/tools/ndrdump.c3
6 files changed, 24 insertions, 22 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 070ad99a82..f547bd3d0f 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -101,7 +101,7 @@ static enum ndr_err_code ndr_pull_set_offset(struct ndr_pull *ndr, uint32_t ofs)
}
/* create a ndr_push structure, ready for some marshalling */
-_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
+_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience)
{
struct ndr_push *ndr;
@@ -116,7 +116,7 @@ _PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
if (!ndr->data) {
return NULL;
}
- ndr->iconv_convenience = talloc_reference(ndr, lp_iconv_convenience(global_loadparm));
+ ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience);
return ndr;
}
@@ -471,7 +471,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_subcontext_start(struct ndr_push *ndr,
{
struct ndr_push *subndr;
- subndr = ndr_push_init_ctx(ndr);
+ subndr = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(subndr);
subndr->flags = ndr->flags;
@@ -759,7 +759,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem
ndr_push_flags_fn_t fn)
{
struct ndr_push *ndr;
- ndr = ndr_push_init_ctx(mem_ctx);
+ ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
NDR_ERR_HAVE_NO_MEMORY(ndr);
NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
@@ -778,7 +778,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_
uint32_t level, ndr_push_flags_fn_t fn)
{
struct ndr_push *ndr;
- ndr = ndr_push_init_ctx(mem_ctx);
+ ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
NDR_ERR_HAVE_NO_MEMORY(ndr);
NDR_CHECK(ndr_push_set_switch_value(ndr, p, level));
@@ -803,7 +803,7 @@ _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t pu
/* avoid recursion */
if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
- ndr = ndr_push_init_ctx(NULL);
+ ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
if (!ndr) return 0;
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
@@ -828,7 +828,7 @@ _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_pus
/* avoid recursion */
if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
- ndr = ndr_push_init_ctx(NULL);
+ ndr = ndr_push_init_ctx(NULL, lp_iconv_convenience(global_loadparm));
if (!ndr) return 0;
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
diff --git a/source4/librpc/ndr/ndr_compression.c b/source4/librpc/ndr/ndr_compression.c
index 411d4a17e2..310f8c4ce4 100644
--- a/source4/librpc/ndr/ndr_compression.c
+++ b/source4/librpc/ndr/ndr_compression.c
@@ -86,7 +86,7 @@ static enum ndr_err_code ndr_pull_compression_mszip(struct ndr_pull *subndr,
struct decomp_state *decomp_state;
bool last = false;
- ndrpush = ndr_push_init_ctx(subndr);
+ ndrpush = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(ndrpush);
decomp_state = ZIPdecomp_state(subndr);
@@ -197,7 +197,7 @@ static enum ndr_err_code ndr_pull_compression_xpress(struct ndr_pull *subndr,
DATA_BLOB uncompressed;
bool last = false;
- ndrpush = ndr_push_init_ctx(subndr);
+ ndrpush = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(ndrpush);
while (!last) {
@@ -264,7 +264,7 @@ enum ndr_err_code ndr_push_compression_start(struct ndr_push *subndr,
{
struct ndr_push *comndr;
- comndr = ndr_push_init_ctx(subndr);
+ comndr = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(comndr);
comndr->flags = subndr->flags;
diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c
index 9800430203..d389c26255 100644
--- a/source4/librpc/ndr/ndr_spoolss_buf.c
+++ b/source4/librpc/ndr/ndr_spoolss_buf.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_spoolss.h"
+#include "param/param.h"
#define NDR_SPOOLSS_PUSH_ENUM_IN(fn) do { \
if (!r->in.buffer && r->in.offered != 0) {\
@@ -55,7 +56,7 @@
}\
if (r->in.buffer) {\
DATA_BLOB _data_blob_info;\
- _ndr_info = ndr_push_init_ctx(ndr);\
+ _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);\
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
_ndr_info->flags= ndr->flags;\
if (r->out.info) {\
@@ -164,7 +165,7 @@
#define NDR_SPOOLSS_SIZE_ENUM(fn) do { \
struct __##fn __r;\
DATA_BLOB _data_blob_info;\
- struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\
+ struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));\
if (!_ndr_info) return 0;\
_ndr_info->flags|=0;\
__r.in.level = level;\
@@ -414,7 +415,7 @@ enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flag
_r.out.result = r->out.result;
{
struct __spoolss_GetPrinterData __r;
- _ndr_info = ndr_push_init_ctx(ndr);
+ _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
_ndr_info->flags= ndr->flags;
__r.in.type = r->out.type;
@@ -494,7 +495,7 @@ enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flag
struct __spoolss_SetPrinterData __r;
DATA_BLOB _data_blob_data;
- _ndr_data = ndr_push_init_ctx(ndr);
+ _ndr_data = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
NDR_ERR_HAVE_NO_MEMORY(_ndr_data);
_ndr_data->flags= ndr->flags;
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 432cd09094..a1b1f6e825 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -350,7 +350,7 @@ static NTSTATUS ncacn_push_request_sign(struct dcerpc_connection *c,
return ncacn_push_auth(blob, mem_ctx, pkt, c->security_state.auth_info);
}
- ndr = ndr_push_init_ctx(mem_ctx);
+ ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!ndr) {
return NT_STATUS_NO_MEMORY;
}
@@ -1194,7 +1194,7 @@ static NTSTATUS dcerpc_ndr_validate_in(struct dcerpc_connection *c,
return ndr_map_error2ntstatus(ndr_err);
}
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!push) {
return NT_STATUS_NO_MEMORY;
}
@@ -1252,7 +1252,7 @@ static NTSTATUS dcerpc_ndr_validate_out(struct dcerpc_connection *c,
}
memcpy(st, struct_ptr, struct_size);
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!push) {
return NT_STATUS_NO_MEMORY;
}
@@ -1283,7 +1283,7 @@ static NTSTATUS dcerpc_ndr_validate_out(struct dcerpc_connection *c,
return ndr_map_error2ntstatus(ndr_err);
}
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!push) {
return NT_STATUS_NO_MEMORY;
}
@@ -1354,7 +1354,7 @@ struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p,
call = &table->calls[opnum];
/* setup for a ndr_push_* call */
- push = ndr_push_init_ctx(mem_ctx);
+ push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!push) {
return NULL;
}
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 2fa34140f6..c53bdca9d1 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -56,7 +56,7 @@ NTSTATUS ncacn_push_auth(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
struct ndr_push *ndr;
enum ndr_err_code ndr_err;
- ndr = ndr_push_init_ctx(mem_ctx);
+ ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
if (!ndr) {
return NT_STATUS_NO_MEMORY;
}
@@ -466,7 +466,7 @@ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_synta
static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
{
- struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
+ struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm));
ndr->flags |= LIBNDR_FLAG_NOALIGN;
diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c
index a86b349aa9..7ee702fefb 100644
--- a/source4/librpc/tools/ndrdump.c
+++ b/source4/librpc/tools/ndrdump.c
@@ -25,6 +25,7 @@
#include "system/locale.h"
#include "librpc/ndr/libndr.h"
#include "librpc/ndr/ndr_table.h"
+#include "param/param.h"
#endif
static const struct ndr_interface_call *find_function(
@@ -379,7 +380,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
uint8_t byte_a, byte_b;
bool differ;
- ndr_v_push = ndr_push_init_ctx(mem_ctx);
+ ndr_v_push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
ndr_err = f->ndr_push(ndr_v_push, flags, st);
status = ndr_map_error2ntstatus(ndr_err);