diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/auth/smbencrypt.c | 6 | ||||
-rw-r--r-- | source4/libcli/dgram/browse.c | 6 | ||||
-rw-r--r-- | source4/libcli/dgram/dgramsocket.c | 5 | ||||
-rw-r--r-- | source4/libcli/dgram/libdgram.h | 1 | ||||
-rw-r--r-- | source4/libcli/dgram/netlogon.c | 6 | ||||
-rw-r--r-- | source4/libcli/dgram/ntlogon.c | 6 | ||||
-rw-r--r-- | source4/libcli/nbt/nbtname.c | 4 | ||||
-rw-r--r-- | source4/libcli/raw/clitransport.c | 5 | ||||
-rw-r--r-- | source4/libcli/smb_composite/fetchfile.c | 4 | ||||
-rw-r--r-- | source4/libcli/smb_composite/smb_composite.h | 1 |
10 files changed, 25 insertions, 19 deletions
diff --git a/source4/libcli/auth/smbencrypt.c b/source4/libcli/auth/smbencrypt.c index 4ccf568d8c..c5223db63f 100644 --- a/source4/libcli/auth/smbencrypt.c +++ b/source4/libcli/auth/smbencrypt.c @@ -125,6 +125,8 @@ bool ntv2_owf_gen(const uint8_t owf[16], HMACMD5Context ctx; TALLOC_CTX *mem_ctx = talloc_init("ntv2_owf_gen for %s\\%s", domain_in, user_in); + struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(global_loadparm); + if (!mem_ctx) { return false; } @@ -151,14 +153,14 @@ bool ntv2_owf_gen(const uint8_t owf[16], } } - user_byte_len = push_ucs2_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), &user, user_in); + user_byte_len = push_ucs2_talloc(mem_ctx, iconv_convenience, &user, user_in); if (user_byte_len == (ssize_t)-1) { DEBUG(0, ("push_uss2_talloc() for user returned -1 (probably talloc() failure)\n")); talloc_free(mem_ctx); return false; } - domain_byte_len = push_ucs2_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), &domain, domain_in); + domain_byte_len = push_ucs2_talloc(mem_ctx, iconv_convenience, &domain, domain_in); if (domain_byte_len == (ssize_t)-1) { DEBUG(0, ("push_ucs2_talloc() for domain returned -1 (probably talloc() failure)\n")); talloc_free(mem_ctx); diff --git a/source4/libcli/dgram/browse.c b/source4/libcli/dgram/browse.c index eb19555d15..14d8278635 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, lp_iconv_convenience(global_loadparm), request, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, 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, lp_iconv_convenience(global_loadparm), reply, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, 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, lp_iconv_convenience(global_loadparm), pkt, + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, 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 032d9de67b..7d6f5627c5 100644 --- a/source4/libcli/dgram/dgramsocket.c +++ b/source4/libcli/dgram/dgramsocket.c @@ -72,7 +72,7 @@ static void dgm_socket_recv(struct nbt_dgram_socket *dgmsock) } /* parse the request */ - ndr_err = ndr_pull_struct_blob(&blob, packet, lp_iconv_convenience(global_loadparm), packet, + ndr_err = ndr_pull_struct_blob(&blob, packet, dgmsock->iconv_convenience, 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); @@ -187,6 +187,7 @@ 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 = lp_iconv_convenience(global_loadparm); return dgmsock; @@ -229,7 +230,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, lp_iconv_convenience(global_loadparm), packet, + ndr_err = ndr_push_struct_blob(&req->encoded, req, dgmsock->iconv_convenience, 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 6d4cdb2bdf..4645840971 100644 --- a/source4/libcli/dgram/libdgram.h +++ b/source4/libcli/dgram/libdgram.h @@ -40,6 +40,7 @@ struct nbt_dgram_request { struct nbt_dgram_socket { struct socket_context *sock; struct event_context *event_ctx; + struct smb_iconv_convenience *iconv_convenience; /* the fd event */ struct fd_event *fde; diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c index 670af4ea63..5c7dedc7bb 100644 --- a/source4/libcli/dgram/netlogon.c +++ b/source4/libcli/dgram/netlogon.c @@ -41,7 +41,7 @@ NTSTATUS dgram_mailslot_netlogon_send(struct nbt_dgram_socket *dgmsock, TALLOC_CTX *tmp_ctx = talloc_new(dgmsock); ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, - lp_iconv_convenience(global_loadparm), + dgmsock->iconv_convenience, request, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -76,7 +76,7 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock, struct socket_address *dest; ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, - lp_iconv_convenience(global_loadparm), + dgmsock->iconv_convenience, reply, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -114,7 +114,7 @@ NTSTATUS dgram_mailslot_netlogon_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, lp_iconv_convenience(global_loadparm), netlogon, + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, 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); diff --git a/source4/libcli/dgram/ntlogon.c b/source4/libcli/dgram/ntlogon.c index 98aad1af8c..7b26ed7c00 100644 --- a/source4/libcli/dgram/ntlogon.c +++ b/source4/libcli/dgram/ntlogon.c @@ -41,7 +41,7 @@ NTSTATUS dgram_mailslot_ntlogon_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, lp_iconv_convenience(global_loadparm), + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, request, (ndr_push_flags_fn_t)ndr_push_nbt_ntlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -75,7 +75,7 @@ NTSTATUS dgram_mailslot_ntlogon_reply(struct nbt_dgram_socket *dgmsock, struct nbt_name myname; struct socket_address *dest; - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, lp_iconv_convenience(global_loadparm), reply, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, dgmsock->iconv_convenience, reply, (ndr_push_flags_fn_t)ndr_push_nbt_ntlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -113,7 +113,7 @@ NTSTATUS dgram_mailslot_ntlogon_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, lp_iconv_convenience(global_loadparm), ntlogon, + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, dgmslot->dgmsock->iconv_convenience, ntlogon, (ndr_pull_flags_fn_t)ndr_pull_nbt_ntlogon_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c index 142dad0296..ae9f3f6b05 100644 --- a/source4/libcli/nbt/nbtname.c +++ b/source4/libcli/nbt/nbtname.c @@ -381,11 +381,11 @@ _PUBLIC_ NTSTATUS nbt_name_dup(TALLOC_CTX *mem_ctx, struct nbt_name *name, struc /** push a nbt name into a blob */ -_PUBLIC_ NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct nbt_name *name) +_PUBLIC_ NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, DATA_BLOB *blob, struct nbt_name *name) { enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(blob, mem_ctx, lp_iconv_convenience(global_loadparm), name, (ndr_push_flags_fn_t)ndr_push_nbt_name); + ndr_err = ndr_push_struct_blob(blob, mem_ctx, iconv_convenience, name, (ndr_push_flags_fn_t)ndr_push_nbt_name); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index 288f0612de..5c14e9f9b8 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -164,14 +164,15 @@ struct smbcli_request *smbcli_transport_connect_send(struct smbcli_transport *tr DATA_BLOB calling_blob, called_blob; TALLOC_CTX *tmp_ctx = talloc_new(transport); NTSTATUS status; + struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(global_loadparm); status = nbt_name_dup(transport, called, &transport->called); if (!NT_STATUS_IS_OK(status)) goto failed; - status = nbt_name_to_blob(tmp_ctx, &calling_blob, calling); + status = nbt_name_to_blob(tmp_ctx, iconv_convenience, &calling_blob, calling); if (!NT_STATUS_IS_OK(status)) goto failed; - status = nbt_name_to_blob(tmp_ctx, &called_blob, called); + status = nbt_name_to_blob(tmp_ctx, iconv_convenience, &called_blob, called); if (!NT_STATUS_IS_OK(status)) goto failed; /* allocate output buffer */ diff --git a/source4/libcli/smb_composite/fetchfile.c b/source4/libcli/smb_composite/fetchfile.c index c7d02e323c..e4312794c9 100644 --- a/source4/libcli/smb_composite/fetchfile.c +++ b/source4/libcli/smb_composite/fetchfile.c @@ -147,8 +147,8 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc state->connect->in.fallback_to_anonymous = false; state->connect->in.workgroup = io->in.workgroup; - lp_smbcli_options(global_loadparm, &state->connect->in.options); - + state->connect->in.options = io->in.options; + state->creq = smb_composite_connect_send(state->connect, state, lp_resolve_context(global_loadparm), event_ctx); if (state->creq == NULL) goto failed; diff --git a/source4/libcli/smb_composite/smb_composite.h b/source4/libcli/smb_composite/smb_composite.h index a732617f80..964ffb0936 100644 --- a/source4/libcli/smb_composite/smb_composite.h +++ b/source4/libcli/smb_composite/smb_composite.h @@ -55,6 +55,7 @@ struct smb_composite_fetchfile { struct cli_credentials *credentials; const char *workgroup; const char *filename; + struct smbcli_options options; } in; struct { uint8_t *data; |