From f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 9 May 2010 17:20:01 +0200 Subject: Finish removal of iconv_convenience in public API's. --- source4/libcli/cliconnect.c | 6 +----- source4/libcli/dgram/browse.c | 6 +++--- source4/libcli/dgram/dgramsocket.c | 8 +++----- source4/libcli/dgram/libdgram.h | 3 +-- source4/libcli/dgram/netlogon.c | 13 +++++-------- source4/libcli/finddcs.c | 9 +-------- source4/libcli/raw/clitransport.c | 8 +++----- source4/libcli/raw/clitree.c | 2 -- source4/libcli/raw/rawacl.c | 4 ++-- source4/libcli/raw/rawfile.c | 2 +- source4/libcli/raw/rawfileinfo.c | 6 +++--- source4/libcli/raw/rawsetfileinfo.c | 3 +-- source4/libcli/resolve/nbtlist.c | 3 +-- source4/libcli/smb2/create.c | 3 +-- source4/libcli/smb_composite/connect.c | 2 +- source4/libcli/util/clilsa.c | 3 +-- source4/libcli/wrepl/winsrepl.c | 9 +-------- 17 files changed, 29 insertions(+), 61 deletions(-) (limited to 'source4/libcli') diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 1a5bd607b4..d670324c88 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -35,7 +35,6 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, struct tevent_context *ev_ctx, struct resolve_context *resolve_ctx, struct smbcli_options *options, - struct smb_iconv_convenience *iconv_convenience, const char *socket_options) { struct smbcli_socket *sock; @@ -46,8 +45,7 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server, if (sock == NULL) return false; - cli->transport = smbcli_transport_init(sock, cli, true, options, - iconv_convenience); + cli->transport = smbcli_transport_init(sock, cli, true, options); if (!cli->transport) { return false; } @@ -154,7 +152,6 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, struct tevent_context *ev, struct smbcli_options *options, struct smbcli_session_options *session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { struct smbcli_tree *tree; @@ -169,7 +166,6 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, credentials, resolve_ctx, ev, options, session_options, - iconv_convenience, gensec_settings); if (!NT_STATUS_IS_OK(status)) { goto done; diff --git a/source4/libcli/dgram/browse.c b/source4/libcli/dgram/browse.c index 14d8278635..ab831df8cc 100644 --- a/source4/libcli/dgram/browse.c +++ b/source4/libcli/dgram/browse.c @@ -38,7 +38,7 @@ NTSTATUS dgram_mailslot_browse_send(struct nbt_dgram_socket *dgmsock, DATA_BLOB blob; TALLOC_CTX *tmp_ctx = talloc_new(dgmsock); - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, request, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, request, (ndr_push_flags_fn_t)ndr_push_nbt_browse_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -66,7 +66,7 @@ NTSTATUS dgram_mailslot_browse_reply(struct nbt_dgram_socket *dgmsock, struct nbt_name myname; struct socket_address *dest; - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, reply, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, reply, (ndr_push_flags_fn_t)ndr_push_nbt_browse_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -99,7 +99,7 @@ NTSTATUS dgram_mailslot_browse_parse(struct dgram_mailslot_handler *dgmslot, DATA_BLOB data = dgram_mailslot_data(dgram); enum ndr_err_code ndr_err; - ndr_err = ndr_pull_struct_blob(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, pkt, + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, pkt, (ndr_pull_flags_fn_t)ndr_pull_nbt_browse_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c index 365960edb6..4dd17412af 100644 --- a/source4/libcli/dgram/dgramsocket.c +++ b/source4/libcli/dgram/dgramsocket.c @@ -71,7 +71,7 @@ static void dgm_socket_recv(struct nbt_dgram_socket *dgmsock) } /* parse the request */ - ndr_err = ndr_pull_struct_blob(&blob, packet, dgmsock->iconv_convenience, packet, + ndr_err = ndr_pull_struct_blob(&blob, packet, packet, (ndr_pull_flags_fn_t)ndr_pull_nbt_dgram_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -157,8 +157,7 @@ static void dgm_socket_handler(struct tevent_context *ev, struct tevent_fd *fde, then operations will use that event context */ struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx, - struct tevent_context *event_ctx, - struct smb_iconv_convenience *iconv_convenience) + struct tevent_context *event_ctx) { struct nbt_dgram_socket *dgmsock; NTSTATUS status; @@ -183,7 +182,6 @@ struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx, dgmsock->send_queue = NULL; dgmsock->incoming.handler = NULL; dgmsock->mailslot_handlers = NULL; - dgmsock->iconv_convenience = iconv_convenience; return dgmsock; @@ -226,7 +224,7 @@ NTSTATUS nbt_dgram_send(struct nbt_dgram_socket *dgmsock, req->dest = dest; if (talloc_reference(req, dest) == NULL) goto failed; - ndr_err = ndr_push_struct_blob(&req->encoded, req, dgmsock->iconv_convenience, packet, + ndr_err = ndr_push_struct_blob(&req->encoded, req, packet, (ndr_push_flags_fn_t)ndr_push_nbt_dgram_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/libcli/dgram/libdgram.h b/source4/libcli/dgram/libdgram.h index a17a6042d9..d122281909 100644 --- a/source4/libcli/dgram/libdgram.h +++ b/source4/libcli/dgram/libdgram.h @@ -93,8 +93,7 @@ NTSTATUS dgram_set_incoming_handler(struct nbt_dgram_socket *dgmsock, struct socket_address *), void *private_data); struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx, - struct tevent_context *event_ctx, - struct smb_iconv_convenience *); + struct tevent_context *event_ctx); const char *dgram_mailslot_name(struct nbt_dgram_packet *packet); struct dgram_mailslot_handler *dgram_mailslot_find(struct nbt_dgram_socket *dgmsock, diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c index 26b00bdafd..0aa6864248 100644 --- a/source4/libcli/dgram/netlogon.c +++ b/source4/libcli/dgram/netlogon.c @@ -40,9 +40,7 @@ NTSTATUS dgram_mailslot_netlogon_send(struct nbt_dgram_socket *dgmsock, DATA_BLOB blob; TALLOC_CTX *tmp_ctx = talloc_new(dgmsock); - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, - dgmsock->iconv_convenience, - request, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, request, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -74,8 +72,7 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock, struct nbt_name myname; struct socket_address *dest; - status = push_nbt_netlogon_response(&blob, tmp_ctx, dgmsock->iconv_convenience, - reply); + status = push_nbt_netlogon_response(&blob, tmp_ctx, reply); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -110,8 +107,8 @@ NTSTATUS dgram_mailslot_netlogon_parse_request(struct dgram_mailslot_handler *dg DATA_BLOB data = dgram_mailslot_data(dgram); enum ndr_err_code ndr_err; - ndr_err = ndr_pull_struct_blob(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, netlogon, - (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet); + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, netlogon, + (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); DEBUG(0,("Failed to parse netlogon packet of length %d: %s\n", @@ -135,7 +132,7 @@ NTSTATUS dgram_mailslot_netlogon_parse_response(struct dgram_mailslot_handler *d NTSTATUS status; DATA_BLOB data = dgram_mailslot_data(dgram); - status = pull_nbt_netlogon_response(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, netlogon); + status = pull_nbt_netlogon_response(&data, mem_ctx, netlogon); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 04b25d37ef..bb4c77dab0 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -40,8 +40,6 @@ struct finddcs_state { struct nbtd_getdcname r; struct nbt_name_status node_status; - struct smb_iconv_convenience *iconv_convenience; - int num_dcs; struct nbt_dc_name *dcs; uint16_t nbt_port; @@ -68,7 +66,6 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, const char *domain_name, int name_type, struct dom_sid *domain_sid, - struct smb_iconv_convenience *iconv_convenience, struct resolve_context *resolve_ctx, struct tevent_context *event_ctx, struct messaging_context *msg_ctx) @@ -89,7 +86,6 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->nbt_port = nbt_port; state->my_netbios_name = talloc_strdup(state, my_netbios_name); state->domain_name = talloc_strdup(state, domain_name); - state->iconv_convenience = iconv_convenience; if (composite_nomem(state->domain_name, c)) return c; if (domain_sid) { @@ -202,8 +198,7 @@ static void fallback_node_status(struct finddcs_state *state) state->node_status.in.timeout = 1; state->node_status.in.retries = 2; - nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx, - state->iconv_convenience); + nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx); if (composite_nomem(nbtsock, state->ctx)) return; name_req = nbt_name_status_send(nbtsock, &state->node_status); @@ -261,7 +256,6 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, uint16_t nbt_port, const char *domain_name, int name_type, struct dom_sid *domain_sid, - struct smb_iconv_convenience *iconv_convenience, struct resolve_context *resolve_ctx, struct tevent_context *event_ctx, struct messaging_context *msg_ctx, @@ -272,7 +266,6 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, nbt_port, domain_name, name_type, domain_sid, - iconv_convenience, resolve_ctx, event_ctx, msg_ctx); return finddcs_recv(c, mem_ctx, num_dcs, dcs); diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index f5e81cd6f6..7a3993c79b 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -75,8 +75,7 @@ static NTSTATUS smbcli_transport_finish_recv(void *private_data, DATA_BLOB blob) struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock, TALLOC_CTX *parent_ctx, bool primary, - struct smbcli_options *options, - struct smb_iconv_convenience *iconv_convenience) + struct smbcli_options *options) { struct smbcli_transport *transport; @@ -91,7 +90,6 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock, transport->negotiate.protocol = PROTOCOL_NT1; transport->options = *options; transport->negotiate.max_xmit = transport->options.max_xmit; - transport->iconv_convenience = iconv_convenience; /* setup the stream -> packet parser */ transport->packet = packet_init(transport); @@ -172,10 +170,10 @@ struct smbcli_request *smbcli_transport_connect_send(struct smbcli_transport *tr status = nbt_name_dup(transport, called, &transport->called); if (!NT_STATUS_IS_OK(status)) goto failed; - status = nbt_name_to_blob(tmp_ctx, transport->iconv_convenience, &calling_blob, calling); + status = nbt_name_to_blob(tmp_ctx, &calling_blob, calling); if (!NT_STATUS_IS_OK(status)) goto failed; - status = nbt_name_to_blob(tmp_ctx, transport->iconv_convenience, &called_blob, called); + status = nbt_name_to_blob(tmp_ctx, &called_blob, called); if (!NT_STATUS_IS_OK(status)) goto failed; /* allocate output buffer */ diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index a083396f35..cee1cd0bf0 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -179,7 +179,6 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, struct tevent_context *ev, struct smbcli_options *options, struct smbcli_session_options *session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { struct smb_composite_connect io; @@ -205,7 +204,6 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, io.in.workgroup = ""; io.in.options = *options; io.in.session_options = *session_options; - io.in.iconv_convenience = iconv_convenience; status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev); if (NT_STATUS_IS_OK(status)) { diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c index e13ba85361..c2de2cc7d2 100644 --- a/source4/libcli/raw/rawacl.c +++ b/source4/libcli/raw/rawacl.c @@ -77,7 +77,7 @@ 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, NULL); + ndr = ndr_pull_init_blob(&nt.out.data, mem_ctx); if (!ndr) { return NT_STATUS_INVALID_PARAMETER; } @@ -135,7 +135,7 @@ struct smbcli_request *smb_raw_set_secdesc_send(struct smbcli_tree *tree, nt.in.params.data = params; nt.in.params.length = 8; - ndr = ndr_push_init_ctx(NULL, NULL); + ndr = ndr_push_init_ctx(NULL); if (!ndr) return NULL; ndr_err = ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, io->set_secdesc.in.sd); diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c index 1509c83e00..5797540edd 100644 --- a/source4/libcli/raw/rawfile.c +++ b/source4/libcli/raw/rawfile.c @@ -348,7 +348,7 @@ static struct smbcli_request *smb_raw_nttrans_create_send(struct smbcli_tree *tr if (parms->ntcreatex.in.sec_desc) { enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&sd_blob, mem_ctx, NULL, + ndr_err = ndr_push_struct_blob(&sd_blob, mem_ctx, parms->ntcreatex.in.sec_desc, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c index f81a8071d1..08598a2d64 100644 --- a/source4/libcli/raw/rawfileinfo.c +++ b/source4/libcli/raw/rawfileinfo.c @@ -253,9 +253,9 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_ parms->query_secdesc.out.sd = talloc(mem_ctx, struct security_descriptor); NT_STATUS_HAVE_NO_MEMORY(parms->query_secdesc.out.sd); - ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, - parms->query_secdesc.out.sd, - (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); + ndr_err = ndr_pull_struct_blob(blob, mem_ctx, + parms->query_secdesc.out.sd, + (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c index 892d5e483b..6ad3e9ee8d 100644 --- a/source4/libcli/raw/rawsetfileinfo.c +++ b/source4/libcli/raw/rawsetfileinfo.c @@ -99,8 +99,7 @@ bool smb_raw_setfileinfo_passthru(TALLOC_CTX *mem_ctx, case RAW_FILEINFO_SEC_DESC: { enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(blob, mem_ctx, NULL, - parms->set_secdesc.in.sd, + ndr_err = ndr_push_struct_blob(blob, mem_ctx, parms->set_secdesc.in.sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c index 73085b87cb..64d72bcc51 100644 --- a/source4/libcli/resolve/nbtlist.c +++ b/source4/libcli/resolve/nbtlist.c @@ -163,8 +163,7 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx, return c; } - state->nbtsock = nbt_name_socket_init(state, event_ctx, - global_iconv_convenience); + state->nbtsock = nbt_name_socket_init(state, event_ctx); if (composite_nomem(state->nbtsock, c)) return c; /* count the address_list size */ diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c index c9fb4ea4e0..4e15064185 100644 --- a/source4/libcli/smb2/create.c +++ b/source4/libcli/smb2/create.c @@ -131,8 +131,7 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create if (io->in.sec_desc) { enum ndr_err_code ndr_err; DATA_BLOB sd_blob; - ndr_err = ndr_push_struct_blob(&sd_blob, req, NULL, - io->in.sec_desc, + ndr_err = ndr_push_struct_blob(&sd_blob, req, io->in.sec_desc, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(req); diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c index 16f2af9b3d..d36bf26914 100644 --- a/source4/libcli/smb_composite/connect.c +++ b/source4/libcli/smb_composite/connect.c @@ -323,7 +323,7 @@ static NTSTATUS connect_socket(struct composite_context *c, /* the socket is up - we can initialise the smbcli transport layer */ state->transport = smbcli_transport_init(state->sock, state, true, - &io->in.options, io->in.iconv_convenience); + &io->in.options); NT_STATUS_HAVE_NO_MEMORY(state->transport); if (is_ipaddress(state->sock->hostname) && diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index 50435cf000..4cfdf93725 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -79,8 +79,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli) } lsa->ipc_tree->tid = tcon.tconx.out.tid; - lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx, - cli->transport->iconv_convenience); + lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx); if (lsa->pipe == NULL) { talloc_free(lsa); return NT_STATUS_NO_MEMORY; diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index ec7e3798dc..75cb34f632 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -45,8 +45,6 @@ struct wrepl_socket { #define WREPL_SOCKET_REQUEST_TIMEOUT (60) uint32_t request_timeout; - struct smb_iconv_convenience *iconv_convenience; - struct tevent_queue *request_queue; struct tstream_context *stream; @@ -70,8 +68,7 @@ bool wrepl_socket_is_connected(struct wrepl_socket *wrepl_sock) operations will use that event context */ struct wrepl_socket *wrepl_socket_init(TALLOC_CTX *mem_ctx, - struct tevent_context *event_ctx, - struct smb_iconv_convenience *iconv_convenience) + struct tevent_context *event_ctx) { struct wrepl_socket *wrepl_socket; @@ -91,8 +88,6 @@ struct wrepl_socket *wrepl_socket_init(TALLOC_CTX *mem_ctx, goto failed; } - wrepl_socket->iconv_convenience = iconv_convenience; - wrepl_socket->request_timeout = WREPL_SOCKET_REQUEST_TIMEOUT; return wrepl_socket; @@ -370,7 +365,6 @@ struct tevent_req *wrepl_request_send(TALLOC_CTX *mem_ctx, state->req.wrap.packet = *packet; ndr_err = ndr_push_struct_blob(&state->req.blob, state, - wrepl_socket->iconv_convenience, &state->req.wrap, (ndr_push_flags_fn_t)ndr_push_wrepl_wrap); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -540,7 +534,6 @@ static void wrepl_request_read_pdu_done(struct tevent_req *subreq) /* we have a full request - parse it */ ndr_err = ndr_pull_struct_blob(&blob, state->rep.packet, - state->caller.wrepl_socket->iconv_convenience, state->rep.packet, (ndr_pull_flags_fn_t)ndr_pull_wrepl_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { -- cgit