diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-05-09 17:20:01 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-05-18 11:45:30 +0200 |
commit | f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d (patch) | |
tree | 9a0a6cb6617d855c28eb891396898096c4214e88 /source4 | |
parent | e9f5bdf6b5a1aeb7e2e556cf41f7cbc2abed7856 (diff) | |
download | samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.gz samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.tar.bz2 samba-f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d.zip |
Finish removal of iconv_convenience in public API's.
Diffstat (limited to 'source4')
160 files changed, 549 insertions, 923 deletions
diff --git a/source4/auth/gensec/gensec.h b/source4/auth/gensec/gensec.h index 45e24f194f..886f8fb171 100644 --- a/source4/auth/gensec/gensec.h +++ b/source4/auth/gensec/gensec.h @@ -73,7 +73,6 @@ struct tevent_req; struct gensec_settings { struct loadparm_context *lp_ctx; - struct smb_iconv_convenience *iconv_convenience; const char *target_hostname; }; diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c index c6901a7b5e..73c12a20ff 100644 --- a/source4/auth/gensec/gensec_gssapi.c +++ b/source4/auth/gensec/gensec_gssapi.c @@ -1268,7 +1268,6 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi */ if (pac_blob.length) { nt_status = kerberos_pac_blob_to_server_info(mem_ctx, - gensec_security->settings->iconv_convenience, pac_blob, gensec_gssapi_state->smb_krb5_context->krb5_context, &server_info); diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c index d051b7f227..77b50cb41c 100644 --- a/source4/auth/gensec/gensec_krb5.c +++ b/source4/auth/gensec/gensec_krb5.c @@ -685,7 +685,6 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security /* decode and verify the pac */ nt_status = kerberos_pac_logon_info(gensec_krb5_state, - gensec_security->settings->iconv_convenience, &logon_info, pac, gensec_krb5_state->smb_krb5_context->krb5_context, NULL, gensec_krb5_state->keyblock, diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index 2b4963c843..3ae80ddaf3 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -70,7 +70,6 @@ static struct gensec_settings *settings_from_object(TALLOC_CTX *mem_ctx, PyObjec s->target_hostname = PyString_AsString(py_hostname); s->lp_ctx = lp_from_py_object(s, py_lp_ctx); - s->iconv_convenience = py_iconv_convenience(s); return s; } diff --git a/source4/auth/gensec/schannel.c b/source4/auth/gensec/schannel.c index 7877ea461a..d4b29484f1 100644 --- a/source4/auth/gensec/schannel.c +++ b/source4/auth/gensec/schannel.c @@ -87,8 +87,7 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ bind_schannel.oem_netbios_computer.a = cli_credentials_get_workstation(gensec_security->credentials); #endif - ndr_err = ndr_push_struct_blob(out, out_mem_ctx, - gensec_security->settings->iconv_convenience, &bind_schannel, + ndr_err = ndr_push_struct_blob(out, out_mem_ctx, &bind_schannel, (ndr_push_flags_fn_t)ndr_push_NL_AUTH_MESSAGE); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -111,9 +110,7 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ } /* parse the schannel startup blob */ - ndr_err = ndr_pull_struct_blob(&in, out_mem_ctx, - gensec_security->settings->iconv_convenience, - &bind_schannel, + ndr_err = ndr_pull_struct_blob(&in, out_mem_ctx, &bind_schannel, (ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_MESSAGE); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -137,7 +134,6 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ } status = schannel_get_creds_state(out_mem_ctx, - gensec_security->settings->iconv_convenience, lp_private_dir(gensec_security->settings->lp_ctx), workstation, &creds); if (!NT_STATUS_IS_OK(status)) { @@ -158,8 +154,7 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_ * any meaning here * - gd */ - ndr_err = ndr_push_struct_blob(out, out_mem_ctx, - gensec_security->settings->iconv_convenience, &bind_schannel_ack, + ndr_err = ndr_push_struct_blob(out, out_mem_ctx, &bind_schannel_ack, (ndr_push_flags_fn_t)ndr_push_NL_AUTH_MESSAGE); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/auth/kerberos/kerberos.h b/source4/auth/kerberos/kerberos.h index 1990343808..96c11a4ce1 100644 --- a/source4/auth/kerberos/kerberos.h +++ b/source4/auth/kerberos/kerberos.h @@ -105,7 +105,6 @@ void kerberos_free_data_contents(krb5_context context, krb5_data *pdata); krb5_error_code smb_krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *kt_entry); char *smb_get_krb5_error_message(krb5_context context, krb5_error_code code, TALLOC_CTX *mem_ctx); NTSTATUS kerberos_decode_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_DATA **pac_data_out, DATA_BLOB blob, krb5_context context, @@ -115,7 +114,6 @@ NTSTATUS kerberos_decode_pac(TALLOC_CTX *mem_ctx, time_t tgs_authtime, krb5_error_code *k5ret); NTSTATUS kerberos_pac_logon_info(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_LOGON_INFO **logon_info, DATA_BLOB blob, krb5_context context, @@ -125,14 +123,12 @@ NTSTATUS kerberos_decode_pac(TALLOC_CTX *mem_ctx, time_t tgs_authtime, krb5_error_code *k5ret); krb5_error_code kerberos_encode_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_DATA *pac_data, krb5_context context, const krb5_keyblock *krbtgt_keyblock, const krb5_keyblock *service_keyblock, DATA_BLOB *pac); krb5_error_code kerberos_create_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct auth_serversupplied_info *server_info, krb5_context context, const krb5_keyblock *krbtgt_keyblock, diff --git a/source4/auth/kerberos/kerberos_pac.c b/source4/auth/kerberos/kerberos_pac.c index ecd35f3dfa..aca807e78d 100644 --- a/source4/auth/kerberos/kerberos_pac.c +++ b/source4/auth/kerberos/kerberos_pac.c @@ -66,7 +66,6 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, } NTSTATUS kerberos_decode_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_DATA **pac_data_out, DATA_BLOB blob, krb5_context context, @@ -114,8 +113,7 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(&blob, pac_data, - iconv_convenience, pac_data, - (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA); + pac_data, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); DEBUG(0,("can't parse the PAC: %s\n", @@ -130,7 +128,7 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(&blob, pac_data_raw, - iconv_convenience, pac_data_raw, + pac_data_raw, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -211,7 +209,7 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, /* We find the data blobs above, now we parse them to get at the exact portion we should zero */ ndr_err = ndr_pull_struct_blob(kdc_sig_blob, kdc_sig_wipe, - iconv_convenience, kdc_sig_wipe, + kdc_sig_wipe, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -221,7 +219,7 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(srv_sig_blob, srv_sig_wipe, - iconv_convenience, srv_sig_wipe, + srv_sig_wipe, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -236,7 +234,6 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, /* and reencode, back into the same place it came from */ ndr_err = ndr_push_struct_blob(kdc_sig_blob, pac_data_raw, - iconv_convenience, kdc_sig_wipe, (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -246,7 +243,6 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, return status; } ndr_err = ndr_push_struct_blob(srv_sig_blob, pac_data_raw, - iconv_convenience, srv_sig_wipe, (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -258,7 +254,6 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, /* push out the whole structure, but now with zero'ed signatures */ ndr_err = ndr_push_struct_blob(&modified_pac_blob, pac_data_raw, - iconv_convenience, pac_data_raw, (ndr_push_flags_fn_t)ndr_push_PAC_DATA_RAW); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -340,7 +335,6 @@ krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx, } _PUBLIC_ NTSTATUS kerberos_pac_logon_info(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_LOGON_INFO **logon_info, DATA_BLOB blob, krb5_context context, @@ -354,7 +348,6 @@ _PUBLIC_ NTSTATUS kerberos_pac_logon_info(TALLOC_CTX *mem_ctx, struct PAC_DATA *pac_data; int i; nt_status = kerberos_decode_pac(mem_ctx, - iconv_convenience, &pac_data, blob, context, @@ -426,7 +419,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, } krb5_error_code kerberos_encode_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct PAC_DATA *pac_data, krb5_context context, const krb5_keyblock *krbtgt_keyblock, @@ -489,7 +481,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, memset(srv_checksum->signature.data, '\0', srv_checksum->signature.length); ndr_err = ndr_push_struct_blob(&tmp_blob, mem_ctx, - iconv_convenience, pac_data, (ndr_push_flags_fn_t)ndr_push_PAC_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -514,7 +505,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, /* And push it out again, this time to the world. This relies on determanistic pointer values */ ndr_err = ndr_push_struct_blob(&tmp_blob, mem_ctx, - iconv_convenience, pac_data, (ndr_push_flags_fn_t)ndr_push_PAC_DATA); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -531,7 +521,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, krb5_error_code kerberos_create_pac(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct auth_serversupplied_info *server_info, krb5_context context, const krb5_keyblock *krbtgt_keyblock, @@ -644,7 +633,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, unix_to_nt_time(&LOGON_NAME->logon_time, tgs_authtime); ret = kerberos_encode_pac(mem_ctx, - iconv_convenience, pac_data, context, krbtgt_keyblock, @@ -655,7 +643,6 @@ static krb5_error_code make_pac_checksum(TALLOC_CTX *mem_ctx, } krb5_error_code kerberos_pac_to_server_info(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, krb5_pac pac, krb5_context context, struct auth_serversupplied_info **server_info) @@ -685,7 +672,7 @@ krb5_error_code kerberos_pac_to_server_info(TALLOC_CTX *mem_ctx, pac_logon_info_in = data_blob_const(k5pac_logon_info_in.data, k5pac_logon_info_in.length); - ndr_err = ndr_pull_union_blob(&pac_logon_info_in, tmp_ctx, iconv_convenience, &info, + ndr_err = ndr_pull_union_blob(&pac_logon_info_in, tmp_ctx, &info, PAC_TYPE_LOGON_INFO, (ndr_pull_flags_fn_t)ndr_pull_PAC_INFO); krb5_data_free(&k5pac_logon_info_in); @@ -716,7 +703,7 @@ krb5_error_code kerberos_pac_to_server_info(TALLOC_CTX *mem_ctx, pac_srv_checksum_in = data_blob_const(k5pac_srv_checksum_in.data, k5pac_srv_checksum_in.length); ndr_err = ndr_pull_struct_blob(&pac_srv_checksum_in, server_info_out, - iconv_convenience, &server_info_out->pac_srv_sig, + &server_info_out->pac_srv_sig, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA); krb5_data_free(&k5pac_srv_checksum_in); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -735,7 +722,7 @@ krb5_error_code kerberos_pac_to_server_info(TALLOC_CTX *mem_ctx, pac_kdc_checksum_in = data_blob_const(k5pac_kdc_checksum_in.data, k5pac_kdc_checksum_in.length); ndr_err = ndr_pull_struct_blob(&pac_kdc_checksum_in, server_info_out, - iconv_convenience, &server_info_out->pac_kdc_sig, + &server_info_out->pac_kdc_sig, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA); krb5_data_free(&k5pac_kdc_checksum_in); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -752,7 +739,6 @@ krb5_error_code kerberos_pac_to_server_info(TALLOC_CTX *mem_ctx, NTSTATUS kerberos_pac_blob_to_server_info(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, DATA_BLOB pac_blob, krb5_context context, struct auth_serversupplied_info **server_info) @@ -767,7 +753,7 @@ NTSTATUS kerberos_pac_blob_to_server_info(TALLOC_CTX *mem_ctx, } - ret = kerberos_pac_to_server_info(mem_ctx, iconv_convenience, pac, context, server_info); + ret = kerberos_pac_to_server_info(mem_ctx, pac, context, server_info); krb5_pac_free(context, pac); if (ret) { return map_nt_error_from_unix(ret); diff --git a/source4/auth/ntlm/auth_winbind.c b/source4/auth/ntlm/auth_winbind.c index 173a895390..7406a94275 100644 --- a/source4/auth/ntlm/auth_winbind.c +++ b/source4/auth/ntlm/auth_winbind.c @@ -33,7 +33,7 @@ #include "nsswitch/libwbclient/wbclient.h" #include "libcli/security/dom_sid.h" -static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, struct winbindd_response *response, struct netr_SamInfo3 *info3) +static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, struct netr_SamInfo3 *info3) { size_t len = response->length - sizeof(struct winbindd_response); if (len > 4) { @@ -43,7 +43,7 @@ static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct smb_iconv_conveni blob.data = (uint8_t *)(((char *)response->extra_data.data) + 4); ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, - iconv_convenience, info3, + info3, (ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); @@ -57,7 +57,6 @@ static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct smb_iconv_conveni } static NTSTATUS get_info3_from_wbcAuthUserInfo(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct wbcAuthUserInfo *info, struct netr_SamInfo3 *info3) { @@ -197,7 +196,7 @@ static NTSTATUS winbind_check_password_samba3(struct auth_method_context *ctx, if (result == NSS_STATUS_SUCCESS && response.extra_data.data) { union netr_Validation validation; - nt_status = get_info3_from_ndr(mem_ctx, lp_iconv_convenience(ctx->auth_ctx->lp_ctx), &response, &info3); + nt_status = get_info3_from_ndr(mem_ctx, &response, &info3); SAFE_FREE(response.extra_data.data); NT_STATUS_NOT_OK_RETURN(nt_status); @@ -389,9 +388,7 @@ static NTSTATUS winbind_check_password_wbclient(struct auth_method_context *ctx, wbcFreeMemory(err); NT_STATUS_NOT_OK_RETURN(nt_status); } - nt_status = get_info3_from_wbcAuthUserInfo(mem_ctx, - lp_iconv_convenience(ctx->auth_ctx->lp_ctx), - info, &info3); + nt_status = get_info3_from_wbcAuthUserInfo(mem_ctx, info, &info3); wbcFreeMemory(info); NT_STATUS_NOT_OK_RETURN(nt_status); diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index 414f08a6f6..7667d9bf3e 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -137,7 +137,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, enum ndr_err_code ndr_err; /* Rather than go via the string, just push into the NDR form */ - ndr_err = ndr_push_struct_blob(&sid_val, mem_ctx, NULL, &sid, + ndr_err = ndr_push_struct_blob(&sid_val, mem_ctx, &sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NT_STATUS_INVALID_PARAMETER; @@ -427,8 +427,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap, goto failed; } ndr_err = ndr_pull_struct_blob(&t->u.equality.value, - domain_sid, NULL, - domain_sid, + domain_sid, domain_sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(domain_sid); @@ -472,10 +471,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap, goto failed; } - status = cldap_netlogon_reply(cldap, - lp_iconv_convenience(cldapd->task->lp_ctx), - message_id, src, version, - &netlogon); + status = cldap_netlogon_reply(cldap, message_id, src, version, &netlogon); if (!NT_STATUS_IS_OK(status)) { goto failed; } diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index 302d470afd..b804a15d1c 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -360,7 +360,6 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, struct smbcli_options *smb_options, const char *socket_options, struct smbcli_session_options *smb_session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { int options = 0; @@ -385,7 +384,6 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, check_arg_numeric("ibs"), options, socket_options, smb_options, smb_session_options, - iconv_convenience, gensec_settings); } else if (strcmp(which, "of") == 0) { options |= DD_WRITE; @@ -394,7 +392,6 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, check_arg_numeric("obs"), options, socket_options, smb_options, smb_session_options, - iconv_convenience, gensec_settings); } else { SMB_ASSERT(0); @@ -450,7 +447,7 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if", lp_smb_ports(lp_ctx), &options, lp_socket_options(lp_ctx), - &session_options, lp_iconv_convenience(lp_ctx), + &session_options, lp_gensec_settings(lp_ctx, lp_ctx)))) { return(FILESYS_EXIT_CODE); } @@ -459,7 +456,6 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx lp_smb_ports(lp_ctx), &options, lp_socket_options(lp_ctx), &session_options, - lp_iconv_convenience(lp_ctx), lp_gensec_settings(lp_ctx, lp_ctx)))) { return(FILESYS_EXIT_CODE); } diff --git a/source4/client/cifsdd.h b/source4/client/cifsdd.h index e39c046fe8..4e9cb9dd9a 100644 --- a/source4/client/cifsdd.h +++ b/source4/client/cifsdd.h @@ -100,7 +100,6 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, const char *socket_options, struct smbcli_options *smb_options, struct smbcli_session_options *smb_session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings); bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf, uint64_t * buf_size, uint64_t need_size, uint64_t block_size); diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c index 47caf6b835..0ceb69e3b1 100644 --- a/source4/client/cifsddio.c +++ b/source4/client/cifsddio.c @@ -227,7 +227,6 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct const char *socket_options, struct smbcli_options *options, struct smbcli_session_options *session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { NTSTATUS ret; @@ -242,7 +241,6 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct cmdline_credentials, resolve_ctx, ev, options, session_options, - iconv_convenience, gensec_settings); if (!NT_STATUS_IS_OK(ret)) { @@ -312,7 +310,6 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx const char *socket_options, struct smbcli_options *smb_options, struct smbcli_session_options *smb_session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { struct cifs_handle * smbh; @@ -336,7 +333,6 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx if ((smbh->cli = init_smb_session(resolve_ctx, ev, host, ports, share, socket_options, smb_options, smb_session_options, - iconv_convenience, gensec_settings)) == NULL) { return(NULL); } @@ -361,7 +357,6 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, const char *socket_options, struct smbcli_options *smb_options, struct smbcli_session_options *smb_session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { if (file_exist(path)) { @@ -382,7 +377,6 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, io_size, options, socket_options, smb_options, smb_session_options, - iconv_convenience, gensec_settings)); } diff --git a/source4/client/client.c b/source4/client/client.c index 55a2d0c0d0..cf834b9e1f 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3055,7 +3055,6 @@ static bool do_connect(struct smbclient_context *ctx, struct cli_credentials *cred, struct smbcli_options *options, struct smbcli_session_options *session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { NTSTATUS status; @@ -3078,7 +3077,6 @@ static bool do_connect(struct smbclient_context *ctx, socket_options, cred, resolve_ctx, ev_ctx, options, session_options, - iconv_convenience, gensec_settings); if (!NT_STATUS_IS_OK(status)) { d_printf("Connection to \\\\%s\\%s failed - %s\n", @@ -3113,7 +3111,6 @@ static int do_message_op(const char *netbios_name, const char *desthost, 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 nbt_name called, calling; @@ -3129,7 +3126,6 @@ static int do_message_op(const char *netbios_name, const char *desthost, if (!(cli = smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, ev_ctx, resolve_ctx, options, - iconv_convenience, socket_options)) { d_printf("Connection to %s failed\n", server_name); return 1; @@ -3283,7 +3279,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, ev_ctx, lp_resolve_context(cmdline_lp_ctx), - &smb_options, lp_iconv_convenience(cmdline_lp_ctx), + &smb_options, lp_socket_options(cmdline_lp_ctx)); return rc; } @@ -3292,7 +3288,6 @@ static int do_message_op(const char *netbios_name, const char *desthost, desthost, lp_smb_ports(cmdline_lp_ctx), service, lp_socket_options(cmdline_lp_ctx), cmdline_credentials, &smb_options, &smb_session_options, - lp_iconv_convenience(cmdline_lp_ctx), lp_gensec_settings(ctx, cmdline_lp_ctx))) return 1; diff --git a/source4/dsdb/common/dsdb_access.c b/source4/dsdb/common/dsdb_access.c index 7857e1fa25..ac0c73643f 100644 --- a/source4/dsdb/common/dsdb_access.c +++ b/source4/dsdb/common/dsdb_access.c @@ -69,7 +69,7 @@ int dsdb_get_sd_from_ldb_message(TALLOC_CTX *mem_ctx, if(!*sd) { return LDB_ERR_OPERATIONS_ERROR; } - ndr_err = ndr_pull_struct_blob(&sd_element->values[0], *sd, NULL, *sd, + ndr_err = ndr_pull_struct_blob(&sd_element->values[0], *sd, *sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index df4e734252..da4d0b3940 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -385,7 +385,7 @@ struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa if (sid == NULL) { return NULL; } - ndr_err = ndr_pull_struct_blob(v, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob(v, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); @@ -816,7 +816,6 @@ int samdb_msg_add_dom_sid(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, stru enum ndr_err_code ndr_err; ndr_err = ndr_push_struct_blob(&v, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(sam_ldb, "loadparm")), sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2494,7 +2493,7 @@ WERROR dsdb_loadreps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ld for (i=0; i<(*count); i++) { enum ndr_err_code ndr_err; ndr_err = ndr_pull_struct_blob(&el->values[i], - mem_ctx, lp_iconv_convenience(ldb_get_opaque(sam_ctx, "loadparm")), + mem_ctx, &(*r)[i], (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2535,7 +2534,7 @@ WERROR dsdb_savereps(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, struct ld struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, tmp_ctx, lp_iconv_convenience(ldb_get_opaque(sam_ctx, "loadparm")), + ndr_err = ndr_push_struct_blob(&v, tmp_ctx, &r[i], (ndr_push_flags_fn_t)ndr_push_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -2981,7 +2980,7 @@ NTSTATUS dsdb_get_extended_dn_sid(struct ldb_dn *dn, struct dom_sid *sid, const tmp_ctx = talloc_new(NULL); - ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, NULL, sid, + ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -3243,8 +3242,7 @@ int dsdb_load_udv_v2(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *m enum ndr_err_code ndr_err; struct replUpToDateVectorBlob ouv; - ndr_err = ndr_pull_struct_blob(ouv_value, r, - lp_iconv_convenience(ldb_get_opaque(samdb, "loadparm")), &ouv, + ndr_err = ndr_pull_struct_blob(ouv_value, r, &ouv, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(r); diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c index 322ccc980c..170105642b 100644 --- a/source4/dsdb/kcc/kcc_drs_replica_info.c +++ b/source4/dsdb/kcc/kcc_drs_replica_info.c @@ -122,7 +122,7 @@ static WERROR get_repl_prop_metadata_ctr(TALLOC_CTX *mem_ctx, } ndr_err = ndr_pull_struct_blob(omd_value, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(samdb, "loadparm")), obj_metadata_ctr, + obj_metadata_ctr, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to parse replPropertyMetaData for %s\n", diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index b17a17d5a3..cb45b41248 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -153,7 +153,7 @@ static WERROR dreplsrv_partition_add_source_dsa(struct dreplsrv_service *s, W_ERROR_HAVE_NO_MEMORY(source); ndr_err = ndr_pull_struct_blob(val, source, - lp_iconv_convenience(s->task->lp_ctx), &source->_repsFromBlob, + &source->_repsFromBlob, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c index 8fc5e3a47b..6c9baaa13a 100644 --- a/source4/dsdb/samdb/ldb_modules/descriptor.c +++ b/source4/dsdb/samdb/ldb_modules/descriptor.c @@ -230,7 +230,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!user_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(object, user_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(object, user_descriptor, user_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -247,7 +247,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!old_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(old_sd, old_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(old_sd, old_descriptor, old_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -262,7 +262,7 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, if (!parent_descriptor) { return NULL; } - ndr_err = ndr_pull_struct_blob(parent, parent_descriptor, NULL, + ndr_err = ndr_pull_struct_blob(parent, parent_descriptor, parent_descriptor, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -305,7 +305,6 @@ static DATA_BLOB *get_new_descriptor(struct ldb_module *module, } ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), final_sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -323,13 +322,12 @@ static DATA_BLOB *descr_get_descriptor_to_show(struct ldb_module *module, struct security_descriptor *old_sd, *final_sd; DATA_BLOB *linear_sd; enum ndr_err_code ndr_err; - struct ldb_context *ldb = ldb_module_get_ctx(module); old_sd = talloc(mem_ctx, struct security_descriptor); if (!old_sd) { return NULL; } - ndr_err = ndr_pull_struct_blob(sd, old_sd, NULL, + ndr_err = ndr_pull_struct_blob(sd, old_sd, old_sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); @@ -350,7 +348,6 @@ static DATA_BLOB *descr_get_descriptor_to_show(struct ldb_module *module, } ndr_err = ndr_push_struct_blob(linear_sd, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), final_sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c index 39af87091c..12adf16181 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c @@ -276,7 +276,7 @@ static int handle_dereference_fds(struct ldb_dn *dn, return LDB_ERR_INVALID_DN_SYNTAX; } - ndr_err = ndr_push_struct_blob(&sid_blob, NULL, NULL, sid, + ndr_err = ndr_push_struct_blob(&sid_blob, NULL, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); talloc_free(sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index f9e7f52cd9..de2c6da94c 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -519,7 +519,7 @@ static int setup_primary_kerberos(struct setup_password_fields_io *io, } /* TODO: use ndr_pull_struct_blob_all(), when the ndr layer handles it correct with relative pointers */ - ndr_err = ndr_pull_struct_blob(&blob, io->ac, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_pkb, + ndr_err = ndr_pull_struct_blob(&blob, io->ac, &_old_pkb, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS status = ndr_map_error2ntstatus(ndr_err); @@ -636,7 +636,6 @@ static int setup_primary_kerberos_newer(struct setup_password_fields_io *io, /* TODO: use ndr_pull_struct_blob_all(), when the ndr layer handles it correct with relative pointers */ ndr_err = ndr_pull_struct_blob(&blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_pkb, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1068,7 +1067,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) /* if there's an old supplementaCredentials blob then parse it */ if (io->o.supplemental) { ndr_err = ndr_pull_struct_blob_all(io->o.supplemental, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &_old_scb, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1148,7 +1146,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pknb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pknb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1180,7 +1177,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pkb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pkb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1211,7 +1207,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) } ndr_err = ndr_push_struct_blob(&pdb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pdb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryWDigestBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1240,7 +1235,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) pcb.cleartext = *io->n.cleartext_utf16; ndr_err = ndr_push_struct_blob(&pcb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pcb, (ndr_push_flags_fn_t)ndr_push_package_PrimaryCLEARTEXTBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1266,7 +1260,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) */ pb.names = names; ndr_err = ndr_push_struct_blob(&pb_blob, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pb, (ndr_push_flags_fn_t)ndr_push_package_PackagesBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1294,7 +1287,6 @@ static int setup_supplemental_field(struct setup_password_fields_io *io) scb.sub.packages = packages; ndr_err = ndr_push_struct_blob(&io->g.supplemental, io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &scb, (ndr_push_flags_fn_t)ndr_push_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1335,8 +1327,7 @@ static int setup_given_passwords(struct setup_password_fields_io *io, ldb_oom(ldb); return LDB_ERR_OPERATIONS_ERROR; } - if (!convert_string_talloc_convenience(io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), + if (!convert_string_talloc(io->ac, CH_UTF8, CH_UTF16, g->cleartext_utf8->data, g->cleartext_utf8->length, @@ -1361,7 +1352,6 @@ static int setup_given_passwords(struct setup_password_fields_io *io, return LDB_ERR_OPERATIONS_ERROR; } if (!convert_string_talloc_convenience(io->ac, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), CH_UTF16MUNGED, CH_UTF8, g->cleartext_utf16->data, g->cleartext_utf16->length, diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a6aeb5e58f..72ffd0e21c 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -911,7 +911,6 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) /* generated NDR encoded values */ ndr_err = ndr_push_struct_blob(&nmd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1144,8 +1143,7 @@ static int replmd_update_rpmd(struct ldb_module *module, return LDB_ERR_OPERATIONS_ERROR; } - ndr_err = ndr_pull_struct_blob(omd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &omd, + ndr_err = ndr_pull_struct_blob(omd_value, msg, &omd, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to parse replPropertyMetaData for %s\n", @@ -1207,9 +1205,7 @@ static int replmd_update_rpmd(struct ldb_module *module, return ret; } - ndr_err = ndr_push_struct_blob(md_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &omd, + ndr_err = ndr_push_struct_blob(md_value, msg, &omd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0,(__location__ ": Failed to marshall replPropertyMetaData for %s\n", @@ -2749,9 +2745,7 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar) for (i=0; i < md->ctr.ctr1.count; i++) { md->ctr.ctr1.array[i].local_usn = ar->seq_num; } - ndr_err = ndr_push_struct_blob(&md_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - md, + ndr_err = ndr_push_struct_blob(&md_value, msg, md, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -2860,8 +2854,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) /* find existing meta data */ omd_value = ldb_msg_find_ldb_val(ar->search_msg, "replPropertyMetaData"); if (omd_value) { - ndr_err = ndr_pull_struct_blob(omd_value, ar, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &omd, + ndr_err = ndr_pull_struct_blob(omd_value, ar, &omd, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -2969,9 +2962,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) } /* create the meta data value */ - ndr_err = ndr_push_struct_blob(&nmd_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &nmd, + ndr_err = ndr_push_struct_blob(&nmd_value, msg, &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3192,8 +3183,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a */ ouv_value = ldb_msg_find_ldb_val(ar->search_msg, "replUpToDateVector"); if (ouv_value) { - ndr_err = ndr_pull_struct_blob(ouv_value, ar, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &ouv, + ndr_err = ndr_pull_struct_blob(ouv_value, ar, &ouv, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3316,9 +3306,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a if (!msg) return replmd_replicated_request_werror(ar, WERR_NOMEM); msg->dn = ar->search_msg->dn; - ndr_err = ndr_push_struct_blob(&nuv_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), - &nuv, + ndr_err = ndr_push_struct_blob(&nuv_value, msg, &nuv, (ndr_push_flags_fn_t)ndr_push_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3355,7 +3343,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a trf = talloc(ar, struct repsFromToBlob); if (!trf) return replmd_replicated_request_werror(ar, WERR_NOMEM); - ndr_err = ndr_pull_struct_blob(&orf_el->values[i], trf, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), trf, + ndr_err = ndr_pull_struct_blob(&orf_el->values[i], trf, trf, (ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -3406,7 +3394,6 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a /* we now fill the value which is already attached to ldb_message */ ndr_err = ndr_push_struct_blob(nrf_value, msg, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &nrf, (ndr_push_flags_fn_t)ndr_push_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index a64062fcdc..05aee77638 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -72,7 +72,6 @@ static void ridalloc_poke_rid_manager(struct ldb_module *module) TALLOC_CTX *tmp_ctx = talloc_new(module); msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, lp_ctx), - lp_iconv_convenience(lp_ctx), ldb_get_event_context(ldb)); if (!msg) { DEBUG(3,(__location__ ": Failed to create messaging context\n")); diff --git a/source4/dsdb/samdb/ldb_modules/samba3sam.c b/source4/dsdb/samdb/ldb_modules/samba3sam.c index 61013d133e..42245ce491 100644 --- a/source4/dsdb/samdb/ldb_modules/samba3sam.c +++ b/source4/dsdb/samdb/ldb_modules/samba3sam.c @@ -94,7 +94,7 @@ static void generate_sambaPrimaryGroupSID(struct ldb_module *module, const char return; } - ndr_err = ndr_pull_struct_blob(sidval, sid, NULL, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); + ndr_err = ndr_pull_struct_blob(sidval, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); return; @@ -188,7 +188,6 @@ static struct ldb_val encode_sid(struct ldb_module *module, TALLOC_CTX *ctx, con } ndr_err = ndr_push_struct_blob(&out, ctx, - NULL, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); talloc_free(sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -210,7 +209,7 @@ static struct ldb_val decode_sid(struct ldb_module *module, TALLOC_CTX *ctx, con return out; } - ndr_err = ndr_pull_struct_blob(val, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob(val, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { goto done; diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 4a50a3fa47..4d1659df0b 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -327,7 +327,7 @@ static bool samldb_msg_add_sid(struct ldb_message *msg, struct ldb_val v; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&v, msg, NULL, sid, + ndr_err = ndr_push_struct_blob(&v, msg, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c index b4a68769e6..4df6f1e38a 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_load.c +++ b/source4/dsdb/samdb/ldb_modules/schema_load.c @@ -215,7 +215,6 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_ } ret = dsdb_schema_from_ldb_results(tmp_ctx, ldb, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), schema_res, a_res, c_res, schema, &error_string); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c index ac22eb9b3f..a9c5e932a1 100644 --- a/source4/dsdb/schema/schema_info_attr.c +++ b/source4/dsdb/schema/schema_info_attr.c @@ -100,7 +100,7 @@ WERROR dsdb_schema_info_from_blob(const DATA_BLOB *blob, W_ERROR_HAVE_NO_MEMORY(temp_ctx); ndr_err = ndr_pull_struct_blob_all(blob, temp_ctx, - lp_iconv_convenience(NULL), &schema_info_blob, + &schema_info_blob, (ndr_pull_flags_fn_t)ndr_pull_schemaInfoBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -140,7 +140,7 @@ WERROR dsdb_blob_from_schema_info(const struct dsdb_schema_info *schema_info, schema_info_blob.invocation_id = schema_info->invocation_id; ndr_err = ndr_push_struct_blob(blob, mem_ctx, - lp_iconv_convenience(NULL), &schema_info_blob, + &schema_info_blob, (ndr_push_flags_fn_t)ndr_push_schemaInfoBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index cdd37f094b..55e78ebf3a 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -33,14 +33,13 @@ #include "../lib/util/asn1.h" -struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience) +struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx) { struct dsdb_schema *schema = talloc_zero(mem_ctx, struct dsdb_schema); if (!schema) { return NULL; } - schema->iconv_convenience = iconv_convenience; return schema; } @@ -66,7 +65,6 @@ WERROR dsdb_load_prefixmap_from_drsuapi(struct dsdb_schema *schema, } static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct dsdb_schema_prefixmap **_pfm) { @@ -78,7 +76,7 @@ static WERROR _dsdb_prefixmap_from_ldb_val(const struct ldb_val *pfm_ldb_val, W_ERROR_HAVE_NO_MEMORY(temp_ctx); ndr_err = ndr_pull_struct_blob(pfm_ldb_val, temp_ctx, - iconv_convenience, &pfm_blob, + &pfm_blob, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { NTSTATUS nt_status = ndr_map_error2ntstatus(ndr_err); @@ -119,7 +117,6 @@ WERROR dsdb_load_oid_mappings_ldb(struct dsdb_schema *schema, /* fetch prefixMap */ werr = _dsdb_prefixmap_from_ldb_val(prefixMap, - schema->iconv_convenience, mem_ctx, &pfm); W_ERROR_NOT_OK_GOTO(werr, DONE); @@ -173,7 +170,7 @@ WERROR dsdb_get_oid_mappings_ldb(const struct dsdb_schema *schema, pfm.reserved = 0; pfm.ctr.dsdb = *ctr; - ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, schema->iconv_convenience, &pfm, + ndr_err = ndr_push_struct_blob(prefixMap, mem_ctx, &pfm, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); talloc_free(ctr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -286,7 +283,6 @@ WERROR dsdb_write_prefixes_from_schema_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_co pfm_blob.ctr.dsdb = *ctr; ndr_err = ndr_push_struct_blob(&ndr_blob, temp_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &pfm_blob, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -326,7 +322,6 @@ WERROR dsdb_read_prefixes_from_ldb(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, WERROR werr; int ldb_ret; const struct ldb_val *prefix_val; - struct smb_iconv_convenience *iconv_convenience; struct ldb_dn *schema_dn; struct ldb_result *schema_res = NULL; static const char *schema_attrs[] = { @@ -358,10 +353,7 @@ WERROR dsdb_read_prefixes_from_ldb(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, return WERR_FOOBAR; } - iconv_convenience = lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")); - werr = _dsdb_prefixmap_from_ldb_val(prefix_val, - iconv_convenience, mem_ctx, _pfm); talloc_free(schema_res); @@ -704,7 +696,6 @@ WERROR dsdb_class_from_ldb(struct dsdb_schema *schema, */ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, - struct smb_iconv_convenience *iconv_convenience, struct ldb_result *schema_res, struct ldb_result *attrs_res, struct ldb_result *objectclass_res, struct dsdb_schema **schema_out, @@ -717,7 +708,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct ldb_val info_val_default; struct dsdb_schema *schema; - schema = dsdb_new_schema(mem_ctx, iconv_convenience); + schema = dsdb_new_schema(mem_ctx); if (!schema) { dsdb_oom(error_string, mem_ctx); return LDB_ERR_OPERATIONS_ERROR; @@ -892,7 +883,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb } \ if (_a && _a->value_ctr.num_values >= 1) { \ size_t _ret; \ - if (!convert_string_talloc_convenience(mem_ctx, s->iconv_convenience, CH_UTF16, CH_UNIX, \ + if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, \ _a->value_ctr.values[0].blob->data, \ _a->value_ctr.values[0].blob->length, \ (void **)discard_const(&(p)->elem), &_ret, false)) { \ @@ -1123,7 +1114,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb, } status = dsdb_syntax_one_DN_drsuapi_to_ldb(mem_ctx, ldb, find_syntax_map_by_standard_oid(LDB_SYNTAX_DN), - schema->iconv_convenience, attr->value_ctr.values[0].blob, &blob); + attr->value_ctr.values[0].blob, &blob); if (!W_ERROR_IS_OK(status)) { return status; } diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index fe6ef42e8c..07d75c44a8 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -589,7 +589,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const goto nomem; } - schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm"))); + schema = dsdb_new_schema(mem_ctx); schema->fsmo.we_are_master = true; schema->fsmo.master_dn = ldb_dn_new_fmt(schema, ldb, "@PROVISION_SCHEMA_MASTER"); diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index a0eed3d7c0..2e6f411a7a 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -1352,8 +1352,7 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(struct ldb_context *ldb, return WERR_FOOBAR; } - if (!convert_string_talloc_convenience(out->values, - schema->iconv_convenience, + if (!convert_string_talloc(out->values, CH_UTF16, CH_UNIX, in->value_ctr.values[i].blob->data, in->value_ctr.values[i].blob->length, @@ -1394,8 +1393,8 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(struct ldb_context *ldb, for (i=0; i < in->num_values; i++) { out->value_ctr.values[i].blob = &blobs[i]; - if (!convert_string_talloc_convenience(blobs, - schema->iconv_convenience, CH_UNIX, CH_UTF16, + if (!convert_string_talloc(blobs, + CH_UNIX, CH_UTF16, in->values[i].data, in->values[i].length, (void **)&blobs[i].data, &blobs[i].length, false)) { return WERR_FOOBAR; @@ -1476,7 +1475,6 @@ static WERROR dsdb_syntax_UNICODE_validate_ldb(struct ldb_context *ldb, WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const struct dsdb_syntax *syntax, - struct smb_iconv_convenience *iconv_convenience, const DATA_BLOB *in, DATA_BLOB *out) { struct drsuapi_DsReplicaObjectIdentifier3 id3; @@ -1504,7 +1502,7 @@ WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context /* windows sometimes sends an extra two pad bytes here */ ndr_err = ndr_pull_struct_blob(in, - tmp_ctx, iconv_convenience, &id3, + tmp_ctx, &id3, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1536,7 +1534,7 @@ WERROR dsdb_syntax_one_DN_drsuapi_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context if (id3.__ndr_size_sid) { DATA_BLOB sid_blob; - ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, iconv_convenience, &id3.sid, + ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, &id3.sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1575,7 +1573,6 @@ static WERROR dsdb_syntax_DN_drsuapi_to_ldb(struct ldb_context *ldb, for (i=0; i < out->num_values; i++) { WERROR status = dsdb_syntax_one_DN_drsuapi_to_ldb(out->values, ldb, attr->syntax, - schema->iconv_convenience, in->value_ctr.values[i].blob, &out->values[i]); if (!W_ERROR_IS_OK(status)) { @@ -1644,7 +1641,7 @@ static WERROR dsdb_syntax_DN_ldb_to_drsuapi(struct ldb_context *ldb, id3.dn = ldb_dn_get_linearized(dn); - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, schema->iconv_convenience, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); talloc_free(tmp_ctx); @@ -1712,7 +1709,6 @@ static WERROR dsdb_syntax_DN_validate_one_val(struct ldb_context *ldb, num_components++; ndr_err = ndr_pull_struct_blob_all(sid_blob, tmp_ctx, - schema->iconv_convenience, &sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1838,7 +1834,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb, /* windows sometimes sends an extra two pad bytes here */ ndr_err = ndr_pull_struct_blob(in->value_ctr.values[i].blob, - tmp_ctx, schema->iconv_convenience, &id3, + tmp_ctx, &id3, (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1869,7 +1865,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb, if (id3.__ndr_size_sid) { DATA_BLOB sid_blob; - ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, schema->iconv_convenience, &id3.sid, + ndr_err = ndr_push_struct_blob(&sid_blob, tmp_ctx, &id3.sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1954,7 +1950,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb, if (sid_blob) { ndr_err = ndr_pull_struct_blob_all(sid_blob, - tmp_ctx, schema->iconv_convenience, &id3.sid, + tmp_ctx, &id3.sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -1968,7 +1964,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb, /* get binary stuff */ id3.binary = dsdb_dn->extra_part; - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, schema->iconv_convenience, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, &id3, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); talloc_free(tmp_ctx); @@ -2139,7 +2135,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(struct ldb_context return WERR_FOOBAR; } - if (!convert_string_talloc_convenience(out->values, schema->iconv_convenience, CH_UTF16, CH_UNIX, + if (!convert_string_talloc(out->values, CH_UTF16, CH_UNIX, in->value_ctr.values[i].blob->data+4, in->value_ctr.values[i].blob->length-4, (void **)&str, NULL, false)) { @@ -2182,7 +2178,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(struct ldb_context out->value_ctr.values[i].blob = &blobs[i]; - if (!convert_string_talloc_convenience(blobs, schema->iconv_convenience, CH_UNIX, CH_UTF16, + if (!convert_string_talloc(blobs, CH_UNIX, CH_UTF16, in->values[i].data, in->values[i].length, (void **)&data, &ret, false)) { diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index 33c4c8cdf6..97820c0c32 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -192,7 +192,6 @@ static void samba_kdc_free_entry(krb5_context context, hdb_entry_ex *entry_ex) } static krb5_error_code samba_kdc_message2entry_keys(krb5_context context, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct ldb_message *msg, unsigned int userAccountControl, @@ -228,7 +227,7 @@ static krb5_error_code samba_kdc_message2entry_keys(krb5_context context, /* supplementalCredentials if present */ if (sc_val) { - ndr_err = ndr_pull_struct_blob_all(sc_val, mem_ctx, iconv_convenience, &scb, + ndr_err = ndr_pull_struct_blob_all(sc_val, mem_ctx, &scb, (ndr_pull_flags_fn_t)ndr_pull_supplementalCredentialsBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { dump_data(0, sc_val->data, sc_val->length); @@ -277,7 +276,7 @@ static krb5_error_code samba_kdc_message2entry_keys(krb5_context context, } /* we cannot use ndr_pull_struct_blob_all() here, as w2k and w2k3 add padding bytes */ - ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, iconv_convenience, &_pkb, + ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &_pkb, (ndr_pull_flags_fn_t)ndr_pull_package_PrimaryKerberosBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { ret = EINVAL; @@ -701,8 +700,8 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context, entry_ex->entry.generation = NULL; /* Get keys from the db */ - ret = samba_kdc_message2entry_keys(context, p->kdc_db_ctx->ic_ctx, p, - msg, userAccountControl, entry_ex); + ret = samba_kdc_message2entry_keys(context, p, msg, userAccountControl, + entry_ex); if (ret) { /* Could be bougus data in the entry, or out of memory */ goto out; @@ -808,7 +807,7 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context, goto out; } - ndr_err = ndr_pull_struct_blob(password_val, mem_ctx, p->kdc_db_ctx->ic_ctx, &password_blob, + ndr_err = ndr_pull_struct_blob(password_val, mem_ctx, &password_blob, (ndr_pull_flags_fn_t)ndr_pull_trustAuthInOutBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { ret = EINVAL; diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index 984999b83c..b824bb86b0 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -589,9 +589,7 @@ static NTSTATUS kdc_check_generic_kerberos(struct irpc_message *msg, /* There is no reply to this request */ r->out.generic_reply = data_blob(NULL, 0); - ndr_err = ndr_pull_struct_blob(&r->in.generic_request, msg, - lp_iconv_convenience(kdc->task->lp_ctx), - &pac_validate, + ndr_err = ndr_pull_struct_blob(&r->in.generic_request, msg, &pac_validate, (ndr_pull_flags_fn_t)ndr_pull_PAC_Validate); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NT_STATUS_INVALID_PARAMETER; diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 2a932fa832..8c203e555d 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -34,7 +34,6 @@ static NTSTATUS samba_get_logon_info_pac_blob(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct auth_serversupplied_info *info, DATA_BLOB *pac_data) { @@ -59,7 +58,7 @@ NTSTATUS samba_get_logon_info_pac_blob(TALLOC_CTX *mem_ctx, pac_info.logon_info.info->info3 = *info3; - ndr_err = ndr_push_union_blob(pac_data, mem_ctx, ic, &pac_info, + ndr_err = ndr_push_union_blob(pac_data, mem_ctx, &pac_info, PAC_TYPE_LOGON_INFO, (ndr_push_flags_fn_t)ndr_push_PAC_INFO); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -154,9 +153,7 @@ NTSTATUS samba_kdc_get_pac_blob(TALLOC_CTX *mem_ctx, return nt_status; } - nt_status = samba_get_logon_info_pac_blob(mem_ctx, - p->kdc_db_ctx->ic_ctx, - server_info, pac_blob); + nt_status = samba_get_logon_info_pac_blob(mem_ctx, server_info, pac_blob); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0, ("Building PAC failed: %s\n", nt_errstr(nt_status))); @@ -169,20 +166,19 @@ NTSTATUS samba_kdc_get_pac_blob(TALLOC_CTX *mem_ctx, NTSTATUS samba_kdc_update_pac_blob(TALLOC_CTX *mem_ctx, krb5_context context, - struct smb_iconv_convenience *ic, krb5_pac *pac, DATA_BLOB *pac_blob) { struct auth_serversupplied_info *server_info; krb5_error_code ret; NTSTATUS nt_status; - ret = kerberos_pac_to_server_info(mem_ctx, ic, *pac, + ret = kerberos_pac_to_server_info(mem_ctx, *pac, context, &server_info); if (ret) { return NT_STATUS_UNSUCCESSFUL; } - nt_status = samba_get_logon_info_pac_blob(mem_ctx, ic, + nt_status = samba_get_logon_info_pac_blob(mem_ctx, server_info, pac_blob); return nt_status; diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 9ebb4bb5c3..5e21199488 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -57,7 +57,6 @@ static int ldif_write_NDR(struct ldb_context *ldb, void *mem_ctx, } p = talloc_size(mem_ctx, struct_size); err = ndr_pull_struct_blob(in, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), p, pull_fn); if (err != NDR_ERR_SUCCESS) { /* fail in not in mask_error mode */ @@ -90,7 +89,7 @@ static int ldif_read_objectSid(struct ldb_context *ldb, void *mem_ctx, if (sid == NULL) { return -1; } - ndr_err = ndr_push_struct_blob(out, mem_ctx, NULL, sid, + ndr_err = ndr_push_struct_blob(out, mem_ctx, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); talloc_free(sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -112,7 +111,7 @@ int ldif_write_objectSid(struct ldb_context *ldb, void *mem_ctx, if (sid == NULL) { return -1; } - ndr_err = ndr_pull_struct_blob_all(in, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob_all(in, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); @@ -209,7 +208,7 @@ static int extended_dn_read_SID(struct ldb_context *ldb, void *mem_ctx, (const char *)in->data, in->length); /* Check it looks like a SID */ - ndr_err = ndr_pull_struct_blob_all(out, mem_ctx, NULL, &sid, + ndr_err = ndr_pull_struct_blob_all(out, mem_ctx, &sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return -1; @@ -365,7 +364,7 @@ static int ldif_read_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ctx return -1; } - ndr_err = ndr_pull_struct_blob(in, sd, NULL, sd, + ndr_err = ndr_pull_struct_blob(in, sd, sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { /* If this does not parse, then it is probably SDDL, and we should try it that way */ @@ -378,7 +377,7 @@ static int ldif_read_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ctx } } - ndr_err = ndr_push_struct_blob(out, mem_ctx, NULL, sd, + ndr_err = ndr_push_struct_blob(out, mem_ctx, sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); talloc_free(sd); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -411,7 +410,7 @@ static int ldif_write_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ct return -1; } /* We can't use ndr_pull_struct_blob_all because this contains relative pointers */ - ndr_err = ndr_pull_struct_blob(in, sd, NULL, sd, + ndr_err = ndr_pull_struct_blob(in, sd, sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sd); @@ -588,7 +587,6 @@ static int ldif_read_prefixMap(struct ldb_context *ldb, void *mem_ctx, } ndr_err = ndr_push_struct_blob(out, mem_ctx, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), blob, (ndr_push_flags_fn_t)ndr_push_prefixMapBlob); talloc_free(tmp_ctx); @@ -633,7 +631,6 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, void *mem_ctx, return -1; } ndr_err = ndr_pull_struct_blob_all(in, blob, - lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), blob, (ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index c82ad398ff..e7c0b874c1 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -97,11 +97,9 @@ NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private_dat struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, const char *dir, struct server_id server_id, - struct smb_iconv_convenience *iconv_convenience, struct tevent_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, const char *dir, - struct smb_iconv_convenience *iconv_convenience, struct tevent_context *ev); NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, uint32_t msg_type, void *ptr); diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 3850bcbc49..19d6971088 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -47,7 +47,6 @@ struct messaging_context { struct idr_context *dispatch_tree; struct messaging_rec *pending; struct messaging_rec *retry_queue; - struct smb_iconv_convenience *iconv_convenience; struct irpc_list *irpc; struct idr_context *idr; const char **names; @@ -544,7 +543,6 @@ static int messaging_destructor(struct messaging_context *msg) struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, const char *dir, struct server_id server_id, - struct smb_iconv_convenience *iconv_convenience, struct tevent_context *ev) { struct messaging_context *msg; @@ -573,7 +571,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, msg->base_path = talloc_reference(msg, dir); msg->path = messaging_path(msg, server_id); msg->server_id = server_id; - msg->iconv_convenience = iconv_convenience; msg->idr = idr_init(msg); msg->dispatch_tree = idr_init(msg); msg->start_time = timeval_current(); @@ -624,13 +621,12 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, */ struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, const char *dir, - struct smb_iconv_convenience *iconv_convenience, struct tevent_context *ev) { struct server_id id; ZERO_STRUCT(id); id.id = random() % 0x10000000; - return messaging_init(mem_ctx, dir, id, iconv_convenience, ev); + return messaging_init(mem_ctx, dir, id, ev); } /* a list of registered irpc server functions @@ -714,7 +710,7 @@ NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status) m->header.status = status; /* setup the reply */ - push = ndr_push_init_ctx(m->ndr, m->msg_ctx->iconv_convenience); + push = ndr_push_init_ctx(m->ndr); if (push == NULL) { status = NT_STATUS_NO_MEMORY; goto failed; @@ -814,7 +810,7 @@ static void irpc_handler(struct messaging_context *msg_ctx, void *private_data, m->from = src; - m->ndr = ndr_pull_init_blob(packet, m, msg_ctx->iconv_convenience); + m->ndr = ndr_pull_init_blob(packet, m); if (m->ndr == NULL) goto failed; m->ndr->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -906,7 +902,7 @@ struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, header.status = NT_STATUS_OK; /* construct the irpc packet */ - ndr = ndr_push_init_ctx(irpc, msg_ctx->iconv_convenience); + ndr = ndr_push_init_ctx(irpc); if (ndr == NULL) goto failed; ndr_err = ndr_push_irpc_header(ndr, NDR_SCALARS|NDR_BUFFERS, &header); diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index cea3accce0..ddcf945400 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -99,12 +99,10 @@ PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwa ret->msg_ctx = messaging_init(ret->mem_ctx, messaging_path, server_id, - py_iconv_convenience(ret->mem_ctx), ev); } else { ret->msg_ctx = messaging_client_init(ret->mem_ctx, messaging_path, - py_iconv_convenience(ret->mem_ctx), ev); } @@ -355,12 +353,10 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs) ret->msg_ctx = messaging_init(ret->mem_ctx, messaging_path, server_id, - py_iconv_convenience(ret->mem_ctx), ev); } else { ret->msg_ctx = messaging_client_init(ret->mem_ctx, messaging_path, - py_iconv_convenience(ret->mem_ctx), ev); } diff --git a/source4/lib/messaging/tests/irpc.c b/source4/lib/messaging/tests/irpc.c index 3eb23e0f7d..87a3c7a124 100644 --- a/source4/lib/messaging/tests/irpc.c +++ b/source4/lib/messaging/tests/irpc.c @@ -222,7 +222,6 @@ static bool irpc_setup(struct torture_context *tctx, void **_data) messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID1), - lp_iconv_convenience(tctx->lp_ctx), data->ev), "Failed to init first messaging context"); @@ -230,7 +229,6 @@ static bool irpc_setup(struct torture_context *tctx, void **_data) messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, MSG_ID2), - lp_iconv_convenience(tctx->lp_ctx), data->ev), "Failed to init second messaging context"); diff --git a/source4/lib/messaging/tests/messaging.c b/source4/lib/messaging/tests/messaging.c index f61132caac..96cb180ff7 100644 --- a/source4/lib/messaging/tests/messaging.c +++ b/source4/lib/messaging/tests/messaging.c @@ -72,9 +72,7 @@ static bool test_ping_speed(struct torture_context *tctx) ev = tctx->ev; msg_server_ctx = messaging_init(tctx, - lp_messaging_path(tctx, tctx->lp_ctx), - cluster_id(0, 1), - lp_iconv_convenience(tctx->lp_ctx), + lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1), ev); torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context"); @@ -85,7 +83,6 @@ static bool test_ping_speed(struct torture_context *tctx) msg_client_ctx = messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 2), - lp_iconv_convenience(tctx->lp_ctx), ev); torture_assert(tctx, msg_client_ctx != NULL, diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c index c9cb247071..5763dff0d2 100644 --- a/source4/lib/registry/hive.c +++ b/source4/lib/registry/hive.c @@ -54,7 +54,7 @@ _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location, if (!strncmp(peek, "regf", 4)) { close(fd); - return reg_open_regf_file(parent_ctx, location, lp_iconv_convenience(lp_ctx), root); + return reg_open_regf_file(parent_ctx, location, root); } else if (!strncmp(peek, "TDB file", 8)) { close(fd); return reg_open_ldb_file(parent_ctx, location, session_info, diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c index a01c3554c4..061d0fe52d 100644 --- a/source4/lib/registry/patchfile.c +++ b/source4/lib/registry/patchfile.c @@ -26,12 +26,10 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data); _PUBLIC_ WERROR reg_dotreg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data); @@ -338,7 +336,6 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1, * Load diff file */ _PUBLIC_ WERROR reg_diff_load(const char *filename, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data) { @@ -372,10 +369,10 @@ _PUBLIC_ WERROR reg_diff_load(const char *filename, #endif if (strncmp(hdr, "PReg", 4) == 0) { /* Must be a GPO Registry.pol file */ - return reg_preg_diff_load(fd, iconv_convenience, callbacks, callback_data); + return reg_preg_diff_load(fd, callbacks, callback_data); } else { /* Must be a normal .REG file */ - return reg_dotreg_diff_load(fd, iconv_convenience, callbacks, callback_data); + return reg_dotreg_diff_load(fd, callbacks, callback_data); } } @@ -531,7 +528,6 @@ static WERROR reg_diff_apply_del_all_values(void *_ctx, const char *key_name) * Apply diff to a registry context */ _PUBLIC_ WERROR reg_diff_apply(struct registry_context *ctx, - struct smb_iconv_convenience *iconv_convenience, const char *filename) { struct reg_diff_callbacks callbacks; @@ -543,6 +539,5 @@ _PUBLIC_ WERROR reg_diff_apply(struct registry_context *ctx, callbacks.del_all_values = reg_diff_apply_del_all_values; callbacks.done = NULL; - return reg_diff_load(filename, iconv_convenience, - &callbacks, ctx); + return reg_diff_load(filename, &callbacks, ctx); } diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c index 5bb955ebc3..70437a1087 100644 --- a/source4/lib/registry/patchfile_dotreg.c +++ b/source4/lib/registry/patchfile_dotreg.c @@ -35,7 +35,6 @@ struct dotreg_data { int fd; - struct smb_iconv_convenience *iconv_convenience; }; static WERROR reg_dotreg_diff_add_key(void *_data, const char *key_name) @@ -61,7 +60,7 @@ static WERROR reg_dotreg_diff_set_value(void *_data, const char *path, uint32_t value_type, DATA_BLOB value) { struct dotreg_data *data = (struct dotreg_data *)_data; - char *data_string = reg_val_data_string(NULL, data->iconv_convenience, + char *data_string = reg_val_data_string(NULL, value_type, value); W_ERROR_HAVE_NO_MEMORY(data_string); fdprintf(data->fd, "\"%s\"=%s:%s\n", @@ -101,7 +100,6 @@ static WERROR reg_dotreg_diff_del_all_values(void *callback_data, * Save registry diff */ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, - struct smb_iconv_convenience *iconv_convenience, struct reg_diff_callbacks **callbacks, void **callback_data) { @@ -110,8 +108,6 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, data = talloc_zero(ctx, struct dotreg_data); *callback_data = data; - data->iconv_convenience = iconv_convenience; - if (filename) { data->fd = open(filename, O_CREAT|O_WRONLY, 0755); if (data->fd < 0) { @@ -140,7 +136,6 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, * Load diff file */ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data) { @@ -248,7 +243,7 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd, q++; } - reg_string_to_val(line, iconv_convenience, + reg_string_to_val(line, q?p:"REG_SZ", q?q:p, &value_type, &value); diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c index 625904bd52..28b56dd7e9 100644 --- a/source4/lib/registry/patchfile_preg.c +++ b/source4/lib/registry/patchfile_preg.c @@ -164,7 +164,6 @@ static WERROR reg_preg_diff_done(void *_data) * Save registry diff */ _PUBLIC_ WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename, - struct smb_iconv_convenience *ic, struct reg_diff_callbacks **callbacks, void **callback_data) { @@ -209,7 +208,6 @@ _PUBLIC_ WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename, * Load diff file */ _PUBLIC_ WERROR reg_preg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data) { diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index d4cdd895af..58894feb3a 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -22,7 +22,6 @@ #include <tevent.h> #include "libcli/util/pyerrors.h" #include "lib/registry/registry.h" -#include "scripting/python/modules.h" /* for py_iconv_convenience() */ #include "lib/talloc/pytalloc.h" #include "auth/credentials/pycredentials.h" #include "param/pyparam.h" @@ -91,7 +90,7 @@ static PyObject *py_diff_apply(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "s", &filename)) return NULL; - result = reg_diff_apply(ctx, py_iconv_convenience(NULL), filename); + result = reg_diff_apply(ctx, filename); PyErr_WERROR_IS_ERR_RAISE(result); Py_RETURN_NONE; diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index 3888b8e3ab..176b256c87 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -49,7 +49,6 @@ struct regf_data { int fd; struct hbin_block **hbins; struct regf_hdr *header; - struct smb_iconv_convenience *iconv_convenience; }; static WERROR regf_save_hbin(struct regf_data *data); @@ -134,7 +133,7 @@ static DATA_BLOB hbin_get(const struct regf_data *data, uint32_t offset) static bool hbin_get_tdr(struct regf_data *regf, uint32_t offset, TALLOC_CTX *ctx, tdr_pull_fn_t pull_fn, void *p) { - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); pull->data = hbin_get(regf, offset); if (!pull->data.data) { @@ -272,7 +271,7 @@ static uint32_t hbin_store (struct regf_data *data, DATA_BLOB blob) static uint32_t hbin_store_tdr(struct regf_data *data, tdr_push_fn_t push_fn, void *p) { - struct tdr_push *push = tdr_push_init(data, data->iconv_convenience); + struct tdr_push *push = tdr_push_init(data); uint32_t ret; if (NT_STATUS_IS_ERR(push_fn(push, p))) { @@ -399,7 +398,7 @@ static uint32_t hbin_store_tdr_resize(struct regf_data *regf, tdr_push_fn_t push_fn, uint32_t orig_offset, void *p) { - struct tdr_push *push = tdr_push_init(regf, regf->iconv_convenience); + struct tdr_push *push = tdr_push_init(regf); uint32_t ret; if (NT_STATUS_IS_ERR(push_fn(push, p))) { @@ -615,7 +614,7 @@ static WERROR regf_get_subkey_by_index(TALLOC_CTX *ctx, if (!strncmp((char *)data.data, "li", 2)) { struct li_block li; - struct tdr_pull *pull = tdr_pull_init(private_data->hive, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(private_data->hive); DEBUG(10, ("Subkeys in LI list\n")); pull->data = data; @@ -636,7 +635,7 @@ static WERROR regf_get_subkey_by_index(TALLOC_CTX *ctx, } else if (!strncmp((char *)data.data, "lf", 2)) { struct lf_block lf; - struct tdr_pull *pull = tdr_pull_init(private_data->hive, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(private_data->hive); DEBUG(10, ("Subkeys in LF list\n")); pull->data = data; @@ -657,7 +656,7 @@ static WERROR regf_get_subkey_by_index(TALLOC_CTX *ctx, key_off = lf.hr[idx].nk_offset; } else if (!strncmp((char *)data.data, "lh", 2)) { struct lh_block lh; - struct tdr_pull *pull = tdr_pull_init(private_data->hive, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(private_data->hive); DEBUG(10, ("Subkeys in LH list\n")); pull->data = data; @@ -677,7 +676,7 @@ static WERROR regf_get_subkey_by_index(TALLOC_CTX *ctx, key_off = lh.hr[idx].nk_offset; } else if (!strncmp((char *)data.data, "ri", 2)) { struct ri_block ri; - struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(ctx); uint16_t i; uint16_t sublist_count = 0; @@ -811,7 +810,7 @@ static WERROR regf_match_subkey_by_name(TALLOC_CTX *ctx, return WERR_GENERAL_FAILURE; } - pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + pull = tdr_pull_init(ctx); pull->data = subkey_data; @@ -854,7 +853,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx, if (!strncmp((char *)data.data, "li", 2)) { struct li_block li; - struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(ctx); uint16_t i; DEBUG(10, ("Subkeys in LI list\n")); @@ -885,7 +884,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx, return WERR_BADFILE; } else if (!strncmp((char *)data.data, "lf", 2)) { struct lf_block lf; - struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(ctx); uint16_t i; DEBUG(10, ("Subkeys in LF list\n")); @@ -920,7 +919,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx, return WERR_BADFILE; } else if (!strncmp((char *)data.data, "lh", 2)) { struct lh_block lh; - struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(ctx); uint16_t i; uint32_t hash; @@ -957,7 +956,7 @@ static WERROR regf_get_subkey_by_name(TALLOC_CTX *ctx, return WERR_BADFILE; } else if (!strncmp((char *)data.data, "ri", 2)) { struct ri_block ri; - struct tdr_pull *pull = tdr_pull_init(ctx, private_data->hive->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(ctx); uint16_t i, j; DEBUG(10, ("Subkeys in RI list\n")); @@ -1062,7 +1061,7 @@ static WERROR regf_set_sec_desc(struct hive_key *key, (tdr_pull_fn_t) tdr_pull_nk_block, &root); /* Push the security descriptor to a blob */ - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(&data, regf, NULL, + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(&data, regf, sec_desc, (ndr_push_flags_fn_t)ndr_push_security_descriptor))) { DEBUG(0, ("Unable to push security descriptor\n")); return WERR_GENERAL_FAILURE; @@ -1215,7 +1214,7 @@ static WERROR regf_get_sec_desc(TALLOC_CTX *ctx, const struct hive_key *key, data.data = sk.sec_desc; data.length = sk.rec_size; - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_struct_blob(&data, ctx, NULL, *sd, + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_struct_blob(&data, ctx, *sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor))) { DEBUG(0, ("Error parsing security descriptor\n")); return WERR_GENERAL_FAILURE; @@ -1299,7 +1298,7 @@ static WERROR regf_sl_add_entry(struct regf_data *regf, uint32_t list_offset, } if (!strncmp((char *)data.data, "li", 2)) { - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); struct li_block li; pull->data = data; @@ -1328,7 +1327,7 @@ static WERROR regf_sl_add_entry(struct regf_data *regf, uint32_t list_offset, talloc_free(li.nk_offset); } else if (!strncmp((char *)data.data, "lf", 2)) { - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); struct lf_block lf; pull->data = data; @@ -1354,7 +1353,7 @@ static WERROR regf_sl_add_entry(struct regf_data *regf, uint32_t list_offset, talloc_free(lf.hr); } else if (!strncmp((char *)data.data, "lh", 2)) { - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); struct lh_block lh; pull->data = data; @@ -1403,7 +1402,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset, if (strncmp((char *)data.data, "li", 2) == 0) { struct li_block li; - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); uint16_t i; bool found_offset = false; @@ -1447,7 +1446,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset, list_offset, &li); } else if (strncmp((char *)data.data, "lf", 2) == 0) { struct lf_block lf; - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); uint16_t i; bool found_offset = false; @@ -1493,7 +1492,7 @@ static WERROR regf_sl_del_entry(struct regf_data *regf, uint32_t list_offset, list_offset, &lf); } else if (strncmp((char *)data.data, "lh", 2) == 0) { struct lh_block lh; - struct tdr_pull *pull = tdr_pull_init(regf, regf->iconv_convenience); + struct tdr_pull *pull = tdr_pull_init(regf); uint16_t i; bool found_offset = false; @@ -1889,7 +1888,7 @@ static WERROR regf_set_value(struct hive_key *key, const char *name, static WERROR regf_save_hbin(struct regf_data *regf) { - struct tdr_push *push = tdr_push_init(regf, regf->iconv_convenience); + struct tdr_push *push = tdr_push_init(regf); unsigned int i; W_ERROR_HAVE_NO_MEMORY(push); @@ -1907,7 +1906,7 @@ static WERROR regf_save_hbin(struct regf_data *regf) regf->header->chksum = regf_hdr_checksum(push->data.data); talloc_free(push); - if (NT_STATUS_IS_ERR(tdr_push_to_fd(regf->fd, regf->iconv_convenience, + if (NT_STATUS_IS_ERR(tdr_push_to_fd(regf->fd, (tdr_push_fn_t)tdr_push_regf_hdr, regf->header))) { DEBUG(0, ("Error writing registry file header\n")); @@ -1920,7 +1919,7 @@ static WERROR regf_save_hbin(struct regf_data *regf) } for (i = 0; regf->hbins[i]; i++) { - if (NT_STATUS_IS_ERR(tdr_push_to_fd(regf->fd, regf->iconv_convenience, + if (NT_STATUS_IS_ERR(tdr_push_to_fd(regf->fd, (tdr_push_fn_t)tdr_push_hbin_block, regf->hbins[i]))) { DEBUG(0, ("Error writing HBIN block\n")); @@ -1932,7 +1931,6 @@ static WERROR regf_save_hbin(struct regf_data *regf) } WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *location, int minor_version, struct hive_key **key) { @@ -1947,8 +1945,6 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, regf = (struct regf_data *)talloc_zero(NULL, struct regf_data); - regf->iconv_convenience = iconv_convenience; - W_ERROR_HAVE_NO_MEMORY(regf); DEBUG(5, ("Attempting to create registry file\n")); @@ -2017,7 +2013,7 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, NULL); /* Push the security descriptor to a blob */ - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(&data, regf, NULL, + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(&data, regf, sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor))) { DEBUG(0, ("Unable to push security descriptor\n")); return WERR_GENERAL_FAILURE; @@ -2060,7 +2056,7 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, } WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location, - struct smb_iconv_convenience *iconv_convenience, struct hive_key **key) + struct hive_key **key) { struct regf_data *regf; struct regf_hdr *regf_hdr; @@ -2069,8 +2065,6 @@ WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location, regf = (struct regf_data *)talloc_zero(parent_ctx, struct regf_data); - regf->iconv_convenience = iconv_convenience; - W_ERROR_HAVE_NO_MEMORY(regf); DEBUG(5, ("Attempting to load registry file\n")); @@ -2085,7 +2079,7 @@ WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location, return WERR_GENERAL_FAILURE; } - pull = tdr_pull_init(regf, regf->iconv_convenience); + pull = tdr_pull_init(regf); pull->data.data = (uint8_t*)fd_load(regf->fd, &pull->data.length, 0, regf); diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h index e43b0b054c..76247528b2 100644 --- a/source4/lib/registry/registry.h +++ b/source4/lib/registry/registry.h @@ -23,7 +23,6 @@ struct registry_context; struct loadparm_context; -struct smb_iconv_convenience; #include <talloc.h> #include "libcli/util/werror.h" @@ -206,8 +205,7 @@ WERROR hive_key_flush(struct hive_key *key); WERROR reg_open_directory(TALLOC_CTX *parent_ctx, const char *location, struct hive_key **key); WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, - const char *location, struct smb_iconv_convenience *iconv_convenience, - struct hive_key **key); + const char *location, struct hive_key **key); WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location, struct auth_session_info *session_info, struct cli_credentials *credentials, @@ -219,7 +217,6 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location, WERROR reg_create_directory(TALLOC_CTX *parent_ctx, const char *location, struct hive_key **key); WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *location, int major_version, struct hive_key **key); @@ -453,19 +450,15 @@ WERROR reg_create_key(TALLOC_CTX *mem_ctx, /* Utility functions */ const char *str_regtype(int type); -bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - DATA_BLOB *blob, const char *s); -bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - DATA_BLOB *blob, const char **a); -bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - const DATA_BLOB *blob, const char **s); -bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - const DATA_BLOB *blob, const char ***a); +bool push_reg_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *s); +bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **a); +bool pull_reg_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char **s); +bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char ***a); int regtype_by_string(const char *str); -char *reg_val_data_string(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t type, const DATA_BLOB data); -char *reg_val_description(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const char *name, +char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type, const DATA_BLOB data); +char *reg_val_description(TALLOC_CTX *mem_ctx, const char *name, uint32_t type, const DATA_BLOB data); -bool reg_string_to_val(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const char *type_str, +bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, const char *data_str, uint32_t *type, DATA_BLOB *data); WERROR reg_open_key_abs(TALLOC_CTX *mem_ctx, struct registry_context *handle, const char *name, struct registry_key **result); @@ -502,18 +495,16 @@ struct reg_diff_callbacks { }; WERROR reg_diff_apply(struct registry_context *ctx, - struct smb_iconv_convenience *ic, const char *filename); + const char *filename); WERROR reg_generate_diff(struct registry_context *ctx1, struct registry_context *ctx2, const struct reg_diff_callbacks *callbacks, void *callback_data); WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, - struct smb_iconv_convenience *iconv_convenience, struct reg_diff_callbacks **callbacks, void **callback_data); WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename, - struct smb_iconv_convenience *ic, struct reg_diff_callbacks **callbacks, void **callback_data); WERROR reg_generate_diff_key(struct registry_key *oldkey, @@ -522,17 +513,14 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey, const struct reg_diff_callbacks *callbacks, void *callback_data); WERROR reg_diff_load(const char *filename, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data); WERROR reg_dotreg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data); WERROR reg_preg_diff_load(int fd, - struct smb_iconv_convenience *iconv_convenience, const struct reg_diff_callbacks *callbacks, void *callback_data); diff --git a/source4/lib/registry/tests/diff.c b/source4/lib/registry/tests/diff.c index 4241ab5ee2..d6a5bd53f2 100644 --- a/source4/lib/registry/tests/diff.c +++ b/source4/lib/registry/tests/diff.c @@ -52,14 +52,11 @@ static bool test_generate_diff(struct torture_context *tctx, void *tcase_data) static bool test_diff_load(struct torture_context *tctx, void *tcase_data) { struct diff_tcase_data *td = tcase_data; - struct smb_iconv_convenience *ic; struct reg_diff_callbacks *callbacks; void *data; WERROR error; - ic = lp_iconv_convenience(tctx->lp_ctx); - - error = reg_diff_load(td->filename, iconv_convenience, callbacks, data); + error = reg_diff_load(td->filename, callbacks, data); torture_assert_werr_ok(tctx, error, "reg_diff_load"); return true; @@ -71,7 +68,7 @@ static bool test_diff_apply(struct torture_context *tctx, void *tcase_data) struct registry_key *key; WERROR error; - error = reg_diff_apply(td->r1_ctx, lp_iconv_convenience(tctx->lp_ctx), td->filename); + error = reg_diff_apply(td->r1_ctx, td->filename); torture_assert_werr_ok(tctx, error, "reg_diff_apply"); error = td->r1_ctx->ops->get_predefined_key(td->r1_ctx, HKEY_LOCAL_MACHINE, &key); @@ -247,16 +244,14 @@ static bool diff_setup_tcase(struct torture_context *tctx, void **data) static bool diff_setup_preg_tcase (struct torture_context *tctx, void **data) { struct diff_tcase_data *td; - struct smb_iconv_convenience *ic; WERROR error; diff_setup_tcase(tctx, data); td = *data; - ic = lp_iconv_convenience(tctx->lp_ctx); - td->filename = talloc_asprintf(tctx, "%s/test.pol", td->tempdir); - error = reg_preg_diff_save(tctx, td->filename, ic, &td->callbacks, &td->callback_data); + error = reg_preg_diff_save(tctx, td->filename, &td->callbacks, + &td->callback_data); torture_assert_werr_ok(tctx, error, "reg_preg_diff_save"); return true; @@ -265,16 +260,14 @@ static bool diff_setup_preg_tcase (struct torture_context *tctx, void **data) static bool diff_setup_dotreg_tcase (struct torture_context *tctx, void **data) { struct diff_tcase_data *td; - struct smb_iconv_convenience *ic; WERROR error; diff_setup_tcase(tctx, data); td = *data; - ic = lp_iconv_convenience(tctx->lp_ctx); - td->filename = talloc_asprintf(tctx, "%s/test.reg", td->tempdir); - error = reg_dotreg_diff_save(tctx, td->filename, ic, &td->callbacks, &td->callback_data); + error = reg_dotreg_diff_save(tctx, td->filename, &td->callbacks, + &td->callback_data); torture_assert_werr_ok(tctx, error, "reg_dotreg_diff_save"); return true; diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c index 75b6c7ff26..a69a6148d5 100644 --- a/source4/lib/registry/tests/generic.c +++ b/source4/lib/registry/tests/generic.c @@ -65,7 +65,7 @@ static bool test_reg_val_data_string_dword(struct torture_context *ctx) uint8_t d[] = { 0x20, 0x00, 0x00, 0x00 }; DATA_BLOB db = { d, 4 }; torture_assert_str_equal(ctx, "0x00000020", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD, db), + reg_val_data_string(ctx, REG_DWORD, db), "dword failed"); return true; } @@ -75,7 +75,7 @@ static bool test_reg_val_data_string_dword_big_endian(struct torture_context *ct uint8_t d[] = { 0x20, 0x00, 0x00, 0x00 }; DATA_BLOB db = { d, 4 }; torture_assert_str_equal(ctx, "0x00000020", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD_BIG_ENDIAN, db), + reg_val_data_string(ctx, REG_DWORD_BIG_ENDIAN, db), "dword failed"); return true; } @@ -85,7 +85,7 @@ static bool test_reg_val_data_string_qword(struct torture_context *ctx) uint8_t d[] = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; DATA_BLOB db = { d, 8 }; torture_assert_str_equal(ctx, "0x0000000000000020", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_QWORD, db), + reg_val_data_string(ctx, REG_QWORD, db), "qword failed"); return true; } @@ -93,14 +93,14 @@ static bool test_reg_val_data_string_qword(struct torture_context *ctx) static bool test_reg_val_data_string_sz(struct torture_context *ctx) { DATA_BLOB db; - convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16, + convert_string_talloc(ctx, CH_UTF8, CH_UTF16, "bla", 3, (void **)&db.data, &db.length, false); torture_assert_str_equal(ctx, "bla", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_SZ, db), + reg_val_data_string(ctx, REG_SZ, db), "sz failed"); db.length = 4; torture_assert_str_equal(ctx, "bl", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_SZ, db), + reg_val_data_string(ctx, REG_SZ, db), "sz failed"); return true; } @@ -110,7 +110,7 @@ static bool test_reg_val_data_string_binary(struct torture_context *ctx) uint8_t x[] = { 0x1, 0x2, 0x3, 0x4 }; DATA_BLOB db = { x, 4 }; torture_assert_str_equal(ctx, "01020304", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_BINARY, db), + reg_val_data_string(ctx, REG_BINARY, db), "binary failed"); return true; } @@ -120,7 +120,7 @@ static bool test_reg_val_data_string_empty(struct torture_context *ctx) { DATA_BLOB db = { NULL, 0 }; torture_assert_str_equal(ctx, "", - reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_BINARY, db), + reg_val_data_string(ctx, REG_BINARY, db), "empty failed"); return true; } @@ -128,12 +128,12 @@ static bool test_reg_val_data_string_empty(struct torture_context *ctx) static bool test_reg_val_description(struct torture_context *ctx) { DATA_BLOB data; - convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16, + convert_string_talloc(ctx, CH_UTF8, CH_UTF16, "stationary traveller", strlen("stationary traveller"), (void **)&data.data, &data.length, false); torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller", - reg_val_description(ctx, lp_iconv_convenience(ctx->lp_ctx), "camel", REG_SZ, data), + reg_val_description(ctx, "camel", REG_SZ, data), "reg_val_description failed"); return true; } @@ -142,12 +142,12 @@ static bool test_reg_val_description(struct torture_context *ctx) static bool test_reg_val_description_nullname(struct torture_context *ctx) { DATA_BLOB data; - convert_string_talloc_convenience(ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF8, CH_UTF16, + convert_string_talloc(ctx, CH_UTF8, CH_UTF16, "west berlin", strlen("west berlin"), (void **)&data.data, &data.length, false); torture_assert_str_equal(ctx, "<No Name> = REG_SZ : west berlin", - reg_val_description(ctx, lp_iconv_convenience(ctx->lp_ctx), NULL, REG_SZ, data), + reg_val_description(ctx, NULL, REG_SZ, data), "description with null name failed"); return true; } diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c index 905b9a97ef..4ae9a5bcbf 100644 --- a/source4/lib/registry/tests/hive.c +++ b/source4/lib/registry/tests/hive.c @@ -435,8 +435,7 @@ static bool hive_setup_regf(struct torture_context *tctx, void **data) rmdir(dirname); - error = reg_create_regf_file(tctx, lp_iconv_convenience(tctx->lp_ctx), - dirname, 5, &key); + error = reg_create_regf_file(tctx, dirname, 5, &key); if (!W_ERROR_IS_OK(error)) { fprintf(stderr, "Unable to create new regf file\n"); return false; diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index 945b472903..bd58f7748f 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -130,8 +130,7 @@ int main(int argc, const char **argv) poptFreeContext(pc); - error = reg_dotreg_diff_save(ctx, outputfile, lp_iconv_convenience(cmdline_lp_ctx), &callbacks, - &callback_data); + error = reg_dotreg_diff_save(ctx, outputfile, &callbacks, &callback_data); if (!W_ERROR_IS_OK(error)) { fprintf(stderr, "Problem saving registry diff to '%s': %s\n", outputfile, win_errstr(error)); diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 3f550e517e..a8c1843116 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) poptFreeContext(pc); - reg_diff_apply(h, lp_iconv_convenience(cmdline_lp_ctx), patch); + reg_diff_apply(h, patch); return 0; } diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index b72b07574e..3a8c62d1ce 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -195,9 +195,7 @@ static WERROR cmd_set(struct regshell_context *ctx, int argc, char **argv) return WERR_INVALID_PARAM; } - if (!reg_string_to_val(ctx, lp_iconv_convenience(cmdline_lp_ctx), - argv[2], argv[3], &val.data_type, - &val.data)) { + if (!reg_string_to_val(ctx, argv[2], argv[3], &val.data_type, &val.data)) { fprintf(stderr, "Unable to interpret data\n"); return WERR_INVALID_PARAM; } @@ -259,7 +257,7 @@ static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv) } printf("%s\n%s\n", str_regtype(value_type), - reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx), value_type, value_data)); + reg_val_data_string(ctx, value_type, value_data)); return WERR_OK; } @@ -290,7 +288,7 @@ static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv) for (i = 0; W_ERROR_IS_OK(error = reg_key_get_value_by_index(ctx, ctx->current, i, &name, &valuetype, &valuedata)); i++) printf("V \"%s\" %s %s\n", name, str_regtype(valuetype), - reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx), valuetype, valuedata)); + reg_val_data_string(ctx, valuetype, valuedata)); return WERR_OK; } diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 3a7026b4a4..6857940672 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -81,8 +81,7 @@ static void print_tree(unsigned int level, struct registry_key *p, unsigned int j; for(j = 0; j < level+1; j++) putchar(' '); printf("%s\n", reg_val_description(mem_ctx, - lp_iconv_convenience(cmdline_lp_ctx), valuename, - valuetype, valuedata)); + valuename, valuetype, valuedata)); } talloc_free(mem_ctx); diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 62a94dfcc7..fce420e625 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -21,9 +21,7 @@ #include "lib/registry/registry.h" #include "librpc/gen_ndr/winreg.h" -_PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, - uint32_t type, +_PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type, const DATA_BLOB data) { char *ret = NULL; @@ -34,13 +32,9 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, switch (type) { case REG_EXPAND_SZ: case REG_SZ: - convert_string_talloc_convenience(mem_ctx, - iconv_convenience, - CH_UTF16, CH_UNIX, - data.data, - data.length, - (void **)&ret, - NULL, false); + convert_string_talloc(mem_ctx, + CH_UTF16, CH_UNIX, data.data, data.length, + (void **)&ret, NULL, false); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: @@ -73,21 +67,17 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, /** Generate a string that describes a registry value */ _PUBLIC_ char *reg_val_description(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *name, uint32_t data_type, const DATA_BLOB data) { return talloc_asprintf(mem_ctx, "%s = %s : %s", name?name:"<No Name>", str_regtype(data_type), - reg_val_data_string(mem_ctx, iconv_convenience, data_type, data)); + reg_val_data_string(mem_ctx, data_type, data)); } -_PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, - const char *type_str, - const char *data_str, uint32_t *type, - DATA_BLOB *data) +_PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, + const char *data_str, uint32_t *type, DATA_BLOB *data) { *type = regtype_by_string(type_str); @@ -99,10 +89,8 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, switch (*type) { case REG_SZ: case REG_EXPAND_SZ: - return convert_string_talloc_convenience(mem_ctx, - iconv_convenience, - CH_UNIX, CH_UTF16, - data_str, + return convert_string_talloc(mem_ctx, + CH_UNIX, CH_UTF16, data_str, strlen(data_str)+1, (void **)&data->data, &data->length, false); 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)) { diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index a284b33e6f..6af52069d4 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -797,9 +797,7 @@ static void becomeDC_recv_cldap(struct tevent_req *req) struct libnet_BecomeDC_state); struct composite_context *c = s->creq; - c->status = cldap_netlogon_recv(req, - lp_iconv_convenience(s->libnet->lp_ctx), - s, &s->cldap.io); + c->status = cldap_netlogon_recv(req, s, &s->cldap.io); talloc_free(req); if (!composite_is_ok(c)) { DEBUG(0,("Failed to send, receive or parse CLDAP reply from server %s for our host %s: %s\n", @@ -1754,7 +1752,6 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) struct drsuapi_DsReplicaObjectIdentifier *identifier; uint32_t num_attrs, i = 0; struct drsuapi_DsReplicaAttribute *attrs; - struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(s->libnet->lp_ctx); enum ndr_err_code ndr_err; bool w2k3; struct tevent_req *subreq; @@ -1854,7 +1851,8 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) NULL); if (composite_nomem(v, c)) return; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor); + ndr_err = ndr_push_struct_blob(&vd[0], vd, v, + (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -1919,8 +1917,8 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) } if (composite_nomem(v[0].dn, c)) return; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -1985,22 +1983,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[2].sid = s->zero_sid; v[2].dn = s->forest.schema_dn_str; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; } - ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &v[1], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[1], vd, &v[1], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; } - ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &v[2], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[2], vd, &v[2], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -2041,22 +2039,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[2].sid = s->zero_sid; v[2].dn = s->forest.schema_dn_str; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; } - ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &v[1], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[1], vd, &v[1], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; } - ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &v[2], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[2], vd, &v[2], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -2089,8 +2087,8 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->forest.schema_dn_str; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -2121,8 +2119,8 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->domain.dn_str; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; @@ -2207,8 +2205,8 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) v[0].sid = s->zero_sid; v[0].dn = s->dest_dsa.computer_dn_str; - ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0], - (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); + ndr_err = ndr_push_struct_blob(&vd[0], vd, &v[0], + (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { c->status = ndr_map_error2ntstatus(ndr_err); if (!composite_is_ok(c)) return; diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index 0a8edef311..21851d5ae8 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -192,13 +192,14 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx, { struct composite_context *c; struct messaging_context *msg_ctx = - messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, ctx->lp_ctx), - lp_iconv_convenience(ctx->lp_ctx), ctx->event_ctx); - - c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), lp_nbt_port(ctx->lp_ctx), - io->in.domain_name, io->in.name_type, - NULL, lp_iconv_convenience(ctx->lp_ctx), - ctx->resolve_ctx, ctx->event_ctx, msg_ctx); + messaging_client_init(mem_ctx, + lp_messaging_path(mem_ctx, ctx->lp_ctx), + ctx->event_ctx); + + c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), + lp_nbt_port(ctx->lp_ctx), io->in.domain_name, + io->in.name_type, NULL, ctx->resolve_ctx, + ctx->event_ctx, msg_ctx); return c; } diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c index 3147cbb0f9..bd6dfbf421 100644 --- a/source4/libnet/libnet_site.c +++ b/source4/libnet/libnet_site.c @@ -75,7 +75,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li r->out.error_string = NULL; return status; } - status = cldap_netlogon(cldap, lp_iconv_convenience(lctx->lp_ctx), tmp_ctx, &search); + status = cldap_netlogon(cldap, tmp_ctx, &search); if (!NT_STATUS_IS_OK(status) || !search.out.netlogon.data.nt5_ex.client_site) { /* diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index b584c75be6..66f73d594f 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -298,9 +298,7 @@ static void unbecomeDC_recv_cldap(struct tevent_req *req) struct libnet_UnbecomeDC_state); struct composite_context *c = s->creq; - c->status = cldap_netlogon_recv(req, - lp_iconv_convenience(s->libnet->lp_ctx), - s, &s->cldap.io); + c->status = cldap_netlogon_recv(req, s, &s->cldap.io); talloc_free(req); if (!composite_is_ok(c)) return; diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 6d4481f977..d7ffcd79aa 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -423,7 +423,7 @@ static NTSTATUS vampire_schema_chunk(void *private_data, } if (!s->schema) { - s->self_made_schema = dsdb_new_schema(s, lp_iconv_convenience(s->lp_ctx)); + s->self_made_schema = dsdb_new_schema(s); NT_STATUS_HAVE_NO_MEMORY(s->self_made_schema); diff --git a/source4/librpc/idl/winsrepl.idl b/source4/librpc/idl/winsrepl.idl index cedc70bb03..01b8e32bea 100644 --- a/source4/librpc/idl/winsrepl.idl +++ b/source4/librpc/idl/winsrepl.idl @@ -167,7 +167,7 @@ import "nbt.idl"; } wrepl_packet; typedef [flag(NDR_BIG_ENDIAN|NDR_PAHEX),public] struct { - [value(ndr_size_wrepl_packet(&packet, ndr->iconv_convenience, ndr->flags))] uint32 size; + [value(ndr_size_wrepl_packet(&packet, ndr->flags))] uint32 size; wrepl_packet packet; } wrepl_wrap; diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index dfa72b5262..08c3c7fc6e 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -81,8 +81,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len2 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, chset, CH_UNIX, + if (!convert_string_talloc(ndr->current_mem_ctx, + chset, CH_UNIX, ndr->data+ndr->offset, (len2 + c_len_term)*byte_mul, (void **)&as, &ret, false)) { @@ -117,8 +117,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len1 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, (len1 + c_len_term)*byte_mul, @@ -155,8 +154,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len1 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, (len1 + c_len_term)*byte_mul, @@ -189,8 +187,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len3 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, (len3 + c_len_term)*byte_mul, @@ -221,8 +218,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len3 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, len3, @@ -241,8 +237,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, } else { len1 = utf16_len_n(ndr->data+ndr->offset, ndr->data_size - ndr->offset); } - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, chset, CH_UNIX, + if (!convert_string_talloc(ndr->current_mem_ctx, + chset, CH_UNIX, ndr->data+ndr->offset, len1, (void **)&as, &ret, false)) { @@ -265,8 +261,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (len1 == 0) { as = talloc_strdup(ndr->current_mem_ctx, ""); } else { - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, len1, @@ -327,7 +322,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags, if (!(flags & LIBNDR_FLAG_STR_NOTERM)) { s_len++; } - if (!convert_string_talloc_convenience(ndr, ndr->iconv_convenience, CH_UNIX, chset, s, s_len, (void **)&dest, &d_len, false)) { + if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len, (void **)&dest, &d_len, false)) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, "Bad character push conversion with flags 0x%x", flags); } @@ -660,8 +655,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, NDR_PULL_NEED_BYTES(ndr, length*byte_mul); - if (!convert_string_talloc_convenience(ndr->current_mem_ctx, - ndr->iconv_convenience, + if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, length*byte_mul, @@ -685,9 +679,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, required = byte_mul * length; NDR_PUSH_NEED_BYTES(ndr, required); - if (!convert_string_convenience(ndr->iconv_convenience, CH_UNIX, chset, - var, strlen(var), - ndr->data+ndr->offset, required, &ret, false)) { + ret = convert_string(CH_UNIX, chset, var, strlen(var), + ndr->data+ndr->offset, required, false); + if (ret == -1) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion"); } diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 95f83465fc..7265105525 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -55,8 +55,7 @@ static int dcerpc_connection_destructor(struct dcerpc_connection *conn) the event context is optional */ static struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct smb_iconv_convenience *ic) + struct tevent_context *ev) { struct dcerpc_connection *c; @@ -65,8 +64,6 @@ static struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx, return NULL; } - c->iconv_convenience = talloc_reference(c, ic); - c->event_ctx = ev; if (c->event_ctx == NULL) { @@ -90,8 +87,7 @@ static struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx, } /* initialise a dcerpc pipe. */ -_PUBLIC_ struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct smb_iconv_convenience *ic) +_PUBLIC_ struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev) { struct dcerpc_pipe *p; @@ -100,7 +96,7 @@ _PUBLIC_ struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent return NULL; } - p->conn = dcerpc_connection_init(p, ev, ic); + p->conn = dcerpc_connection_init(p, ev); if (p->conn == NULL) { talloc_free(p); return NULL; @@ -177,7 +173,7 @@ void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v) 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, c->iconv_convenience); + struct ndr_pull *ndr = ndr_pull_init_blob(blob, mem_ctx); if (ndr == NULL) return ndr; @@ -328,7 +324,7 @@ static NTSTATUS ncacn_push_request_sign(struct dcerpc_connection *c, /* non-signed packets are simpler */ if (sig_size == 0) { - return ncacn_push_auth(blob, mem_ctx, c->iconv_convenience, pkt, NULL); + return ncacn_push_auth(blob, mem_ctx, pkt, NULL); } switch (c->security_state.auth_info->auth_level) { @@ -338,16 +334,16 @@ static NTSTATUS ncacn_push_request_sign(struct dcerpc_connection *c, case DCERPC_AUTH_LEVEL_CONNECT: /* TODO: let the gensec mech decide if it wants to generate a signature */ - return ncacn_push_auth(blob, mem_ctx, c->iconv_convenience, pkt, NULL); + return ncacn_push_auth(blob, mem_ctx, pkt, NULL); case DCERPC_AUTH_LEVEL_NONE: - return ncacn_push_auth(blob, mem_ctx, c->iconv_convenience, pkt, NULL); + return ncacn_push_auth(blob, mem_ctx, pkt, NULL); default: return NT_STATUS_INVALID_LEVEL; } - ndr = ndr_push_init_ctx(mem_ctx, c->iconv_convenience); + ndr = ndr_push_init_ctx(mem_ctx); if (!ndr) { return NT_STATUS_NO_MEMORY; } @@ -718,7 +714,7 @@ struct composite_context *dcerpc_bind_send(struct dcerpc_pipe *p, pkt.u.bind.auth_info = data_blob(NULL, 0); /* construct the NDR form of the packet */ - c->status = ncacn_push_auth(&blob, c, p->conn->iconv_convenience, &pkt, + c->status = ncacn_push_auth(&blob, c, &pkt, p->conn->security_state.auth_info); if (!composite_is_ok(c)) return c; @@ -789,7 +785,6 @@ NTSTATUS dcerpc_auth3(struct dcerpc_pipe *p, /* construct the NDR form of the packet */ status = ncacn_push_auth(&blob, mem_ctx, - p->conn->iconv_convenience, &pkt, p->conn->security_state.auth_info); if (!NT_STATUS_IS_OK(status)) { @@ -1049,7 +1044,7 @@ static void dcerpc_ship_next_request(struct dcerpc_connection *c) if (req->object) { pkt.u.request.object.object = *req->object; pkt.pfc_flags |= DCERPC_PFC_FLAG_OBJECT_UUID; - chunk_size -= ndr_size_GUID(req->object,NULL,0); + chunk_size -= ndr_size_GUID(req->object,0); } /* we send a series of pdus without waiting for a reply */ @@ -1202,7 +1197,7 @@ static NTSTATUS dcerpc_ndr_validate_in(struct dcerpc_connection *c, return ndr_map_error2ntstatus(ndr_err); } - push = ndr_push_init_ctx(mem_ctx, c->iconv_convenience); + push = ndr_push_init_ctx(mem_ctx); if (!push) { return NT_STATUS_NO_MEMORY; } @@ -1260,7 +1255,7 @@ static NTSTATUS dcerpc_ndr_validate_out(struct dcerpc_connection *c, } memcpy(st, struct_ptr, struct_size); - push = ndr_push_init_ctx(mem_ctx, c->iconv_convenience); + push = ndr_push_init_ctx(mem_ctx); if (!push) { return NT_STATUS_NO_MEMORY; } @@ -1291,7 +1286,7 @@ static NTSTATUS dcerpc_ndr_validate_out(struct dcerpc_connection *c, return ndr_map_error2ntstatus(ndr_err); } - push = ndr_push_init_ctx(mem_ctx, c->iconv_convenience); + push = ndr_push_init_ctx(mem_ctx); if (!push) { return NT_STATUS_NO_MEMORY; } @@ -1363,7 +1358,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, p->conn->iconv_convenience); + push = ndr_push_init_ctx(mem_ctx); if (!push) { return NULL; } @@ -1666,7 +1661,7 @@ struct composite_context *dcerpc_alter_context_send(struct dcerpc_pipe *p, pkt.u.alter.auth_info = data_blob(NULL, 0); /* construct the NDR form of the packet */ - c->status = ncacn_push_auth(&blob, mem_ctx, p->conn->iconv_convenience, &pkt, + c->status = ncacn_push_auth(&blob, mem_ctx, &pkt, p->conn->security_state.auth_info); if (!composite_is_ok(c)) return c; diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h index 69de8c5467..b1875045bd 100644 --- a/source4/librpc/rpc/dcerpc.h +++ b/source4/librpc/rpc/dcerpc.h @@ -64,7 +64,6 @@ struct dcerpc_connection { struct dcerpc_security security_state; const char *binding_string; struct tevent_context *event_ctx; - struct smb_iconv_convenience *iconv_convenience; /** Directory in which to save ndrdump-parseable files */ const char *packet_log_dir; @@ -271,8 +270,7 @@ struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, void *r); const char *dcerpc_server_name(struct dcerpc_pipe *p); -struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct smb_iconv_convenience *ic); +struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev); NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p, struct smbcli_tree *tree, const char *pipe_name); diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 1b1f039004..bd371be2d3 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -121,7 +121,6 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT conn->in.service_type = NULL; conn->in.workgroup = lp_workgroup(lp_ctx); conn->in.gensec_settings = lp_gensec_settings(conn, lp_ctx); - conn->in.iconv_convenience = lp_iconv_convenience(lp_ctx); lp_smbcli_options(lp_ctx, &conn->in.options); lp_smbcli_session_options(lp_ctx, &conn->in.session_options); @@ -743,7 +742,7 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent c->private_data = s; /* initialise dcerpc pipe structure */ - s->pipe = dcerpc_pipe_init(c, ev, lp_iconv_convenience(lp_ctx)); + s->pipe = dcerpc_pipe_init(c, ev); if (composite_nomem(s->pipe, c)) return c; if (DEBUGLEVEL >= 10) diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c index 1d76c65f40..5f355a5937 100644 --- a/source4/librpc/rpc/dcerpc_secondary.c +++ b/source4/librpc/rpc/dcerpc_secondary.c @@ -73,7 +73,7 @@ _PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerp s->binding = b; /* initialise second dcerpc pipe based on primary pipe's event context */ - s->pipe2 = dcerpc_pipe_init(c, s->pipe->conn->event_ctx, s->pipe->conn->iconv_convenience); + s->pipe2 = dcerpc_pipe_init(c, s->pipe->conn->event_ctx); if (composite_nomem(s->pipe2, c)) return c; if (DEBUGLEVEL >= 10) diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index b71e3060e1..5873e9dd95 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -51,14 +51,13 @@ const struct ndr_interface_call *dcerpc_iface_find_call(const struct ndr_interfa push a ncacn_packet into a blob, potentially with auth info */ NTSTATUS ncacn_push_auth(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct ncacn_packet *pkt, struct dcerpc_auth *auth_info) { struct ndr_push *ndr; enum ndr_err_code ndr_err; - ndr = ndr_push_init_ctx(mem_ctx, iconv_convenience); + ndr = ndr_push_init_ctx(mem_ctx); if (!ndr) { return NT_STATUS_NO_MEMORY; } @@ -827,7 +826,7 @@ NTSTATUS dcerpc_pull_auth_trailer(struct ncacn_packet *pkt, *auth_length = pkt_auth_blob->length - pad; - ndr = ndr_pull_init_blob(pkt_auth_blob, mem_ctx, NULL); + ndr = ndr_pull_init_blob(pkt_auth_blob, mem_ctx); if (!ndr) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/nbt_server/dgram/request.c b/source4/nbt_server/dgram/request.c index 277b64741d..4a3bd13368 100644 --- a/source4/nbt_server/dgram/request.c +++ b/source4/nbt_server/dgram/request.c @@ -75,9 +75,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address if (strcmp("0.0.0.0", iface->netmask) != 0) { /* listen for broadcasts on port 138 */ - bcast_dgmsock = nbt_dgram_socket_init(iface, - nbtsrv->task->event_ctx, - lp_iconv_convenience(nbtsrv->task->lp_ctx)); + bcast_dgmsock = nbt_dgram_socket_init(iface, nbtsrv->task->event_ctx); if (!bcast_dgmsock) { talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; @@ -104,8 +102,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address } /* listen for unicasts on port 138 */ - iface->dgmsock = nbt_dgram_socket_init(iface, nbtsrv->task->event_ctx, - lp_iconv_convenience(nbtsrv->task->lp_ctx)); + iface->dgmsock = nbt_dgram_socket_init(iface, nbtsrv->task->event_ctx); if (!iface->dgmsock) { talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 99c5886fd9..19639dd167 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -186,7 +186,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, struct nbt_name_socket *bcast_nbtsock; /* listen for broadcasts on port 137 */ - bcast_nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx, lp_iconv_convenience(nbtsrv->task->lp_ctx)); + bcast_nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx); if (!bcast_nbtsock) { talloc_free(iface); return NT_STATUS_NO_MEMORY; @@ -212,8 +212,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, } /* listen for unicasts on port 137 */ - iface->nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx, - lp_iconv_convenience(nbtsrv->task->lp_ctx)); + iface->nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx); if (!iface->nbtsock) { talloc_free(iface); return NT_STATUS_NO_MEMORY; diff --git a/source4/ntp_signd/ntp_signd.c b/source4/ntp_signd/ntp_signd.c index cc135397bb..6a628e491a 100644 --- a/source4/ntp_signd/ntp_signd.c +++ b/source4/ntp_signd/ntp_signd.c @@ -80,9 +80,7 @@ static NTSTATUS signing_failure(struct ntp_signd_connection *ntp_signdconn, signed_reply.packet_id = packet_id; signed_reply.signed_packet = data_blob(NULL, 0); - ndr_err = ndr_push_struct_blob(output, mem_ctx, - lp_iconv_convenience(ntp_signdconn->ntp_signd->task->lp_ctx), - &signed_reply, + ndr_err = ndr_push_struct_blob(output, mem_ctx, &signed_reply, (ndr_push_flags_fn_t)ndr_push_signed_reply); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -114,7 +112,6 @@ static NTSTATUS ntp_signd_process(struct ntp_signd_connection *ntp_signd_conn, int ret; ndr_err = ndr_pull_struct_blob_all(input, mem_ctx, - lp_iconv_convenience(ntp_signd_conn->ntp_signd->task->lp_ctx), &sign_request, (ndr_pull_flags_fn_t)ndr_pull_sign_request); @@ -244,9 +241,7 @@ static NTSTATUS ntp_signd_process(struct ntp_signd_connection *ntp_signd_conn, /* Place it into the packet for the wire */ - ndr_err = ndr_push_struct_blob(output, mem_ctx, - lp_iconv_convenience(ntp_signd_conn->ntp_signd->task->lp_ctx), - &signed_reply, + ndr_err = ndr_push_struct_blob(output, mem_ctx, &signed_reply, (ndr_push_flags_fn_t)ndr_push_signed_reply); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c index 32d1332cce..ef456f05df 100644 --- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c +++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c @@ -180,7 +180,7 @@ static WERROR sptr_PrintServerData(struct ntptr_GenericHandle *server, os.build = server_info->version_build; os.extra_string = ""; - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, lp_iconv_convenience(server->ntptr->lp_ctx), &os, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion); + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &os, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_GENERAL_FAILURE; } @@ -203,7 +203,7 @@ static WERROR sptr_PrintServerData(struct ntptr_GenericHandle *server, os_ex.product_type = 0; os_ex.reserved = 0; - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, lp_iconv_convenience(server->ntptr->lp_ctx), &os_ex, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx); + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &os_ex, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_GENERAL_FAILURE; } @@ -240,7 +240,7 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC return result; } - ndr_err = ndr_push_union_blob(&blob, mem_ctx, lp_iconv_convenience(server->ntptr->lp_ctx), + ndr_err = ndr_push_union_blob(&blob, mem_ctx, &data, *r->out.type, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_GENERAL_FAILURE; diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index 7c6615e3a6..fdf3aeb305 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -46,7 +46,6 @@ struct notify_context { struct notify_array *array; int seqnum; struct sys_notify_context *sys_notify_ctx; - struct smb_iconv_convenience *iconv_convenience; }; @@ -113,7 +112,6 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, notify->messaging_ctx = messaging_ctx; notify->list = NULL; notify->array = NULL; - notify->iconv_convenience = lp_iconv_convenience(lp_ctx); notify->seqnum = tdb_get_seqnum(notify->w->tdb); talloc_set_destructor(notify, notify_destructor); @@ -178,8 +176,7 @@ static NTSTATUS notify_load(struct notify_context *notify) blob.data = dbuf.dptr; blob.length = dbuf.dsize; - ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->iconv_convenience, - notify->array, + ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->array, (ndr_pull_flags_fn_t)ndr_pull_notify_array); free(dbuf.dptr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -227,7 +224,7 @@ static NTSTATUS notify_save(struct notify_context *notify) tmp_ctx = talloc_new(notify); NT_STATUS_HAVE_NO_MEMORY(tmp_ctx); - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->iconv_convenience, notify->array, + ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->array, (ndr_push_flags_fn_t)ndr_push_notify_array); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -263,7 +260,7 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data return; } - ndr_err = ndr_pull_struct_blob(data, tmp_ctx, notify->iconv_convenience, &ev, + ndr_err = ndr_pull_struct_blob(data, tmp_ctx, &ev, (ndr_pull_flags_fn_t)ndr_pull_notify_event); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); @@ -560,7 +557,7 @@ static void notify_send(struct notify_context *notify, struct notify_entry *e, tmp_ctx = talloc_new(notify); - ndr_err = ndr_push_struct_blob(&data, tmp_ctx, notify->iconv_convenience, &ev, (ndr_push_flags_fn_t)ndr_push_notify_event); + ndr_err = ndr_push_struct_blob(&data, tmp_ctx, &ev, (ndr_push_flags_fn_t)ndr_push_notify_event); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(tmp_ctx); return; diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c index 8f5d10f902..944ec86631 100644 --- a/source4/ntvfs/common/opendb_tdb.c +++ b/source4/ntvfs/common/opendb_tdb.c @@ -246,7 +246,7 @@ static NTSTATUS odb_pull_record(struct odb_lock *lck, struct opendb_file *file) blob.data = dbuf.dptr; blob.length = dbuf.dsize; - ndr_err = ndr_pull_struct_blob(&blob, lck, lp_iconv_convenience(lck->odb->ntvfs_ctx->lp_ctx), file, (ndr_pull_flags_fn_t)ndr_pull_opendb_file); + ndr_err = ndr_pull_struct_blob(&blob, lck, file, (ndr_pull_flags_fn_t)ndr_pull_opendb_file); free(dbuf.dptr); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); @@ -274,7 +274,7 @@ static NTSTATUS odb_push_record(struct odb_lock *lck, struct opendb_file *file) return NT_STATUS_OK; } - ndr_err = ndr_push_struct_blob(&blob, lck, lp_iconv_convenience(lck->odb->ntvfs_ctx->lp_ctx), file, (ndr_push_flags_fn_t)ndr_push_opendb_file); + ndr_err = ndr_push_struct_blob(&blob, lck, file, (ndr_push_flags_fn_t)ndr_push_opendb_file); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c index a40fb54e9a..259dcccb71 100644 --- a/source4/ntvfs/ipc/ipc_rap.c +++ b/source4/ntvfs/ipc/ipc_rap.c @@ -124,10 +124,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, lp_iconv_convenience(lp_ctx)); + call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx); call->ndr_pull_param->flags = RAPNDR_FLAGS; - call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx, lp_iconv_convenience(lp_ctx)); + call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx); call->ndr_pull_data->flags = RAPNDR_FLAGS; call->heap = talloc(mem_ctx, struct rap_string_heap); @@ -454,8 +454,8 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct tevent_context *event_ctx, str NDR_RETURN(ndr_pull_string(call->ndr_pull_param, NDR_SCALARS, &call->datadesc)); - call->ndr_push_param = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx)); - call->ndr_push_data = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx)); + call->ndr_push_param = ndr_push_init_ctx(call); + call->ndr_push_data = ndr_push_init_ctx(call); if ((call->ndr_push_param == NULL) || (call->ndr_push_data == NULL)) return NT_STATUS_NO_MEMORY; @@ -480,8 +480,8 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct tevent_context *event_ctx, str result_param = ndr_push_blob(call->ndr_push_param); result_data = ndr_push_blob(call->ndr_push_data); - final_param = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx)); - final_data = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx)); + final_param = ndr_push_init_ctx(call); + final_data = ndr_push_init_ctx(call); if ((final_param == NULL) || (final_data == NULL)) return NT_STATUS_NO_MEMORY; diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 8c9e8e91ce..1455424abe 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -244,8 +244,6 @@ static NTSTATUS ipc_open(struct ntvfs_module_context *ntvfs, struct pipe_state *p; struct ipc_private *ipriv = talloc_get_type_abort(ntvfs->private_data, struct ipc_private); - struct smb_iconv_convenience *smb_ic - = lp_iconv_convenience(ipriv->ntvfs->ctx->lp_ctx); struct ntvfs_handle *h; struct ipc_open_state *state; struct tevent_req *subreq; @@ -352,7 +350,6 @@ skip: subreq = tstream_npa_connect_send(p, ipriv->ntvfs->ctx->event_ctx, - smb_ic, directory, fname, client_addr, diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index e4448d3442..5296811f02 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -95,7 +95,6 @@ NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, resolve a wildcard rename pattern. This works on one component of the name */ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *fname, const char *pattern) { @@ -115,16 +114,16 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, while (*p2) { codepoint_t c1, c2; size_t c_size1, c_size2; - c1 = next_codepoint_convenience(iconv_convenience, p1, &c_size1); - c2 = next_codepoint_convenience(iconv_convenience, p2, &c_size2); + c1 = next_codepoint(p1, &c_size1); + c2 = next_codepoint(p2, &c_size2); if (c2 == '?') { - d += push_codepoint_convenience(iconv_convenience, d, c1); + d += push_codepoint(d, c1); } else if (c2 == '*') { memcpy(d, p1, strlen(p1)); d += strlen(p1); break; } else { - d += push_codepoint_convenience(iconv_convenience, d, c2); + d += push_codepoint(d, c2); } p1 += c_size1; @@ -142,7 +141,6 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, resolve a wildcard rename pattern. */ static const char *pvfs_resolve_wildcard(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *fname, const char *pattern) { @@ -175,8 +173,8 @@ static const char *pvfs_resolve_wildcard(TALLOC_CTX *mem_ctx, return NULL; } - base1 = pvfs_resolve_wildcard_component(mem_ctx, iconv_convenience, base1, base2); - ext1 = pvfs_resolve_wildcard_component(mem_ctx, iconv_convenience, ext1, ext2); + base1 = pvfs_resolve_wildcard_component(mem_ctx, base1, base2); + ext1 = pvfs_resolve_wildcard_component(mem_ctx, ext1, ext2); if (base1 == NULL || ext1 == NULL) { return NULL; } @@ -283,7 +281,7 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs, NTSTATUS status; /* resolve the wildcard pattern for this name */ - fname2 = pvfs_resolve_wildcard(mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), fname1, fname2); + fname2 = pvfs_resolve_wildcard(mem_ctx, fname1, fname2); if (fname2 == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index 9613b7078a..0da64a790d 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -186,8 +186,7 @@ static NTSTATUS pvfs_case_search(struct pvfs_state *pvfs, /* parse a alternate data stream name */ -static NTSTATUS parse_stream_name(struct smb_iconv_convenience *ic, - struct pvfs_filename *name, +static NTSTATUS parse_stream_name(struct pvfs_filename *name, const char *s) { char *p, *stream_name; @@ -203,7 +202,7 @@ static NTSTATUS parse_stream_name(struct smb_iconv_convenience *ic, while (*p) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ic, p, &c_size); + codepoint_t c = next_codepoint(p, &c_size); switch (c) { case '/': @@ -259,7 +258,6 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, unsigned int flags, struct pvfs_filename *name) { char *ret, *p, *p_start; - struct smb_iconv_convenience *ic = NULL; NTSTATUS status; name->original_name = talloc_strdup(name, cifs_name); @@ -300,10 +298,9 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, for legal characters */ p_start = p; - ic = lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx); while (*p) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ic, p, &c_size); + codepoint_t c = next_codepoint(p, &c_size); if (c <= 0x1F) { return NT_STATUS_OBJECT_NAME_INVALID; @@ -336,7 +333,7 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, if (name->has_wildcard) { return NT_STATUS_OBJECT_NAME_INVALID; } - status = parse_stream_name(ic, name, p); + status = parse_stream_name(name, p); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -388,7 +385,6 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, return NULL if it can't be reduced */ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char **fname, unsigned int flags) { codepoint_t c; @@ -401,7 +397,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, if (s == NULL) return NT_STATUS_NO_MEMORY; for (num_components=1, p=s; *p; p += c_size) { - c = next_codepoint_convenience(iconv_convenience, p, &c_size); + c = next_codepoint(p, &c_size); if (c == '\\') num_components++; } @@ -413,7 +409,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, components[0] = s; for (i=0, p=s; *p; p += c_size) { - c = next_codepoint_convenience(iconv_convenience, p, &c_size); + c = next_codepoint(p, &c_size); if (c == '\\') { *p = 0; components[++i] = p+1; @@ -539,7 +535,7 @@ NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs, if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) { /* it might contain .. components which need to be reduced */ - status = pvfs_reduce_name(*name, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), &cifs_name, flags); + status = pvfs_reduce_name(*name, &cifs_name, flags); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index 530def9163..fc1cad1894 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -104,8 +104,6 @@ struct pvfs_mangle_context { /* this is used to reverse the base 36 mapping */ unsigned char base_reverse[256]; - - struct smb_iconv_convenience *iconv_convenience; }; @@ -390,7 +388,7 @@ static bool is_legal_name(struct pvfs_mangle_context *ctx, const char *name) { while (*name) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ctx->iconv_convenience, name, &c_size); + codepoint_t c = next_codepoint(name, &c_size); if (c == INVALID_CODEPOINT) { return false; } @@ -615,8 +613,6 @@ NTSTATUS pvfs_mangle_init(struct pvfs_state *pvfs) return NT_STATUS_NO_MEMORY; } - ctx->iconv_convenience = lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx); - /* by default have a max of 512 entries in the cache. */ ctx->cache_size = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512); diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c index 1ca09402a3..1eb7c31868 100644 --- a/source4/ntvfs/posix/pvfs_xattr.c +++ b/source4/ntvfs/posix/pvfs_xattr.c @@ -117,8 +117,8 @@ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs, } /* pull the blob */ - ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), - p, (ndr_pull_flags_fn_t)pull_fn); + ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, p, + (ndr_pull_flags_fn_t)pull_fn); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } @@ -140,7 +140,7 @@ NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs, NTSTATUS status; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), p, (ndr_push_flags_fn_t)push_fn); + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, p, (ndr_push_flags_fn_t)push_fn); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(mem_ctx); return ndr_map_error2ntstatus(ndr_err); diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index a9ce470e92..1264106a60 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -520,6 +520,7 @@ struct loadparm_context { struct loadparm_global *globals; struct loadparm_service **services; struct loadparm_service *sDefault; + struct smb_iconv_convenience *iconv_convenience; int iNumServices; struct loadparm_service *currentService; bool bInGlobalSection; @@ -530,7 +531,6 @@ struct loadparm_context { time_t modtime; } *file_lists; unsigned int flags[NUMPARAMETERS]; - struct smb_iconv_convenience *iconv_convenience; }; @@ -2782,7 +2782,6 @@ struct gensec_settings *lp_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_ return NULL; SMB_ASSERT(lp_ctx != NULL); settings->lp_ctx = talloc_reference(settings, lp_ctx); - settings->iconv_convenience = lp_iconv_convenience(lp_ctx); settings->target_hostname = lp_parm_string(lp_ctx, NULL, "gensec", "target_hostname"); return settings; } diff --git a/source4/param/secrets.c b/source4/param/secrets.c index 2962bcdc1f..47a3f6b842 100644 --- a/source4/param/secrets.c +++ b/source4/param/secrets.c @@ -182,7 +182,7 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, return NULL; } - ndr_err = ndr_pull_struct_blob(v, result, NULL, result, + ndr_err = ndr_pull_struct_blob(v, result, result, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { *errstring = talloc_asprintf(mem_ctx, "Failed to parse SID on record for %s in %s", diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 0b0e3f22b6..774309996d 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -486,7 +486,7 @@ static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32_t fault_code return NT_STATUS_NO_MEMORY; } - status = ncacn_push_auth(&rep->blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx), &pkt, NULL); + status = ncacn_push_auth(&rep->blob, call, &pkt, NULL); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -531,7 +531,7 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason) return NT_STATUS_NO_MEMORY; } - status = ncacn_push_auth(&rep->blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx), &pkt, NULL); + status = ncacn_push_auth(&rep->blob, call, &pkt, NULL); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -732,7 +732,8 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) return NT_STATUS_NO_MEMORY; } - status = ncacn_push_auth(&rep->blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx), &pkt, call->conn->auth_state.auth_info); + status = ncacn_push_auth(&rep->blob, call, &pkt, + call->conn->auth_state.auth_info); if (!NT_STATUS_IS_OK(status)) { talloc_free(call->context); call->context = NULL; @@ -923,7 +924,7 @@ static NTSTATUS dcesrv_alter(struct dcesrv_call_state *call) return NT_STATUS_NO_MEMORY; } - status = ncacn_push_auth(&rep->blob, call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx), &pkt, call->conn->auth_state.auth_info); + status = ncacn_push_auth(&rep->blob, call, &pkt, call->conn->auth_state.auth_info); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -962,8 +963,7 @@ 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, - lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); + pull = ndr_pull_init_blob(&call->pkt.u.request.stub_and_verifier, call); NT_STATUS_HAVE_NO_MEMORY(pull); pull->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -1023,7 +1023,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call) } /* form the reply NDR */ - push = ndr_push_init_ctx(call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); + push = ndr_push_init_ctx(call); NT_STATUS_HAVE_NO_MEMORY(push); /* carry over the pointer count to the reply in case we are diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 59d8be3e24..4915c3ccbc 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -383,7 +383,7 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, /* non-signed packets are simple */ if (sig_size == 0) { - status = ncacn_push_auth(blob, call, lp_iconv_convenience(dce_conn->dce_ctx->lp_ctx), pkt, NULL); + status = ncacn_push_auth(blob, call, pkt, NULL); return NT_STATUS_IS_OK(status); } @@ -397,18 +397,18 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, * TODO: let the gensec mech decide if it wants to generate a signature * that might be needed for schannel... */ - status = ncacn_push_auth(blob, call, lp_iconv_convenience(dce_conn->dce_ctx->lp_ctx), pkt, NULL); + status = ncacn_push_auth(blob, call, pkt, NULL); return NT_STATUS_IS_OK(status); case DCERPC_AUTH_LEVEL_NONE: - status = ncacn_push_auth(blob, call, lp_iconv_convenience(dce_conn->dce_ctx->lp_ctx), pkt, NULL); + status = ncacn_push_auth(blob, call, pkt, NULL); return NT_STATUS_IS_OK(status); default: return false; } - ndr = ndr_push_init_ctx(call, lp_iconv_convenience(dce_conn->dce_ctx->lp_ctx)); + ndr = ndr_push_init_ctx(call); if (!ndr) { return false; } diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c index 354ebf0f85..a9bb1c0b4e 100644 --- a/source4/rpc_server/drsuapi/getncchanges.c +++ b/source4/rpc_server/drsuapi/getncchanges.c @@ -136,8 +136,7 @@ static WERROR get_nc_changes_build_object(struct drsuapi_DsReplicaObjectListItem return WERR_OK; } - ndr_err = ndr_pull_struct_blob(md_value, obj, - lp_iconv_convenience(ldb_get_opaque(sam_ctx, "loadparm")), &md, + ndr_err = ndr_pull_struct_blob(md_value, obj, &md, (ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_DS_DRA_INTERNAL_ERROR; diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 8ab3cbfe6b..2483d680e0 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -749,7 +749,6 @@ static NTSTATUS get_trustdom_auth_blob(struct dcesrv_call_state *dce_call, arcfour_crypt_blob(auth_blob->data, auth_blob->length, &session_key); ndr_err = ndr_pull_struct_blob(auth_blob, mem_ctx, - lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), auth_struct, (ndr_pull_flags_fn_t)ndr_pull_trustDomainPasswords); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -797,7 +796,6 @@ static NTSTATUS get_trustauth_inout_blob(struct dcesrv_call_state *dce_call, ioblob.previous->array[i].AuthType = 0; } ndr_err = ndr_push_struct_blob(trustauth_blob, mem_ctx, - lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), &ioblob, (ndr_push_flags_fn_t)ndr_push_trustAuthInOutBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -3920,7 +3918,6 @@ static int dns_cmp(const char *s1, size_t l1, /* decode all TDOs forest trust info blobs */ static NTSTATUS get_ft_info(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct ldb_message *msg, struct ForestTrustInfo *info) { @@ -3932,8 +3929,7 @@ static NTSTATUS get_ft_info(TALLOC_CTX *mem_ctx, return NT_STATUS_OBJECT_NAME_NOT_FOUND; } /* ldb_val is equivalent to DATA_BLOB */ - ndr_err = ndr_pull_struct_blob_all(ft_blob, mem_ctx, ic, - info, + ndr_err = ndr_pull_struct_blob_all(ft_blob, mem_ctx, info, (ndr_pull_flags_fn_t)ndr_pull_ForestTrustInfo); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NT_STATUS_INVALID_DOMAIN_STATE; @@ -4242,8 +4238,6 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat { struct dcesrv_handle *h; struct lsa_policy_state *p_state; - struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx; - struct smb_iconv_convenience *ic = lp_iconv_convenience(lp_ctx); const char *trust_attrs[] = { "trustPartner", "trustAttributes", "msDS-TrustForestTrustInfo", NULL }; struct ldb_message **dom_res = NULL; @@ -4356,7 +4350,7 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat return NT_STATUS_NO_MEMORY; } - nt_status = get_ft_info(mem_ctx, ic, dom_res[i], fti); + nt_status = get_ft_info(mem_ctx, dom_res[i], fti); if (!NT_STATUS_IS_OK(nt_status)) { if (NT_STATUS_EQUAL(nt_status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { @@ -4385,8 +4379,7 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat /* not just a check, write info back */ - ndr_err = ndr_push_struct_blob(&ft_blob, mem_ctx, ic, - nfti, + ndr_err = ndr_push_struct_blob(&ft_blob, mem_ctx, nfti, (ndr_push_flags_fn_t)ndr_push_ForestTrustInfo); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NT_STATUS_INVALID_PARAMETER; diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 3842429b8e..011341641a 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -249,7 +249,6 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca creds->sid = samdb_result_dom_sid(creds, msgs[0], "objectSid"); nt_status = schannel_save_creds_state(mem_ctx, - lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), creds); @@ -362,7 +361,6 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(struct dcesrv_call_state *dc } nt_status = schannel_check_creds_state(mem_ctx, - lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), computer_name, received_authenticator, @@ -714,7 +712,6 @@ static NTSTATUS dcesrv_netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call, struct netlogon_creds_CredentialState *creds; nt_status = schannel_get_creds_state(mem_ctx, - lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx), lp_private_dir(dce_call->conn->dce_ctx->lp_ctx), r->in.computer_name, &creds); if (!NT_STATUS_IS_OK(nt_status)) { diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index 6f4df00f9d..05e45d8529 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -135,7 +135,6 @@ static void dcesrv_sock_reply_done(struct tevent_req *subreq) struct dcerpc_read_ncacn_packet_state { struct { - struct smb_iconv_convenience *smb_iconv_c; } caller; DATA_BLOB buffer; struct ncacn_packet *pkt; @@ -150,8 +149,7 @@ static void dcerpc_read_ncacn_packet_done(struct tevent_req *subreq); static struct tevent_req *dcerpc_read_ncacn_packet_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct tstream_context *stream, - struct smb_iconv_convenience *ic) + struct tstream_context *stream) { struct tevent_req *req; struct dcerpc_read_ncacn_packet_state *state; @@ -163,7 +161,6 @@ static struct tevent_req *dcerpc_read_ncacn_packet_send(TALLOC_CTX *mem_ctx, return NULL; } - state->caller.smb_iconv_c = ic; state->buffer = data_blob_const(NULL, 0); state->pkt = talloc(state, struct ncacn_packet); if (tevent_req_nomem(state->pkt, req)) { @@ -260,9 +257,7 @@ static void dcerpc_read_ncacn_packet_done(struct tevent_req *subreq) return; } - ndr = ndr_pull_init_blob(&state->buffer, - state->pkt, - state->caller.smb_iconv_c); + ndr = ndr_pull_init_blob(&state->buffer, state->pkt); if (tevent_req_nomem(ndr, req)) { return; } @@ -392,8 +387,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn) subreq = dcerpc_read_ncacn_packet_send(dcesrv_conn, dcesrv_conn->event_ctx, - dcesrv_conn->stream, - lp_iconv_convenience(lp_ctx)); + dcesrv_conn->stream); if (!subreq) { status = NT_STATUS_NO_MEMORY; DEBUG(0,("dcesrv_sock_accept: dcerpc_read_fragment_buffer_send(%s)\n", @@ -413,7 +407,6 @@ static void dcesrv_read_fragment_done(struct tevent_req *subreq) struct ncacn_packet *pkt; DATA_BLOB buffer; NTSTATUS status; - struct loadparm_context *lp_ctx = dce_conn->dce_ctx->lp_ctx; status = dcerpc_read_ncacn_packet_recv(subreq, dce_conn, &pkt, &buffer); @@ -431,8 +424,7 @@ static void dcesrv_read_fragment_done(struct tevent_req *subreq) subreq = dcerpc_read_ncacn_packet_send(dce_conn, dce_conn->event_ctx, - dce_conn->stream, - lp_iconv_convenience(lp_ctx)); + dce_conn->stream); if (!subreq) { status = NT_STATUS_NO_MEMORY; dcesrv_terminate_connection(dce_conn, nt_errstr(status)); diff --git a/source4/rpc_server/spoolss/dcesrv_spoolss.c b/source4/rpc_server/spoolss/dcesrv_spoolss.c index 0fe8e0eb9b..f6212da250 100644 --- a/source4/rpc_server/spoolss/dcesrv_spoolss.c +++ b/source4/rpc_server/spoolss/dcesrv_spoolss.c @@ -33,11 +33,11 @@ enum spoolss_handle { SPOOLSS_NOTIFY }; -#define SPOOLSS_BUFFER_UNION(fn,ic,info,level) \ - ((info)?ndr_size_##fn(info, level, ic, 0):0) +#define SPOOLSS_BUFFER_UNION(fn,info,level) \ + ((info)?ndr_size_##fn(info, level, 0):0) -#define SPOOLSS_BUFFER_UNION_ARRAY(fn,ic,info,level,count) \ - ((info)?ndr_size_##fn##_info(dce_call, ic, level, count, info):0) +#define SPOOLSS_BUFFER_UNION_ARRAY(fn,info,level,count) \ + ((info)?ndr_size_##fn##_info(dce_call, level, count, info):0) #define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >= *r->out.needed)?val_true:val_false) @@ -238,7 +238,6 @@ static WERROR dcesrv_spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TA { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.server); W_ERROR_NOT_OK_RETURN(status); @@ -246,7 +245,7 @@ static WERROR dcesrv_spoolss_EnumPrinters(struct dcesrv_call_state *dce_call, TA status = ntptr_EnumPrinters(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, ic, *r->out.info, r->in.level, *r->out.count); + *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinters, *r->out.info, r->in.level, *r->out.count); *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL); *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); @@ -374,7 +373,6 @@ static WERROR dcesrv_spoolss_EnumPrinterDrivers(struct dcesrv_call_state *dce_ca { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.server); W_ERROR_NOT_OK_RETURN(status); @@ -382,7 +380,7 @@ static WERROR dcesrv_spoolss_EnumPrinterDrivers(struct dcesrv_call_state *dce_ca status = ntptr_EnumPrinterDrivers(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, ic, *r->out.info, r->in.level, *r->out.count); + *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPrinterDrivers, *r->out.info, r->in.level, *r->out.count); *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL); *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); @@ -407,7 +405,6 @@ static WERROR dcesrv_spoolss_GetPrinterDriverDirectory(struct dcesrv_call_state { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.server); W_ERROR_NOT_OK_RETURN(status); @@ -415,7 +412,7 @@ static WERROR dcesrv_spoolss_GetPrinterDriverDirectory(struct dcesrv_call_state status = ntptr_GetPrinterDriverDirectory(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, ic, r->out.info, r->in.level); + *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_DriverDirectoryInfo, r->out.info, r->in.level); r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); } @@ -459,7 +456,6 @@ static WERROR dcesrv_spoolss_GetPrintProcessorDirectory(struct dcesrv_call_state { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.server); W_ERROR_NOT_OK_RETURN(status); @@ -467,7 +463,7 @@ static WERROR dcesrv_spoolss_GetPrintProcessorDirectory(struct dcesrv_call_state status = ntptr_GetPrintProcessorDirectory(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrintProcessorDirectoryInfo, ic, r->out.info, r->in.level); + *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrintProcessorDirectoryInfo, r->out.info, r->in.level); r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); } @@ -721,7 +717,6 @@ static WERROR dcesrv_spoolss_GetForm(struct dcesrv_call_state *dce_call, TALLOC_ struct ntptr_GenericHandle *handle; struct dcesrv_handle *h; WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx); DCESRV_PULL_HANDLE_WERR(h, r->in.handle, DCESRV_HANDLE_ANY); handle = talloc_get_type(h->data, struct ntptr_GenericHandle); @@ -742,7 +737,7 @@ static WERROR dcesrv_spoolss_GetForm(struct dcesrv_call_state *dce_call, TALLOC_ return WERR_FOOBAR; } - *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_FormInfo, ic, r->out.info, r->in.level); + *r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_FormInfo, r->out.info, r->in.level); r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); } @@ -789,7 +784,6 @@ static WERROR dcesrv_spoolss_EnumForms(struct dcesrv_call_state *dce_call, TALLO struct ntptr_GenericHandle *handle; struct dcesrv_handle *h; WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx); DCESRV_PULL_HANDLE_WERR(h, r->in.handle, DCESRV_HANDLE_ANY); handle = talloc_get_type(h->data, struct ntptr_GenericHandle); @@ -809,7 +803,7 @@ static WERROR dcesrv_spoolss_EnumForms(struct dcesrv_call_state *dce_call, TALLO return WERR_FOOBAR; } - *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, ic, *r->out.info, r->in.level, *r->out.count); + *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumForms, *r->out.info, r->in.level, *r->out.count); *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL); *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); @@ -824,7 +818,6 @@ static WERROR dcesrv_spoolss_EnumPorts(struct dcesrv_call_state *dce_call, TALLO { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.servername); W_ERROR_NOT_OK_RETURN(status); @@ -832,7 +825,7 @@ static WERROR dcesrv_spoolss_EnumPorts(struct dcesrv_call_state *dce_call, TALLO status = ntptr_EnumPorts(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, ic, *r->out.info, r->in.level, *r->out.count); + *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumPorts, *r->out.info, r->in.level, *r->out.count); *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL); *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); @@ -847,7 +840,6 @@ static WERROR dcesrv_spoolss_EnumMonitors(struct dcesrv_call_state *dce_call, TA { struct ntptr_context *ntptr = talloc_get_type(dce_call->context->private_data, struct ntptr_context); WERROR status; - struct smb_iconv_convenience *ic = lp_iconv_convenience(ntptr->lp_ctx); status = dcesrv_spoolss_check_server_name(dce_call, mem_ctx, r->in.servername); W_ERROR_NOT_OK_RETURN(status); @@ -855,7 +847,7 @@ static WERROR dcesrv_spoolss_EnumMonitors(struct dcesrv_call_state *dce_call, TA status = ntptr_EnumMonitors(ntptr, mem_ctx, r); W_ERROR_NOT_OK_RETURN(status); - *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, ic, *r->out.info, r->in.level, *r->out.count); + *r->out.needed = SPOOLSS_BUFFER_UNION_ARRAY(spoolss_EnumMonitors, *r->out.info, r->in.level, *r->out.count); *r->out.info = SPOOLSS_BUFFER_OK(*r->out.info, NULL); *r->out.count = SPOOLSS_BUFFER_OK(*r->out.count, 0); return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER); diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index c639c634d1..575902a164 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -141,7 +141,7 @@ static WERROR dcesrv_winreg_CreateKey(struct dcesrv_call_state *dce_call, if (sdblob.data == NULL) { return WERR_INVALID_PARAM; } - ndr_err = ndr_pull_struct_blob_all(&sdblob, mem_ctx, NULL, &sd, + ndr_err = ndr_pull_struct_blob_all(&sdblob, mem_ctx, &sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return WERR_INVALID_PARAM; diff --git a/source4/scripting/python/modules.h b/source4/scripting/python/modules.h index c73cfff19c..8e3c0a21c2 100644 --- a/source4/scripting/python/modules.h +++ b/source4/scripting/python/modules.h @@ -23,7 +23,4 @@ void py_load_samba_modules(void); bool py_update_path(const char *bindir); -#define py_iconv_convenience(mem_ctx) smb_iconv_convenience_reinit(mem_ctx, "ASCII", \ - PyUnicode_GetDefaultEncoding(), true, NULL) - #endif /* __SAMBA_PYTHON_MODULES_H__ */ diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index 5fba041e1e..cfef9d18a4 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -159,7 +159,7 @@ static NTSTATUS nttrans_create(struct smbsrv_request *req, if (io->ntcreatex.in.sec_desc == NULL) { return NT_STATUS_NO_MEMORY; } - ndr_err = ndr_pull_struct_blob(&blob, io, NULL, + ndr_err = ndr_pull_struct_blob(&blob, io, io->ntcreatex.in.sec_desc, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -206,7 +206,7 @@ static NTSTATUS nttrans_query_sec_desc_send(struct nttrans_op *op) NT_STATUS_NOT_OK_RETURN(status); params = op->trans->out.params.data; - ndr_err = ndr_push_struct_blob(&op->trans->out.data, op, NULL, + ndr_err = ndr_push_struct_blob(&op->trans->out.data, op, io->query_secdesc.out.sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -272,7 +272,7 @@ static NTSTATUS nttrans_set_sec_desc(struct smbsrv_request *req, io->set_secdesc.in.sd = talloc(io, struct security_descriptor); NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd); - ndr_err = ndr_pull_struct_blob(&trans->in.data, req, NULL, + ndr_err = ndr_pull_struct_blob(&trans->in.data, req, io->set_secdesc.in.sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c index 3084236355..5e4f35e02b 100644 --- a/source4/smb_server/smb2/fileinfo.c +++ b/source4/smb_server/smb2/fileinfo.c @@ -150,7 +150,7 @@ static NTSTATUS smb2srv_getinfo_security_send(struct smb2srv_getinfo_op *op) union smb_fileinfo *io = talloc_get_type(op->io_ptr, union smb_fileinfo); enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&op->info->out.blob, op->req, NULL, + ndr_err = ndr_push_struct_blob(&op->info->out.blob, op->req, io->query_secdesc.out.sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -316,7 +316,7 @@ static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t io->set_secdesc.in.sd = talloc(io, struct security_descriptor); NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd); - ndr_err = ndr_pull_struct_blob(&op->info->in.blob, io, NULL, + ndr_err = ndr_pull_struct_blob(&op->info->in.blob, io, io->set_secdesc.in.sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c index 26d0a3e8e0..f6460e0ee7 100644 --- a/source4/smb_server/smb2/fileio.c +++ b/source4/smb_server/smb2/fileio.c @@ -109,7 +109,7 @@ void smb2srv_create_recv(struct smb2srv_request *req) smb2srv_send_error(req, NT_STATUS_NO_MEMORY); return; } - ndr_err = ndr_pull_struct_blob(&io->smb2.in.blobs.blobs[i].data, io, NULL, + ndr_err = ndr_pull_struct_blob(&io->smb2.in.blobs.blobs[i].data, io, io->smb2.in.sec_desc, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 149421532f..88917c4f38 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -219,9 +219,7 @@ static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx, msg = messaging_init(talloc_autofree_context(), lp_messaging_path(event_ctx, lp_ctx), - cluster_id(0, SAMBA_PARENT_TASKID), - lp_iconv_convenience(lp_ctx), - event_ctx); + cluster_id(0, SAMBA_PARENT_TASKID), event_ctx); NT_STATUS_HAVE_NO_MEMORY(msg); irpc_add_name(msg, "samba"); diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c index bce663ba8e..d78fd72cc2 100644 --- a/source4/smbd/service_named_pipe.c +++ b/source4/smbd/service_named_pipe.c @@ -211,7 +211,6 @@ static void named_pipe_auth_request(struct tevent_req *subreq) ndr_err = ndr_pull_struct_blob_all( &call->in, pipe_conn, - lp_iconv_convenience(conn->lp_ctx), &pipe_request, (ndr_pull_flags_fn_t) ndr_pull_named_pipe_auth_req); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -480,7 +479,6 @@ static void named_pipe_auth_request(struct tevent_req *subreq) reply: /* create the output */ ndr_err = ndr_push_struct_blob(&call->out, pipe_conn, - lp_iconv_convenience(conn->lp_ctx), &pipe_reply, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index 043720597c..8c38f27d74 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -188,9 +188,7 @@ static void stream_new_connection(struct tevent_context *ev, /* setup to receive internal messages on this connection */ srv_conn->msg_ctx = messaging_init(srv_conn, lp_messaging_path(srv_conn, lp_ctx), - srv_conn->server_id, - lp_iconv_convenience(lp_ctx), - ev); + srv_conn->server_id, ev); if (!srv_conn->msg_ctx) { stream_terminate_connection(srv_conn, "messaging_init() failed"); return; diff --git a/source4/smbd/service_task.c b/source4/smbd/service_task.c index d5d3eef59c..55f2fa24b8 100644 --- a/source4/smbd/service_task.c +++ b/source4/smbd/service_task.c @@ -81,7 +81,6 @@ static void task_server_callback(struct tevent_context *event_ctx, task->msg_ctx = messaging_init(task, lp_messaging_path(task, task->lp_ctx), task->server_id, - lp_iconv_convenience(task->lp_ctx), task->event_ctx); if (!task->msg_ctx) { task_server_terminate(task, "messaging_init() failed", true); diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c index 182478a465..2223f39161 100644 --- a/source4/torture/auth/pac.c +++ b/source4/torture/auth/pac.c @@ -114,7 +114,6 @@ static bool torture_pac_self_check(struct torture_context *tctx) /* OK, go ahead and make a PAC */ ret = kerberos_create_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), server_info, smb_krb5_context->krb5_context, &krbtgt_keyblock, @@ -141,7 +140,6 @@ static bool torture_pac_self_check(struct torture_context *tctx) /* Now check that we can read it back (using full decode and validate) */ nt_status = kerberos_decode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data, tmp_blob, smb_krb5_context->krb5_context, @@ -165,7 +163,6 @@ static bool torture_pac_self_check(struct torture_context *tctx) /* Now check we can read it back (using Heimdal's pac parsing) */ nt_status = kerberos_pac_blob_to_server_info(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), tmp_blob, smb_krb5_context->krb5_context, &server_info_out); @@ -189,7 +186,6 @@ static bool torture_pac_self_check(struct torture_context *tctx) /* Now check that we can read it back (yet again) */ nt_status = kerberos_pac_logon_info(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &logon_info, tmp_blob, smb_krb5_context->krb5_context, @@ -409,7 +405,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) /* Decode and verify the signaure on the PAC */ nt_status = kerberos_decode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data, tmp_blob, smb_krb5_context->krb5_context, @@ -430,7 +425,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) /* Now check we can read it back (using Heimdal's pac parsing) */ nt_status = kerberos_pac_blob_to_server_info(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), tmp_blob, smb_krb5_context->krb5_context, &server_info_out); @@ -468,7 +462,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) /* Parse the PAC again, for the logon info this time (using Samba4's parsing) */ nt_status = kerberos_pac_logon_info(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &logon_info, tmp_blob, smb_krb5_context->krb5_context, @@ -533,7 +526,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) } ret = kerberos_encode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), pac_data, smb_krb5_context->krb5_context, krbtgt_keyblock_p, @@ -585,7 +577,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) } ret = kerberos_create_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), server_info_out, smb_krb5_context->krb5_context, krbtgt_keyblock_p, @@ -611,7 +602,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx) */ if (tmp_blob.length != validate_blob.length) { ndr_err = ndr_pull_struct_blob(&validate_blob, mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data2, + &pac_data2, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA); nt_status = ndr_map_error2ntstatus(ndr_err); torture_assert_ntstatus_ok(tctx, nt_status, "can't parse the PAC"); @@ -633,7 +624,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx) if (memcmp(tmp_blob.data, validate_blob.data, tmp_blob.length) != 0) { ndr_err = ndr_pull_struct_blob(&validate_blob, mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data2, + &pac_data2, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA); nt_status = ndr_map_error2ntstatus(ndr_err); torture_assert_ntstatus_ok(tctx, nt_status, "can't parse the PAC"); @@ -659,7 +650,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) /* Break the auth time, to ensure we check this vital detail (not setting this caused all the pain in the first place... */ nt_status = kerberos_decode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data, tmp_blob, smb_krb5_context->krb5_context, @@ -697,7 +687,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) } nt_status = kerberos_decode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data, tmp_blob, smb_krb5_context->krb5_context, @@ -717,7 +706,6 @@ static bool torture_pac_saved_check(struct torture_context *tctx) tmp_blob.data[tmp_blob.length - 2]++; nt_status = kerberos_decode_pac(mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &pac_data, tmp_blob, smb_krb5_context->krb5_context, diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 309a394476..b2d523283a 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -55,7 +55,6 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev, lp_resolve_context(tctx->lp_ctx), &options, - lp_iconv_convenience(tctx->lp_ctx), lp_socket_options(tctx->lp_ctx))) { torture_comment(tctx, "Failed to connect with %s\n", host); goto failed; diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c index 37c1f43c39..a4d8674db9 100644 --- a/source4/torture/basic/scanner.c +++ b/source4/torture/basic/scanner.c @@ -435,8 +435,7 @@ static NTSTATUS try_nttrans_len(struct smbcli_state *cli, /**************************************************************************** check for existance of a nttrans call ****************************************************************************/ -static bool scan_nttrans(struct smb_iconv_convenience *iconv_convenience, - struct smbcli_state *cli, int op, int level, +static bool scan_nttrans(struct smbcli_state *cli, int op, int level, int fnum, int dnum, const char *fname) { int data_len = 0; @@ -546,7 +545,6 @@ bool torture_nttrans_scan(struct torture_context *torture, { int op, level; const char *fname = "\\scanner.dat"; - struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(torture->lp_ctx); int fnum, dnum; fnum = smbcli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, @@ -556,18 +554,15 @@ bool torture_nttrans_scan(struct torture_context *torture, for (op=OP_MIN; op<=OP_MAX; op++) { printf("Scanning op=%d\n", op); for (level = 0; level <= 50; level++) { - scan_nttrans(iconv_convenience, - cli, op, level, fnum, dnum, fname); + scan_nttrans(cli, op, level, fnum, dnum, fname); } for (level = 0x100; level <= 0x130; level++) { - scan_nttrans(iconv_convenience, - cli, op, level, fnum, dnum, fname); + scan_nttrans(cli, op, level, fnum, dnum, fname); } for (level = 1000; level < 1050; level++) { - scan_nttrans(iconv_convenience, - cli, op, level, fnum, dnum, fname); + scan_nttrans(cli, op, level, fnum, dnum, fname); } } diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c index 158418a284..682bc0963e 100644 --- a/source4/torture/basic/utable.c +++ b/source4/torture/basic/utable.c @@ -49,9 +49,9 @@ bool torture_utable(struct torture_context *tctx, SSVAL(c2, 0, c); strncpy(fname, "\\utable\\x", sizeof(fname)-1); p = fname+strlen(fname); - convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, c2, 2, - p, sizeof(fname)-strlen(fname), &len, false); + p, sizeof(fname)-strlen(fname), false); p[len] = 0; strncat(fname,"_a_long_extension",sizeof(fname)-1); @@ -97,7 +97,7 @@ bool torture_utable(struct torture_context *tctx, } -static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c) +static char *form_name(int c) { static char fname[256]; uint8_t c2[4]; @@ -108,9 +108,11 @@ static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c) p = fname+strlen(fname); SSVAL(c2, 0, c); - convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX, + len = convert_string(CH_UTF16, CH_UNIX, c2, 2, - p, sizeof(fname)-strlen(fname), &len, false); + p, sizeof(fname)-strlen(fname), false); + if (len == -1) + return NULL; p[len] = 0; return fname; } @@ -138,7 +140,7 @@ bool torture_casetable(struct torture_context *tctx, torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.'); - fname = form_name(lp_iconv_convenience(tctx->lp_ctx), c); + fname = form_name(c); fnum = smbcli_nt_create_full(cli->tree, fname, 0, #if 0 SEC_RIGHT_MAXIMUM_ALLOWED, diff --git a/source4/torture/drs/unit/prefixmap_tests.c b/source4/torture/drs/unit/prefixmap_tests.c index 4282e26a6c..a4521eb675 100644 --- a/source4/torture/drs/unit/prefixmap_tests.c +++ b/source4/torture/drs/unit/prefixmap_tests.c @@ -500,7 +500,7 @@ static bool torture_drs_unit_pfm_to_from_ldb_val(struct torture_context *tctx, s mem_ctx = talloc_new(tctx); torture_assert(tctx, mem_ctx, "Unexpected: Have no memory!"); - schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); + schema = dsdb_new_schema(mem_ctx); torture_assert(tctx, schema, "Unexpected: failed to allocate schema object"); /* set priv->pfm_full as prefixMap for new schema object */ @@ -552,7 +552,7 @@ static bool torture_drs_unit_pfm_read_write_ldb(struct torture_context *tctx, st torture_assert(tctx, mem_ctx, "Unexpected: Have no memory!"); /* makeup a dsdb_schema to test with */ - schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); + schema = dsdb_new_schema(mem_ctx); torture_assert(tctx, schema, "Unexpected: failed to allocate schema object"); /* set priv->pfm_full as prefixMap for new schema object */ schema->prefixmap = priv->pfm_full; @@ -606,7 +606,7 @@ static bool torture_drs_unit_dsdb_create_prefix_mapping(struct torture_context * torture_assert(tctx, mem_ctx, "Unexpected: Have no memory!"); /* makeup a dsdb_schema to test with */ - schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); + schema = dsdb_new_schema(mem_ctx); torture_assert(tctx, schema, "Unexpected: failed to allocate schema object"); /* set priv->pfm_full as prefixMap for new schema object */ schema->schema_info = priv->schi_default_str; diff --git a/source4/torture/drs/unit/schemainfo_tests.c b/source4/torture/drs/unit/schemainfo_tests.c index f197b479e9..a69e8a80cc 100644 --- a/source4/torture/drs/unit/schemainfo_tests.c +++ b/source4/torture/drs/unit/schemainfo_tests.c @@ -513,7 +513,7 @@ static bool torture_drs_unit_schemainfo_setup(struct torture_context *tctx, torture_assert(tctx, priv->ldb_module, "Not enough memory!"); /* create schema mockup object */ - priv->schema = dsdb_new_schema(priv, lp_iconv_convenience(tctx->lp_ctx)); + priv->schema = dsdb_new_schema(priv); /* pre-cache invocationId for samdb_ntds_invocation_id() * to work with our mock ldb */ diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 4b7128f3ab..10a1370b9d 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -247,7 +247,6 @@ static bool connect_servers(struct tevent_context *ev, lp_resolve_context(lp_ctx), ev, &smb_options, &smb_session_options, - lp_iconv_convenience(lp_ctx), lp_gensec_settings(lp_ctx, lp_ctx)); } if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index 05af0a6403..73bbcd15cb 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -45,7 +45,6 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) struct netlogon_samlogon_response n1; struct GUID guid; int i; - struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); struct tsocket_address *dest_addr; int ret; @@ -69,7 +68,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying without any attributes\n"); search = empty_search; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); n1 = search.out.netlogon; @@ -82,7 +81,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) for (i=0;i<256;i++) { search.in.version = i; printf("Trying netlogon level %d\n", i); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); } @@ -90,42 +89,42 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) for (i=0;i<31;i++) { search.in.version = (1<<i); printf("Trying netlogon level 0x%x\n", i); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); } search.in.version = NETLOGON_NT_VERSION_5|NETLOGON_NT_VERSION_5EX|NETLOGON_NT_VERSION_IP; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); printf("Trying with User=NULL\n"); search.in.user = NULL; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, ""); printf("Trying with User=Administrator\n"); search.in.user = "Administrator"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user); search.in.version = NETLOGON_NT_VERSION_5; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); printf("Trying with User=NULL\n"); search.in.user = NULL; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, ""); printf("Trying with User=Administrator\n"); search.in.user = "Administrator"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user); @@ -135,7 +134,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with a GUID\n"); search.in.realm = NULL; search.in.domain_guid = GUID_string(tctx, &n1.data.nt5_ex.domain_uuid); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX); CHECK_STRING(GUID_string(tctx, &search.out.netlogon.data.nt5_ex.domain_uuid), search.in.domain_guid); @@ -144,13 +143,13 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) guid = GUID_random(); search.in.user = NULL; search.in.domain_guid = GUID_string(tctx, &guid); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_NOT_FOUND); printf("Trying with a AAC\n"); search.in.acct_control = ACB_WSTRUST|ACB_SVRTRUST; search.in.realm = n1.data.nt5_ex.dns_domain; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, ""); @@ -158,7 +157,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with a zero AAC\n"); search.in.acct_control = 0x0; search.in.realm = n1.data.nt5_ex.dns_domain; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, ""); @@ -167,7 +166,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) search.in.acct_control = 0x0; search.in.user = "Administrator"; search.in.realm = n1.data.nt5_ex.dns_domain; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "Administrator"); @@ -176,7 +175,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) search.in.user = NULL; search.in.acct_control = 0xFF00FF00; search.in.realm = n1.data.nt5_ex.dns_domain; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, ""); @@ -184,7 +183,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with a user only\n"); search = empty_search; search.in.user = "Administrator"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain); @@ -196,7 +195,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with just a bad username\n"); search.in.user = "___no_such_user___"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); @@ -210,12 +209,12 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with just a bad domain\n"); search = empty_search; search.in.realm = "___no_such_domain___"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_NOT_FOUND); printf("Trying with a incorrect domain and correct guid\n"); search.in.domain_guid = GUID_string(tctx, &n1.data.nt5_ex.domain_uuid); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); @@ -228,7 +227,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with a incorrect domain and incorrect guid\n"); search.in.domain_guid = GUID_string(tctx, &guid); - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_NOT_FOUND); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); @@ -242,7 +241,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Trying with a incorrect GUID and correct domain\n"); search.in.domain_guid = GUID_string(tctx, &guid); search.in.realm = n1.data.nt5_ex.dns_domain; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); @@ -255,7 +254,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest) printf("Proof other results\n"); search.in.user = "Administrator"; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain); CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain); @@ -279,7 +278,6 @@ static bool test_cldap_netlogon_flags(struct torture_context *tctx, struct cldap_netlogon search; struct netlogon_samlogon_response n1; uint32_t server_type; - struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); struct tsocket_address *dest_addr; int ret; @@ -302,7 +300,7 @@ static bool test_cldap_netlogon_flags(struct torture_context *tctx, search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; search.in.map_response = true; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); n1 = search.out.netlogon; @@ -399,7 +397,6 @@ static bool test_cldap_netlogon_flag_ds_dns_forest(struct torture_context *tctx, struct cldap_netlogon search; uint32_t server_type; struct netlogon_samlogon_response n1; - struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); bool result = true; struct tsocket_address *dest_addr; int ret; @@ -423,7 +420,7 @@ static bool test_cldap_netlogon_flag_ds_dns_forest(struct torture_context *tctx, search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; search.in.map_response = true; - status = cldap_netlogon(cldap, iconv_convenience, tctx, &search); + status = cldap_netlogon(cldap, tctx, &search); CHECK_STATUS(status, NT_STATUS_OK); n1 = search.out.netlogon; diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index a63c78944b..27c0746e9a 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -40,9 +40,7 @@ static void request_netlogon_handler(struct tevent_req *req) NTSTATUS status; TALLOC_CTX *tmp_ctx = talloc_new(NULL); io.in.version = 6; - status = cldap_netlogon_recv(req, - lp_iconv_convenience(state->tctx->lp_ctx), - tmp_ctx, &io); + status = cldap_netlogon_recv(req, tmp_ctx, &io); talloc_free(req); if (NT_STATUS_IS_OK(status)) { state->pass_count++; diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c index 0921cf779b..76eb45c5c1 100644 --- a/source4/torture/ldap/uptodatevector.c +++ b/source4/torture/ldap/uptodatevector.c @@ -65,7 +65,7 @@ static bool test_check_uptodatevector(struct torture_context *torture, utdv_val1 = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector"); if (utdv_val1) { ndr_err = ndr_pull_struct_blob_all(utdv_val1, torture, - lp_iconv_convenience(torture->lp_ctx), &utdv1, + &utdv1, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; @@ -111,7 +111,7 @@ static bool test_check_uptodatevector(struct torture_context *torture, utdv_val = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector"); if (utdv_val) { ndr_err = ndr_pull_struct_blob_all(utdv_val, torture, - lp_iconv_convenience(torture->lp_ctx), &utdv, + &utdv, (ndr_pull_flags_fn_t)ndr_pull_replUpToDateVectorBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index dd9e173b54..b674e0eddb 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -398,7 +398,7 @@ static NTSTATUS test_become_dc_schema_chunk(void *private_data, } if (!s->schema) { - s->self_made_schema = dsdb_new_schema(s, lp_iconv_convenience(s->lp_ctx)); + s->self_made_schema = dsdb_new_schema(s); NT_STATUS_HAVE_NO_MEMORY(s->self_made_schema); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index b3ee8fc28f..a09b54cfd6 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -167,7 +167,6 @@ static struct smbcli_state *connect_one(struct tevent_context *ev, servers[snum], lp_resolve_context(lp_ctx), ev, &options, &session_options, - lp_iconv_convenience(lp_ctx), lp_gensec_settings(mem_ctx, lp_ctx)); if (!NT_STATUS_IS_OK(status)) { sleep(2); diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index 0dd6a8f929..e61eb868a4 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -77,7 +77,6 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx, const char *socket_options, struct smbcli_options *options, struct smbcli_session_options *session_options, - struct smb_iconv_convenience *iconv_convenience, struct gensec_settings *gensec_settings) { struct smbcli_state *c; @@ -99,7 +98,6 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx, socket_options, cmdline_credentials, resolve_ctx, ev, options, session_options, - iconv_convenience, gensec_settings); if (!NT_STATUS_IS_OK(status)) { @@ -372,7 +370,6 @@ static void usage(poptContext pc) cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share, lp_smb_ports(lp_ctx), lp_socket_options(lp_ctx), &options, &session_options, - lp_iconv_convenience(lp_ctx), lp_gensec_settings(mem_ctx, lp_ctx)); if (!cli) { DEBUG(0,("Failed to connect to %s\n", share)); diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index 09aaa41c68..7d1199ec2a 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -64,8 +64,7 @@ static void netlogon_handler(struct dgram_mailslot_handler *dgmslot, static bool nbt_test_netlogon(struct torture_context *tctx) { struct dgram_mailslot_handler *dgmslot; - struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev, - lp_iconv_convenience(tctx->lp_ctx)); + struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev); struct socket_address *dest; const char *myaddress; struct nbt_netlogon_packet logon; @@ -155,8 +154,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx) static bool nbt_test_netlogon2(struct torture_context *tctx) { struct dgram_mailslot_handler *dgmslot; - struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev, - lp_iconv_convenience(tctx->lp_ctx)); + struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev); struct socket_address *dest; const char *myaddress; struct nbt_netlogon_packet logon; @@ -425,8 +423,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) static bool nbt_test_ntlogon(struct torture_context *tctx) { struct dgram_mailslot_handler *dgmslot; - struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev, - lp_iconv_convenience(tctx->lp_ctx)); + struct nbt_dgram_socket *dgmsock = nbt_dgram_socket_init(tctx, tctx->ev); struct socket_address *dest; struct test_join *join_ctx; const struct dom_sid *dom_sid; diff --git a/source4/torture/nbt/nbt.c b/source4/torture/nbt/nbt.c index aee0c54358..1dcfa563df 100644 --- a/source4/torture/nbt/nbt.c +++ b/source4/torture/nbt/nbt.c @@ -27,7 +27,7 @@ struct nbt_name_socket *torture_init_nbt_socket(struct torture_context *tctx) { - return nbt_name_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + return nbt_name_socket_init(tctx, tctx->ev); } bool torture_nbt_get_name(struct torture_context *tctx, diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c index bea3d4f9cf..226f388f35 100644 --- a/source4/torture/nbt/winsbench.c +++ b/source4/torture/nbt/winsbench.c @@ -225,7 +225,7 @@ static void generate_request(struct nbt_name_socket *nbtsock, struct wins_state */ static bool bench_wins(struct torture_context *tctx) { - struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev); int num_sent=0; struct timeval tv = timeval_current(); bool ret = true; diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 9a7be03199..b8152f79d6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -102,8 +102,8 @@ static bool test_assoc_ctx1(struct torture_context *tctx) torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n"); - wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); - wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev); + wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev); torture_comment(tctx, "Setup 2 wrepl connections\n"); status = wrepl_connect(wrepl_socket1, wrepl_best_ip(tctx->lp_ctx, address), address); @@ -193,7 +193,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) torture_comment(tctx, "Test if we always get back the same assoc_ctx\n"); - wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(tctx, tctx->ev); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address); @@ -262,7 +262,7 @@ static bool test_wins_replication(struct torture_context *tctx) torture_comment(tctx, "Test one pull replication cycle\n"); - wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(tctx, tctx->ev); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address); @@ -555,7 +555,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx) return NULL; ctx->address = address; - ctx->pull = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + ctx->pull = wrepl_socket_init(ctx, tctx->ev); if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); @@ -612,7 +612,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( talloc_free(pull_table.out.partners); - ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev); if (!ctx->nbtsock) return NULL; load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); @@ -630,7 +630,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; - ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev); if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ @@ -647,13 +647,13 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( } if (ctx->myaddr2 && ctx->nbtsock_srv) { - ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev); if (!ctx->nbtsock2) return NULL; status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; - ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx); if (!ctx->nbtsock_srv2) return NULL; /* Make a port 137 version of ctx->myaddr2 */ @@ -724,7 +724,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, uint32_t assoc_ctx; NTSTATUS status; - wrepl_socket = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(ctx, tctx->ev); status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); diff --git a/source4/torture/ndr/ndr.c b/source4/torture/ndr/ndr.c index 24f5fba282..6068e108b5 100644 --- a/source4/torture/ndr/ndr.c +++ b/source4/torture/ndr/ndr.c @@ -38,7 +38,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, lp_iconv_convenience(tctx->lp_ctx)); + struct ndr_pull *ndr = ndr_pull_init_blob(&(data->data), tctx); ndr->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -97,7 +97,7 @@ static bool test_check_string_terminator(struct torture_context *tctx) /* Simple test */ blob = strhex_to_data_blob(tctx, "0000"); - ndr = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); + ndr = ndr_pull_init_blob(&blob, mem_ctx); torture_assert_ndr_success(tctx, ndr_check_string_terminator(ndr, 1, 2), "simple check_string_terminator test failed"); @@ -115,7 +115,7 @@ static bool test_check_string_terminator(struct torture_context *tctx) talloc_free(ndr); blob = strhex_to_data_blob(tctx, "11220000"); - ndr = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx)); + ndr = ndr_pull_init_blob(&blob, mem_ctx); torture_assert_ndr_success(tctx, ndr_check_string_terminator(ndr, 4, 1), diff --git a/source4/torture/ntp/ntp_signd.c b/source4/torture/ntp/ntp_signd.c index bf631f4445..9b4b9c3a4e 100644 --- a/source4/torture/ntp/ntp_signd.c +++ b/source4/torture/ntp/ntp_signd.c @@ -137,7 +137,6 @@ static bool test_ntp_signd(struct torture_context *tctx, ndr_err = ndr_push_struct_blob(&sign_req_blob, mem_ctx, - NULL, &sign_req, (ndr_push_flags_fn_t)ndr_push_sign_request); torture_assert(tctx, @@ -246,7 +245,6 @@ static bool test_ntp_signd(struct torture_context *tctx, torture_comment(tctx, "Validating the reply buffer\n"); ndr_err = ndr_pull_struct_blob_all(&signd_client->reply, mem_ctx, - lp_iconv_convenience(tctx->lp_ctx), &signed_reply, (ndr_pull_flags_fn_t)ndr_pull_signed_reply); torture_assert(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c index a8a30366cf..e2ef9663be 100644 --- a/source4/torture/rap/printing.c +++ b/source4/torture/rap/printing.c @@ -87,7 +87,7 @@ static bool test_netprintqenum(struct torture_context *tctx, "Testing rap_NetPrintQEnum level %d\n", r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "smbcli_rap_netprintqenum failed"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); @@ -116,7 +116,7 @@ static bool test_netprintqgetinfo(struct torture_context *tctx, r_enum.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r_enum), + smbcli_rap_netprintqenum(cli->tree, tctx, &r_enum), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r_enum.out.status), "failed to enum printq"); @@ -133,7 +133,7 @@ static bool test_netprintqgetinfo(struct torture_context *tctx, r.in.PrintQueueName, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqgetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqgetinfo(cli->tree, tctx, &r), "smbcli_rap_netprintqgetinfo failed"); switch (r.in.level) { @@ -158,7 +158,7 @@ static bool test_netprintjob_pause(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintJobPause(%d)\n", r.in.JobID); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobpause(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobpause(cli->tree, tctx, &r), "smbcli_rap_netprintjobpause failed"); return true; @@ -175,7 +175,7 @@ static bool test_netprintjob_continue(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintJobContinue(%d)\n", r.in.JobID); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobcontinue(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobcontinue(cli->tree, tctx, &r), "smbcli_rap_netprintjobcontinue failed"); return true; @@ -192,7 +192,7 @@ static bool test_netprintjob_delete(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintJobDelete(%d)\n", r.in.JobID); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobdelete(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobdelete(cli->tree, tctx, &r), "smbcli_rap_netprintjobdelete failed"); return true; @@ -227,7 +227,7 @@ static bool test_netprintq_pause(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintQueuePause(%s)\n", r.in.PrintQueueName); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqueuepause(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqueuepause(cli->tree, tctx, &r), "smbcli_rap_netprintqueuepause failed"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "smbcli_rap_netprintqueuepause failed"); @@ -246,7 +246,7 @@ static bool test_netprintq_resume(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintQueueResume(%s)\n", r.in.PrintQueueName); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqueueresume(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqueueresume(cli->tree, tctx, &r), "smbcli_rap_netprintqueueresume failed"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "smbcli_rap_netprintqueueresume failed"); @@ -264,7 +264,7 @@ static bool test_netprintq(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); @@ -302,7 +302,7 @@ static bool test_netprintjobenum_args(struct torture_context *tctx, "Testing rap_NetPrintJobEnum(%s) level %d\n", r.in.PrintQueueName, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobenum(cli->tree, tctx, &r), "smbcli_rap_netprintjobenum failed"); if (count_p) { @@ -334,7 +334,7 @@ static bool test_netprintjobenum_one(struct torture_context *tctx, "Testing rap_NetPrintJobEnum(%s) level %d\n", r.in.PrintQueueName, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobenum(cli->tree, tctx, &r), "smbcli_rap_netprintjobenum failed"); } @@ -359,7 +359,7 @@ static bool test_netprintjobgetinfo_byid(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintJobGetInfo(%d) level %d\n", r.in.JobID, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobgetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobgetinfo(cli->tree, tctx, &r), "smbcli_rap_netprintjobgetinfo failed"); } @@ -387,7 +387,7 @@ static bool test_netprintjobsetinfo_byid(struct torture_context *tctx, torture_comment(tctx, "Testing rap_NetPrintJobSetInfo(%d) level %d\n", r.in.JobID, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobsetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobsetinfo(cli->tree, tctx, &r), "smbcli_rap_netprintjobsetinfo failed"); } @@ -407,7 +407,7 @@ static bool test_netprintjobgetinfo_byqueue(struct torture_context *tctx, r.in.level = 0; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobenum(cli->tree, tctx, &r), "failed to enumerate jobs"); for (i=0; i < r.out.count; i++) { @@ -432,7 +432,7 @@ static bool test_netprintjobsetinfo_byqueue(struct torture_context *tctx, r.in.level = 0; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintjobenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintjobenum(cli->tree, tctx, &r), "failed to enumerate jobs"); for (i=0; i < r.out.count; i++) { @@ -455,7 +455,7 @@ static bool test_netprintjobenum(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); @@ -482,7 +482,7 @@ static bool test_netprintjobgetinfo(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); @@ -509,7 +509,7 @@ static bool test_netprintjobsetinfo(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); @@ -542,7 +542,7 @@ static bool test_netprintdestenum(struct torture_context *tctx, "Testing rap_NetPrintDestEnum level %d\n", r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintdestenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintdestenum(cli->tree, tctx, &r), "smbcli_rap_netprintdestenum failed"); } @@ -567,7 +567,7 @@ static bool test_netprintdestgetinfo_bydest(struct torture_context *tctx, "Testing rap_NetPrintDestGetInfo(%s) level %d\n", r.in.PrintDestName, r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintdestgetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintdestgetinfo(cli->tree, tctx, &r), "smbcli_rap_netprintdestgetinfo failed"); } @@ -588,7 +588,7 @@ static bool test_netprintdestgetinfo(struct torture_context *tctx, "Testing rap_NetPrintDestEnum level %d\n", r.in.level); torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintdestenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintdestenum(cli->tree, tctx, &r), "smbcli_rap_netprintdestenum failed"); for (i=0; i < r.out.count; i++) { @@ -612,7 +612,7 @@ static bool test_rap_print(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netprintqenum(cli->tree, tctx, &r), "failed to enum printq"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "failed to enum printq"); diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c index 5412c1b52d..37edd20ed7 100644 --- a/source4/torture/rap/rap.c +++ b/source4/torture/rap/rap.c @@ -82,7 +82,7 @@ struct rap_call { #define RAPNDR_FLAGS (LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); -static struct rap_call *new_rap_cli_call(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint16_t callno) +static struct rap_call *new_rap_cli_call(TALLOC_CTX *mem_ctx, uint16_t callno) { struct rap_call *call; @@ -98,10 +98,10 @@ static struct rap_call *new_rap_cli_call(TALLOC_CTX *mem_ctx, struct smb_iconv_c call->datadesc = NULL; call->auxdatadesc = NULL; - call->ndr_push_param = ndr_push_init_ctx(mem_ctx, iconv_convenience); + call->ndr_push_param = ndr_push_init_ctx(mem_ctx); call->ndr_push_param->flags = RAPNDR_FLAGS; - call->ndr_push_data = ndr_push_init_ctx(mem_ctx, iconv_convenience); + call->ndr_push_data = ndr_push_init_ctx(mem_ctx); call->ndr_push_data->flags = RAPNDR_FLAGS; return call; @@ -218,7 +218,6 @@ static NTSTATUS rap_pull_string(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr, } static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, struct rap_call *call) { NTSTATUS result; @@ -228,7 +227,7 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, struct ndr_push *data; struct smb_trans2 trans; - params = ndr_push_init_ctx(call, iconv_convenience); + params = ndr_push_init_ctx(call); if (params == NULL) return NT_STATUS_NO_MEMORY; @@ -276,12 +275,10 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, if (!NT_STATUS_IS_OK(result)) return result; - call->ndr_pull_param = ndr_pull_init_blob(&trans.out.params, call, - iconv_convenience); + call->ndr_pull_param = ndr_pull_init_blob(&trans.out.params, call); call->ndr_pull_param->flags = RAPNDR_FLAGS; - call->ndr_pull_data = ndr_pull_init_blob(&trans.out.data, call, - iconv_convenience); + call->ndr_pull_data = ndr_pull_init_blob(&trans.out.data, call); call->ndr_pull_data->flags = RAPNDR_FLAGS; return result; @@ -289,7 +286,6 @@ static NTSTATUS rap_cli_do_call(struct smbcli_tree *tree, static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetShareEnum *r) { @@ -297,7 +293,7 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int i; - call = new_rap_cli_call(tree, iconv_convenience, RAP_WshareEnum); + call = new_rap_cli_call(tree, RAP_WshareEnum); if (call == NULL) return NT_STATUS_NO_MEMORY; @@ -319,7 +315,7 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetShareEnum, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -376,7 +372,7 @@ static bool test_netshareenum(struct torture_context *tctx, r.in.bufsize = 8192; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netshareenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), ""); + smbcli_rap_netshareenum(cli->tree, tctx, &r), ""); for (i=0; i<r.out.count; i++) { printf("%s %d %s\n", r.out.info[i].info1.share_name, @@ -388,7 +384,6 @@ static bool test_netshareenum(struct torture_context *tctx, } static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetServerEnum2 *r) { @@ -396,7 +391,7 @@ static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int i; - call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_NetServerEnum2); + call = new_rap_cli_call(mem_ctx, RAP_NetServerEnum2); if (call == NULL) return NT_STATUS_NO_MEMORY; @@ -420,7 +415,7 @@ static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetServerEnum2, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -484,7 +479,7 @@ static bool test_netserverenum(struct torture_context *tctx, r.in.domain = NULL; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netserverenum2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), ""); + smbcli_rap_netserverenum2(cli->tree, tctx, &r), ""); for (i=0; i<r.out.count; i++) { switch (r.in.level) { @@ -503,14 +498,13 @@ static bool test_netserverenum(struct torture_context *tctx, } NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_WserverGetInfo *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WserverGetInfo))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WserverGetInfo))) { return NT_STATUS_NO_MEMORY; } @@ -534,7 +528,7 @@ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_WserverGetInfo, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -718,7 +712,6 @@ static NTSTATUS rap_pull_rap_PrintQueue5(TALLOC_CTX *mem_ctx, struct ndr_pull *n } NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintQEnum *r) { @@ -726,7 +719,7 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int i; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQEnum))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQEnum))) { return NT_STATUS_NO_MEMORY; } @@ -765,7 +758,7 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintQEnum, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -823,14 +816,13 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintQGetInfo *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQGetInfo))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQGetInfo))) { return NT_STATUS_NO_MEMORY; } @@ -870,7 +862,7 @@ NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintQGetInfo, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -916,14 +908,13 @@ NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobpause(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobPause *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobPause))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobPause))) { return NT_STATUS_NO_MEMORY; } @@ -935,7 +926,7 @@ NTSTATUS smbcli_rap_netprintjobpause(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobPause, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -953,14 +944,13 @@ NTSTATUS smbcli_rap_netprintjobpause(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobcontinue(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobContinue *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobContinue))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobContinue))) { return NT_STATUS_NO_MEMORY; } @@ -972,7 +962,7 @@ NTSTATUS smbcli_rap_netprintjobcontinue(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobContinue, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -990,14 +980,13 @@ NTSTATUS smbcli_rap_netprintjobcontinue(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobdelete(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobDelete *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobDel))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobDel))) { return NT_STATUS_NO_MEMORY; } @@ -1009,7 +998,7 @@ NTSTATUS smbcli_rap_netprintjobdelete(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobDelete, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1027,14 +1016,13 @@ NTSTATUS smbcli_rap_netprintjobdelete(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintqueuepause(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintQueuePause *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQPause))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQPause))) { return NT_STATUS_NO_MEMORY; } @@ -1046,7 +1034,7 @@ NTSTATUS smbcli_rap_netprintqueuepause(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintQueuePause, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1064,14 +1052,13 @@ NTSTATUS smbcli_rap_netprintqueuepause(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintqueueresume(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintQueueResume *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQContinue))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQContinue))) { return NT_STATUS_NO_MEMORY; } @@ -1083,7 +1070,7 @@ NTSTATUS smbcli_rap_netprintqueueresume(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintQueueResume, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1101,14 +1088,13 @@ NTSTATUS smbcli_rap_netprintqueueresume(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintqueuepurge(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintQueuePurge *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQPurge))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQPurge))) { return NT_STATUS_NO_MEMORY; } @@ -1120,7 +1106,7 @@ NTSTATUS smbcli_rap_netprintqueuepurge(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintQueuePurge, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1138,7 +1124,6 @@ NTSTATUS smbcli_rap_netprintqueuepurge(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobenum(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobEnum *r) { @@ -1146,7 +1131,7 @@ NTSTATUS smbcli_rap_netprintjobenum(struct smbcli_tree *tree, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int i; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobEnum))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobEnum))) { return NT_STATUS_NO_MEMORY; } @@ -1180,7 +1165,7 @@ NTSTATUS smbcli_rap_netprintjobenum(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobEnum, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1234,14 +1219,13 @@ NTSTATUS smbcli_rap_netprintjobenum(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobgetinfo(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobGetInfo *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobGetInfo))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobGetInfo))) { return NT_STATUS_NO_MEMORY; } @@ -1275,7 +1259,7 @@ NTSTATUS smbcli_rap_netprintjobgetinfo(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobGetInfo, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1319,14 +1303,13 @@ NTSTATUS smbcli_rap_netprintjobgetinfo(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintjobsetinfo(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintJobSetInfo *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintJobSetInfo))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintJobSetInfo))) { return NT_STATUS_NO_MEMORY; } @@ -1365,7 +1348,7 @@ NTSTATUS smbcli_rap_netprintjobsetinfo(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintJobSetInfo, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1434,7 +1417,6 @@ static NTSTATUS rap_pull_rap_PrintDest3(TALLOC_CTX *mem_ctx, struct ndr_pull *nd } NTSTATUS smbcli_rap_netprintdestenum(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintDestEnum *r) { @@ -1442,7 +1424,7 @@ NTSTATUS smbcli_rap_netprintdestenum(struct smbcli_tree *tree, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int i; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintDestEnum))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintDestEnum))) { return NT_STATUS_NO_MEMORY; } @@ -1472,7 +1454,7 @@ NTSTATUS smbcli_rap_netprintdestenum(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintDestEnum, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1526,14 +1508,13 @@ NTSTATUS smbcli_rap_netprintdestenum(struct smbcli_tree *tree, } NTSTATUS smbcli_rap_netprintdestgetinfo(struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct rap_NetPrintDestGetInfo *r) { struct rap_call *call; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintDestGetInfo))) { + if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintDestGetInfo))) { return NT_STATUS_NO_MEMORY; } @@ -1564,7 +1545,7 @@ NTSTATUS smbcli_rap_netprintdestgetinfo(struct smbcli_tree *tree, NDR_PRINT_IN_DEBUG(rap_NetPrintDestGetInfo, r); } - result = rap_cli_do_call(tree, iconv_convenience, call); + result = rap_cli_do_call(tree, call); if (!NT_STATUS_IS_OK(result)) goto done; @@ -1718,14 +1699,14 @@ static bool test_netservergetinfo(struct torture_context *tctx, r.in.level = 0; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "rap_netservergetinfo level 0 failed"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "rap_netservergetinfo level 0 failed"); r.in.level = 1; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "rap_netservergetinfo level 1 failed"); torture_assert_werr_ok(tctx, W_ERROR(r.out.status), "rap_netservergetinfo level 1 failed"); @@ -1738,10 +1719,10 @@ bool torture_rap_scan(struct torture_context *torture, struct smbcli_state *cli) int callno; for (callno = 0; callno < 0xffff; callno++) { - struct rap_call *call = new_rap_cli_call(torture, lp_iconv_convenience(torture->lp_ctx), callno); + struct rap_call *call = new_rap_cli_call(torture, callno); NTSTATUS result; - result = rap_cli_do_call(cli->tree, lp_iconv_convenience(torture->lp_ctx), call); + result = rap_cli_do_call(cli->tree, call); if (!NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER)) continue; diff --git a/source4/torture/rap/rpc.c b/source4/torture/rap/rpc.c index 4528240310..6335a54b35 100644 --- a/source4/torture/rap/rpc.c +++ b/source4/torture/rap/rpc.c @@ -58,7 +58,7 @@ static bool test_rpc_netservergetinfo(struct torture_context *tctx, r.in.level = 0; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "rap_netservergetinfo level 0 failed"); torture_assert_int_equal(tctx, r.out.status, 0, "rap_netservergetinfo level 0 failed"); @@ -70,7 +70,7 @@ static bool test_rpc_netservergetinfo(struct torture_context *tctx, r.in.level = 1; torture_assert_ntstatus_ok(tctx, - smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), + smbcli_rap_netservergetinfo(cli->tree, tctx, &r), "rap_netservergetinfo level 1 failed"); torture_assert_int_equal(tctx, r.out.status, 0, "rap_netservergetinfo level 1 failed"); diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 5ae396412e..2a1d8e5ace 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -188,7 +188,6 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx, NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials, lp_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(tctx, "Failed to open connection - %s\n", diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c index a854ac8857..12897ef499 100644 --- a/source4/torture/raw/qfileinfo.c +++ b/source4/torture/raw/qfileinfo.c @@ -877,8 +877,7 @@ bool torture_raw_qfileinfo_pipe(struct torture_context *torture, struct smbcli_tree *ipc_tree; NTSTATUS status; - if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx, - lp_iconv_convenience(torture->lp_ctx)))) { + if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx))) { return false; } diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c index 06cb7650c1..66fc3c01d6 100644 --- a/source4/torture/raw/tconrate.c +++ b/source4/torture/raw/tconrate.c @@ -102,7 +102,6 @@ static int fork_tcon_client(struct torture_context *tctx, NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials, lp_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c index 77bb761e0c..3bf7dab764 100644 --- a/source4/torture/rpc/autoidl.c +++ b/source4/torture/rpc/autoidl.c @@ -81,7 +81,7 @@ static void fill_blob_handle(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, return; } - ndr_push_struct_blob(&b2, mem_ctx, NULL, handle, (ndr_push_flags_fn_t)ndr_push_policy_handle); + ndr_push_struct_blob(&b2, mem_ctx, handle, (ndr_push_flags_fn_t)ndr_push_policy_handle); memcpy(blob->data, b2.data, 20); } diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 2e5edfdb88..d6ed191284 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -361,7 +361,7 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx) search.in.acct_control = -1; search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX; search.in.map_response = true; - status = cldap_netlogon(cldap, lp_iconv_convenience(tctx->lp_ctx), ctx, &search); + status = cldap_netlogon(cldap, ctx, &search); if (!NT_STATUS_IS_OK(status)) { const char *errstr = nt_errstr(status); ctx->site_name = talloc_asprintf(ctx, "%s", "Default-First-Site-Name"); @@ -407,7 +407,7 @@ static bool test_analyse_objects(struct torture_context *tctx, struct ldb_result *a_res; struct ldb_result *c_res; struct ldb_dn *schema_dn = ldb_get_schema_basedn(ldb); - ldap_schema = dsdb_new_schema(ctx, lp_iconv_convenience(tctx->lp_ctx)); + ldap_schema = dsdb_new_schema(ctx); if (!ldap_schema) { return false; } @@ -727,8 +727,7 @@ static bool test_analyse_objects(struct torture_context *tctx, if (pull_fn) { /* Can't use '_all' because of PIDL bugs with relative pointers */ ndr_err = ndr_pull_struct_blob(&plain_data, ptr, - lp_iconv_convenience(tctx->lp_ctx), ptr, - pull_fn); + ptr, pull_fn); if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { ndr_print_debug(print_fn, name, ptr); } else { diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 1fcc0a6f3f..3b6c70e068 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -171,8 +171,7 @@ static bool test_ReadEventLog(struct torture_context *tctx, blob = data_blob_const(r.out.data + pos, size); dump_data(0, blob.data, blob.length); - ndr_err = ndr_pull_struct_blob_all(&blob, tctx, - lp_iconv_convenience(tctx->lp_ctx), &rec, + ndr_err = ndr_pull_struct_blob_all(&blob, tctx, &rec, (ndr_pull_flags_fn_t)ndr_pull_EVENTLOGRECORD); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c index b02510930a..09519d03a5 100644 --- a/source4/torture/rpc/join.c +++ b/source4/torture/rpc/join.c @@ -41,7 +41,6 @@ bool torture_rpc_join(struct torture_context *torture) machine_account, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", @@ -70,7 +69,6 @@ bool torture_rpc_join(struct torture_context *torture) machine_account, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n", diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 3f91afedd6..c66725672e 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -2438,7 +2438,7 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p, auth_struct.outgoing.count = 0; auth_struct.incoming.count = 0; - ndr_err = ndr_push_struct_blob(&auth_blob, tctx, lp_iconv_convenience(tctx->lp_ctx), &auth_struct, + ndr_err = ndr_push_struct_blob(&auth_blob, tctx, &auth_struct, (ndr_push_flags_fn_t)ndr_push_trustDomainPasswords); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { torture_comment(tctx, "ndr_push_struct_blob of trustDomainPasswords structure failed"); diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index eab835aad1..9358d44ca8 100644 --- a/source4/torture/rpc/remote_pac.c +++ b/source4/torture/rpc/remote_pac.c @@ -139,7 +139,7 @@ static bool test_PACVerify(struct torture_context *tctx, session_info->server_info->pac_kdc_sig.signature.data, pac_wrapped_struct.SignatureLength); - ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, lp_iconv_convenience(tctx->lp_ctx), &pac_wrapped_struct, + ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, &pac_wrapped_struct, (ndr_push_flags_fn_t)ndr_push_PAC_Validate); torture_assert(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), "ndr_push_struct_blob of PACValidate structure failed"); @@ -245,7 +245,7 @@ static bool test_PACVerify(struct torture_context *tctx, session_info->server_info->pac_kdc_sig.signature.data, pac_wrapped_struct.SignatureLength); - ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, lp_iconv_convenience(tctx->lp_ctx), &pac_wrapped_struct, + ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, &pac_wrapped_struct, (ndr_push_flags_fn_t)ndr_push_PAC_Validate); torture_assert(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), "ndr_push_struct_blob of PACValidate structure failed"); @@ -293,7 +293,7 @@ static bool test_PACVerify(struct torture_context *tctx, /* Break the signature length */ pac_wrapped_struct.SignatureLength++; - ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, lp_iconv_convenience(tctx->lp_ctx), &pac_wrapped_struct, + ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, &pac_wrapped_struct, (ndr_push_flags_fn_t)ndr_push_PAC_Validate); torture_assert(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), "ndr_push_struct_blob of PACValidate structure failed"); diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 96d2b5ca52..d09e80283a 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -84,7 +84,6 @@ bool torture_bind_authcontext(struct torture_context *torture) cmdline_credentials, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", @@ -92,8 +91,7 @@ bool torture_bind_authcontext(struct torture_context *torture) goto done; } - lsa_pipe = dcerpc_pipe_init(mem_ctx, cli->transport->socket->event.ctx, - lp_iconv_convenience(torture->lp_ctx)); + lsa_pipe = dcerpc_pipe_init(mem_ctx, cli->transport->socket->event.ctx); if (lsa_pipe == NULL) { torture_comment(torture, "dcerpc_pipe_init failed\n"); goto done; @@ -224,8 +222,7 @@ static bool bindtest(struct torture_context *tctx, } lsa_pipe = dcerpc_pipe_init(mem_ctx, - cli->transport->socket->event.ctx, - lp_iconv_convenience(tctx->lp_ctx)); + cli->transport->socket->event.ctx); if (lsa_pipe == NULL) { torture_comment(tctx, "dcerpc_pipe_init failed\n"); goto done; @@ -336,7 +333,6 @@ static bool torture_bind_samba3(struct torture_context *torture) cmdline_credentials, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", @@ -397,8 +393,7 @@ static bool get_usr_handle(struct torture_context *tctx, uint32_t user_rid,access_granted; samr_pipe = dcerpc_pipe_init(mem_ctx, - cli->transport->socket->event.ctx, - lp_iconv_convenience(tctx->lp_ctx)); + cli->transport->socket->event.ctx); torture_assert(tctx, samr_pipe, "dcerpc_pipe_init failed"); samr_handle = samr_pipe->binding_handle; @@ -953,8 +948,7 @@ static bool auth2(struct torture_context *tctx, } net_pipe = dcerpc_pipe_init(mem_ctx, - cli->transport->socket->event.ctx, - lp_iconv_convenience(tctx->lp_ctx)); + cli->transport->socket->event.ctx); if (net_pipe == NULL) { torture_comment(tctx, "dcerpc_pipe_init failed\n"); goto done; @@ -1070,8 +1064,7 @@ static bool schan(struct torture_context *tctx, } net_pipe = dcerpc_pipe_init(mem_ctx, - cli->transport->socket->event.ctx, - lp_iconv_convenience(tctx->lp_ctx)); + cli->transport->socket->event.ctx); if (net_pipe == NULL) { torture_comment(tctx, "dcerpc_pipe_init failed\n"); goto done; @@ -1342,7 +1335,6 @@ static bool torture_netlogon_samba3(struct torture_context *torture) anon_creds, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_comment(torture, "smbcli_full_connection failed: %s\n", @@ -1432,7 +1424,6 @@ static bool test_join3(struct torture_context *tctx, "IPC$", NULL, lp_socket_options(tctx->lp_ctx), smb_creds, lp_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); torture_assert_ntstatus_ok(tctx, status, "smbcli_full_connection failed"); @@ -1541,8 +1532,7 @@ static NTSTATUS pipe_bind_smb(struct torture_context *tctx, NTSTATUS status; if (!(result = dcerpc_pipe_init( - mem_ctx, tree->session->transport->socket->event.ctx, - lp_iconv_convenience(tctx->lp_ctx)))) { + mem_ctx, tree->session->transport->socket->event.ctx))) { return NT_STATUS_NO_MEMORY; } @@ -1809,10 +1799,8 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) mem_ctx, &cli, torture_setting_string(torture, "host", NULL), lp_smb_ports(torture->lp_ctx), "IPC$", NULL, lp_socket_options(torture->lp_ctx), cmdline_credentials, - lp_resolve_context(torture->lp_ctx), - torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), - lp_gensec_settings(torture, torture->lp_ctx)); + lp_resolve_context(torture->lp_ctx), torture->ev, &options, + &session_options, lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_warning(torture, "smbcli_full_connection failed: %s\n", nt_errstr(status)); @@ -1839,7 +1827,6 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture) lp_socket_options(torture->lp_ctx), anon_creds, lp_resolve_context(torture->lp_ctx), torture->ev, &options, &session_options, - lp_iconv_convenience(torture->lp_ctx), lp_gensec_settings(torture, torture->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { torture_warning(torture, "anon smbcli_full_connection failed: %s\n", @@ -2154,8 +2141,7 @@ static bool torture_samba3_rpc_randomauth2(struct torture_context *torture) } if (!(net_pipe = dcerpc_pipe_init( - mem_ctx, cli->transport->socket->event.ctx, - lp_iconv_convenience(torture->lp_ctx)))) { + mem_ctx, cli->transport->socket->event.ctx))) { torture_comment(torture, "dcerpc_pipe_init failed\n"); goto done; } @@ -2556,7 +2542,6 @@ static bool torture_samba3_rpc_lsa(struct torture_context *torture) } static NTSTATUS get_servername(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree, - struct smb_iconv_convenience *iconv_convenience, char **name) { struct rap_WserverGetInfo r; @@ -2566,7 +2551,7 @@ static NTSTATUS get_servername(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree, r.in.level = 0; r.in.bufsize = 0xffff; - status = smbcli_rap_netservergetinfo(tree, iconv_convenience, mem_ctx, &r); + status = smbcli_rap_netservergetinfo(tree, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -2592,7 +2577,7 @@ static bool rap_get_servername(struct torture_context *tctx, "IPC$ connection failed"); torture_assert_ntstatus_ok(tctx, - get_servername(tctx, cli->tree, lp_iconv_convenience(tctx->lp_ctx), servername), + get_servername(tctx, cli->tree, servername), "get_servername failed"); talloc_free(cli); @@ -3241,7 +3226,7 @@ static bool torture_samba3_setconfig(struct torture_context *tctx, "OpenKey failed"); torture_assert(tctx, - reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), "REG_SZ", value, &type, &val), + reg_string_to_val(tctx, "REG_SZ", value, &type, &val), "reg_string_to_val failed"); s.in.handle = &key_handle; diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c index 2da0041c73..c59e447443 100644 --- a/source4/torture/rpc/samlogon.c +++ b/source4/torture/rpc/samlogon.c @@ -65,7 +65,6 @@ struct samlogon_state { NTSTATUS expected_error; bool old_password; /* Allow an old password to be accepted or rejected without error, as well as session key bugs */ DATA_BLOB chall; - struct smb_iconv_convenience *iconv_convenience; }; /* @@ -1190,8 +1189,7 @@ static bool test_plaintext(struct samlogon_state *samlogon_state, enum ntlm_brea password = strupper_talloc(samlogon_state->mem_ctx, samlogon_state->password); - if (!convert_string_talloc_convenience(samlogon_state->mem_ctx, - samlogon_state->iconv_convenience, + if (!convert_string_talloc(samlogon_state->mem_ctx, CH_UNIX, CH_DOS, password, strlen(password)+1, (void**)&dospw, NULL, false)) { @@ -1372,7 +1370,6 @@ static bool test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, samlogon_state.chall = data_blob_talloc(fn_ctx, NULL, 8); samlogon_state.parameter_control = parameter_control; samlogon_state.old_password = old_password; - samlogon_state.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx); generate_random_buffer(samlogon_state.chall.data, 8); samlogon_state.r_flags.in.server_name = talloc_asprintf(fn_ctx, "\\\\%s", dcerpc_server_name(p)); diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index e59bf3a3a8..6e0d9471d1 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -598,7 +598,7 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct enum ndr_err_code ndr_err; data.data = user->user_private_info.SensitiveData; data.length = user->user_private_info.DataLength; - ndr_err = ndr_pull_struct_blob(&data, mem_ctx, lp_iconv_convenience(tctx->lp_ctx), &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS); + ndr_err = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS); if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { if (keys.keys.keys2.lmpassword.length == 16) { lm_hash_p = &lm_hash; diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 61d1bccaa4..efe975c76e 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -174,9 +174,9 @@ static bool test_AddPrinterDriver_args_level_3(struct torture_context *tctx, #define DO_ROUND(size, n) (((size)+((n)-1)) & ~((n)-1)) -#define CHECK_NEEDED_SIZE_ENUM_LEVEL(fn, info, level, count, ic, needed, align) do { \ +#define CHECK_NEEDED_SIZE_ENUM_LEVEL(fn, info, level, count, needed, align) do { \ if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\ - uint32_t size = ndr_size_##fn##_info(tctx, ic, level, count, info);\ + uint32_t size = ndr_size_##fn##_info(tctx, level, count, info);\ uint32_t round_size = DO_ROUND(size, align);\ if (round_size != needed) {\ torture_warning(tctx, __location__": "#fn" level %d (count: %d) got unexpected needed size: %d, we calculated: %d", level, count, needed, round_size);\ @@ -185,9 +185,9 @@ static bool test_AddPrinterDriver_args_level_3(struct torture_context *tctx, }\ } while(0) -#define CHECK_NEEDED_SIZE_ENUM(fn, info, count, ic, needed, align) do { \ +#define CHECK_NEEDED_SIZE_ENUM(fn, info, count, needed, align) do { \ if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\ - uint32_t size = ndr_size_##fn##_info(tctx, ic, count, info);\ + uint32_t size = ndr_size_##fn##_info(tctx, count, info);\ uint32_t round_size = DO_ROUND(size, align);\ if (round_size != needed) {\ torture_warning(tctx, __location__": "#fn" (count: %d) got unexpected needed size: %d, we calculated: %d", count, needed, round_size);\ @@ -196,9 +196,9 @@ static bool test_AddPrinterDriver_args_level_3(struct torture_context *tctx, }\ } while(0) -#define CHECK_NEEDED_SIZE_LEVEL(fn, info, level, ic, needed, align) do { \ +#define CHECK_NEEDED_SIZE_LEVEL(fn, info, level, needed, align) do { \ if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\ - uint32_t size = ndr_size_##fn(info, level, ic, 0);\ + uint32_t size = ndr_size_##fn(info, level, 0);\ uint32_t round_size = DO_ROUND(size, align);\ if (round_size != needed) {\ torture_warning(tctx, __location__": "#fn" level %d got unexpected needed size: %d, we calculated: %d", level, needed, round_size);\ @@ -323,7 +323,7 @@ static bool test_EnumPorts(struct torture_context *tctx, torture_assert(tctx, info, "EnumPorts returned no info"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPorts, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPorts, info, r.in.level, count, needed, 4); ctx->port_count[level] = count; ctx->ports[level] = info; @@ -414,7 +414,7 @@ static bool test_GetPrintProcessorDirectory(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "GetPrintProcessorDirectory failed"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_PrintProcessorDirectoryInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 2); + CHECK_NEEDED_SIZE_LEVEL(spoolss_PrintProcessorDirectoryInfo, r.out.info, r.in.level, needed, 2); } return true; @@ -479,7 +479,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "GetPrinterDriverDirectory failed"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverDirectoryInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 2); + CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverDirectoryInfo, r.out.info, r.in.level, needed, 2); } return true; @@ -533,7 +533,7 @@ static bool test_EnumPrinterDrivers_args(struct torture_context *tctx, *info_p = info; } - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers, info, r.in.level, count, needed, 4); return true; @@ -755,7 +755,7 @@ static bool test_EnumMonitors(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumMonitors failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumMonitors, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumMonitors, info, r.in.level, count, needed, 4); ctx->monitor_count[level] = count; ctx->monitors[level] = info; @@ -833,7 +833,7 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrintProcessors failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessors, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessors, info, r.in.level, count, needed, 4); ctx->print_processor_count[level] = count; ctx->print_processors[level] = info; @@ -908,7 +908,7 @@ static bool test_EnumPrintProcDataTypes(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrintProcDataTypes failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes, info, r.in.level, count, needed, 4); } @@ -961,7 +961,7 @@ static bool test_EnumPrinters(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinters failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinters, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinters, info, r.in.level, count, needed, 4); ctx->printer_count[level] = count; ctx->printers[level] = info; @@ -1080,7 +1080,7 @@ bool test_GetPrinter_level(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "GetPrinter failed"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterInfo, r.out.info, r.in.level, needed, 4); if (info && r.out.info) { *info = *r.out.info; @@ -2370,7 +2370,7 @@ static bool test_GetForm_args(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "GetForm failed"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_FormInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_LEVEL(spoolss_FormInfo, r.out.info, r.in.level, needed, 4); if (info_p) { *info_p = *r.out.info; @@ -2437,7 +2437,7 @@ static bool test_EnumForms(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumForms failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumForms, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumForms, info, r.in.level, count, needed, 4); if (info_p) { *info_p = info; @@ -2857,7 +2857,7 @@ static bool test_EnumPorts_old(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPorts failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPorts, info, 2, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPorts, info, 2, count, needed, 4); return true; } @@ -2934,7 +2934,7 @@ static bool test_GetJob_args(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "GetJob failed"); torture_assert(tctx, r.out.info, "No job info returned"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_JobInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_LEVEL(spoolss_JobInfo, r.out.info, r.in.level, needed, 4); if (info_p) { *info_p = *r.out.info; @@ -3083,7 +3083,7 @@ static bool test_EnumJobs_args(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumJobs failed"); torture_assert(tctx, info, "No jobs returned"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumJobs, *r.out.info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumJobs, *r.out.info, r.in.level, count, needed, 4); } else { torture_assert_werr_ok(tctx, r.out.result, "EnumJobs failed"); @@ -3375,7 +3375,7 @@ static bool test_GetPrinterData(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx, "GetPrinterData(%s) failed", r.in.value_name)); - CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterData, &data, type, lp_iconv_convenience(tctx->lp_ctx), needed, 1); + CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterData, &data, type, needed, 1); if (type_p) { *type_p = type; @@ -3437,7 +3437,7 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx, "GetPrinterDataEx(%s - %s) failed", r.in.key_name, r.in.value_name)); - CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterData, &data, type, lp_iconv_convenience(tctx->lp_ctx), needed, 1); + CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterData, &data, type, needed, 1); if (type_p) { *type_p = type; @@ -3471,7 +3471,7 @@ static bool test_get_environment(struct torture_context *tctx, torture_assert_int_equal(tctx, type, REG_SZ, "unexpected type"); blob = data_blob_const(data, needed); - *architecture = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob); + *architecture = reg_val_data_string(tctx, REG_SZ, blob); return true; } @@ -3515,7 +3515,7 @@ static bool test_GetPrinterData_list(struct torture_context *tctx, if (strequal(list[i], "Architecture")) { if (architecture) { DATA_BLOB blob = data_blob_const(data, needed); - *architecture = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob); + *architecture = reg_val_data_string(tctx, REG_SZ, blob); } } } @@ -3656,7 +3656,7 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinterDataEx failed"); - CHECK_NEEDED_SIZE_ENUM(spoolss_EnumPrinterDataEx, info, count, lp_iconv_convenience(tctx->lp_ctx), needed, 1); + CHECK_NEEDED_SIZE_ENUM(spoolss_EnumPrinterDataEx, info, count, needed, 1); if (count_p) { *count_p = count; @@ -3698,7 +3698,7 @@ static bool test_EnumPrinterData_consistency(struct torture_context *tctx, torture_comment(tctx, "Testing EnumPrinterData vs EnumPrinterDataEx consistency\n"); torture_assert(tctx, - reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), + reg_string_to_val(tctx, "REG_SZ", "torture_data1", &type, &blob), ""); torture_assert(tctx, @@ -4093,7 +4093,7 @@ static bool test_winreg_symbolic_link(struct torture_context *tctx, torture_assert_int_equal(tctx, w_type, REG_LINK, "unexpected type"); blob = data_blob(w_data, w_size); - str = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob); + str = reg_val_data_string(tctx, REG_SZ, blob); torture_assert_str_equal(tctx, str, symlink_destination, "unexpected symlink target string"); @@ -4162,7 +4162,7 @@ do {\ "failed to query winreg");\ torture_assert_int_equal(tctx, w_type, REG_SZ, "unexpected type");\ blob = data_blob(w_data, w_size);\ - str = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob);\ + str = reg_val_data_string(tctx, REG_SZ, blob);\ if (w_size == 2 && iname == NULL) {\ /*torture_comment(tctx, "%s: \"\", %s: (null)\n", #wname, #iname);\ */\ } else {\ @@ -4205,7 +4205,7 @@ do {\ "failed to query winreg");\ torture_assert_int_equal(tctx, w_type, REG_BINARY, "unexpected type");\ blob = data_blob(w_data, w_size);\ - ndr_err = ndr_pull_struct_blob(&blob, tctx, lp_iconv_convenience(tctx->lp_ctx), &dm,\ + ndr_err = ndr_pull_struct_blob(&blob, tctx, &dm,\ (ndr_pull_flags_fn_t)ndr_pull_spoolss_DeviceMode);\ torture_assert_ndr_success(tctx, ndr_err, "failed to unmarshall dm");\ torture_assert(tctx, test_devicemode_equal(tctx, &dm, iname),\ @@ -4227,7 +4227,7 @@ do {\ "failed to query winreg");\ torture_assert_int_equal(tctx, w_type, REG_BINARY, "unexpected type");\ blob = data_blob(w_data, w_size);\ - ndr_err = ndr_pull_struct_blob(&blob, tctx, lp_iconv_convenience(tctx->lp_ctx), &sd,\ + ndr_err = ndr_pull_struct_blob(&blob, tctx, &sd,\ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);\ torture_assert_ndr_success(tctx, ndr_err, "failed to unmarshall sd");\ torture_assert(tctx, test_security_descriptor_equal(tctx, &sd, iname),\ @@ -4250,7 +4250,7 @@ do {\ torture_assert_int_equal(tctx, w_type, REG_MULTI_SZ, "unexpected type");\ blob = data_blob(w_data, w_size);\ torture_assert(tctx, \ - pull_reg_multi_sz(tctx, lp_iconv_convenience(tctx->lp_ctx), &blob, &array),\ + pull_reg_multi_sz(tctx, &blob, &array),\ "failed to pull multi sz");\ for (i=0; array[i] != NULL; i++) {\ torture_assert_str_equal(tctx, array[i], iname[i],\ @@ -4591,7 +4591,7 @@ static bool test_SetPrinterData_matrix(struct torture_context *tctx, uint32_t needed; torture_assert(tctx, - reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), + reg_string_to_val(tctx, "REG_SZ", "dog", &type, &blob), ""); torture_assert(tctx, @@ -4748,14 +4748,14 @@ static bool test_SetPrinterDataEx_matrix(struct torture_context *tctx, break; case REG_SZ: torture_assert(tctx, - reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), + reg_string_to_val(tctx, "REG_SZ", string, &type, &data), ""); offered = data.length; /*strlen_m_term(data.string)*2;*/ break; case REG_MULTI_SZ: torture_assert(tctx, - reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), + reg_string_to_val(tctx, "REG_SZ", string, &type, &data), ""); torture_assert(tctx, data_blob_realloc(tctx, &data, data.length + 2), ""); memset(&data.data[data.length - 2], '\0', 2); @@ -5004,7 +5004,7 @@ do {\ torture_assert_int_equal(tctx, type, REG_SZ, "unexpected type");\ blob = data_blob_const(data, needed);\ torture_assert(tctx,\ - pull_reg_sz(tctx, lp_iconv_convenience(tctx->lp_ctx), &blob, &str),\ + pull_reg_sz(tctx, &blob, &str),\ "failed to pull REG_SZ");\ torture_assert_str_equal(tctx, str, iname, "unexpected result");\ } while(0); @@ -5027,7 +5027,7 @@ do {\ torture_assert_int_equal(tctx, type, REG_SZ, "unexpected type");\ blob = data_blob_const(data, needed);\ torture_assert(tctx,\ - pull_reg_sz(tctx, lp_iconv_convenience(tctx->lp_ctx), &blob, &str),\ + pull_reg_sz(tctx, &blob, &str),\ "failed to pull REG_SZ");\ torture_assert_str_equal(tctx, str, val, "unexpected result");\ } while(0); @@ -5675,7 +5675,7 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinters failed"); - CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinters, info, r.in.level, count, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_ENUM_LEVEL(spoolss_EnumPrinters, info, r.in.level, count, needed, 4); if (!info) { torture_comment(tctx, "No printers returned\n"); @@ -5738,7 +5738,7 @@ static bool test_GetPrinterDriver(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "failed to call GetPrinterDriver"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverInfo, r.out.info, r.in.level, needed, 4); return true; } @@ -5806,7 +5806,7 @@ static bool test_GetPrinterDriver2_level(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "failed to call GetPrinterDriver2"); - CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4); + CHECK_NEEDED_SIZE_LEVEL(spoolss_DriverInfo, r.out.info, r.in.level, needed, 4); if (info_p) { *info_p = *r.out.info; @@ -7658,7 +7658,6 @@ static bool connect_printer_driver_share(struct torture_context *tctx, tctx->ev, &smb_options, &smb_session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)), "failed to open driver share"); diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index 47efb77bfb..8f9ec1aed8 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -438,7 +438,7 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_ blob.length = r.in.offered; blob.data = talloc_steal(tctx, r.out.service); - ndr = ndr_pull_init_blob(&blob, tctx, lp_iconv_convenience(tctx->lp_ctx)); + ndr = ndr_pull_init_blob(&blob, tctx); service = talloc_array(tctx, struct ENUM_SERVICE_STATUSW, services_returned); if (!service) { diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 3da8c9125a..216a30c7a8 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -193,7 +193,7 @@ static bool test_CreateKey_sd(struct dcerpc_binding_handle *b, NULL); torture_assert_ndr_success(tctx, - ndr_push_struct_blob(&sdblob, tctx, NULL, sd, + ndr_push_struct_blob(&sdblob, tctx, sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor), "Failed to push security_descriptor ?!\n"); @@ -260,7 +260,7 @@ static bool _test_GetKeySecurity(struct dcerpc_pipe *p, sd = talloc_zero(tctx, struct security_descriptor); torture_assert_ndr_success(tctx, - ndr_pull_struct_blob(&sdblob, tctx, NULL, sd, + ndr_pull_struct_blob(&sdblob, tctx, sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor), "pull_security_descriptor failed"); @@ -305,7 +305,7 @@ static bool _test_SetKeySecurity(struct dcerpc_pipe *p, } torture_assert_ndr_success(tctx, - ndr_push_struct_blob(&sdblob, tctx, NULL, sd, + ndr_push_struct_blob(&sdblob, tctx, sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor), "push_security_descriptor failed"); diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index 2068d5d97c..32cc9ac487 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -62,7 +62,6 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx) cmdline_credentials, lp_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index f07c619b30..c1849962a3 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -85,7 +85,6 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx, share, NULL, lp_socket_options(tctx->lp_ctx), creds, lp_resolve_context(tctx->lp_ctx), tctx->ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 216927ce70..708055096b 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -515,7 +515,6 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx, cmdline_credentials, lp_resolve_context(tctx->lp_ctx), ev, &options, &session_options, - lp_iconv_convenience(tctx->lp_ctx), lp_gensec_settings(tctx, tctx->lp_ctx)); if (!NT_STATUS_IS_OK(status)) { printf("Failed to open connection - %s\n", nt_errstr(status)); diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index e3a43c7727..c5d37e82c9 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -489,8 +489,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, const char *winbind_method[] = { "winbind", NULL }; struct auth_context *auth_context; - msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), - lp_iconv_convenience(lp_ctx), ev); + msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev); if (!msg) { talloc_free(mem_ctx); exit(1); diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c index fc7b8d447d..4a99ac58c5 100644 --- a/source4/winbind/idmap.c +++ b/source4/winbind/idmap.c @@ -97,9 +97,7 @@ static int idmap_msg_add_dom_sid(struct idmap_context *idmap_ctx, struct ldb_val val; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&val, mem_ctx, - lp_iconv_convenience(idmap_ctx->lp_ctx), - sid, + ndr_err = ndr_push_struct_blob(&val, mem_ctx, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -134,7 +132,7 @@ static struct dom_sid *idmap_msg_get_dom_sid(TALLOC_CTX *mem_ctx, return NULL; } - ndr_err = ndr_pull_struct_blob(val, sid, NULL, sid, + ndr_err = ndr_pull_struct_blob(val, sid, sid, (ndr_pull_flags_fn_t)ndr_pull_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(sid); diff --git a/source4/winbind/wb_dom_info.c b/source4/winbind/wb_dom_info.c index bce8bfbe55..b6ec7dd67f 100644 --- a/source4/winbind/wb_dom_info.c +++ b/source4/winbind/wb_dom_info.c @@ -68,7 +68,6 @@ struct composite_context *wb_get_dom_info_send(TALLOC_CTX *mem_ctx, lp_nbt_port(service->task->lp_ctx), domain_name, NBT_NAME_LOGON, dom_sid, - lp_iconv_convenience(service->task->lp_ctx), lp_resolve_context(service->task->lp_ctx), service->task->event_ctx, service->task->msg_ctx); diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c index 7b1aa98266..9346cd5c38 100644 --- a/source4/winbind/wb_pam_auth.c +++ b/source4/winbind/wb_pam_auth.c @@ -141,8 +141,7 @@ static void pam_auth_crap_recv_logon(struct composite_context *ctx) if (!composite_is_ok(state->ctx)) return; ndr_err = ndr_push_struct_blob( - &tmp_blob, state, lp_iconv_convenience(state->lp_ctx), - state->req->out.validation.sam3, + &tmp_blob, state, state->req->out.validation.sam3, (ndr_push_flags_fn_t)ndr_push_netr_SamInfo3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { state->ctx->status = ndr_map_error2ntstatus(ndr_err); diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index f0f7aa8526..fcb587a007 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -54,7 +54,6 @@ static NTSTATUS wb_samba3_append_info3_as_txt(TALLOC_CTX *mem_ctx, ndr_err = ndr_pull_struct_blob(&info3b, mem_ctx, - lp_iconv_convenience(s3call->wbconn->lp_ctx), info3, (ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c index 91a39400de..aee6e4920f 100644 --- a/source4/wrepl_server/wrepl_in_call.c +++ b/source4/wrepl_server/wrepl_in_call.c @@ -359,8 +359,8 @@ static NTSTATUS wreplsrv_in_update(struct wreplsrv_in_call *call) wrepl_out->assoc_ctx.our_ctx = wrepl_in->assoc_ctx.our_ctx; wrepl_out->assoc_ctx.peer_ctx = wrepl_in->assoc_ctx.peer_ctx; wrepl_out->sock = wrepl_socket_init(wrepl_out, - wrepl_in->conn->event.ctx, - lp_iconv_convenience(wrepl_in->service->task->lp_ctx)); + wrepl_in->conn->event.ctx); + NT_STATUS_HAVE_NO_MEMORY_AND_FREE(wrepl_out->sock, update_state); TALLOC_FREE(wrepl_in->send_queue); diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c index 09fb3255fb..364ebc7fa9 100644 --- a/source4/wrepl_server/wrepl_in_connection.c +++ b/source4/wrepl_server/wrepl_in_connection.c @@ -52,7 +52,6 @@ static NTSTATUS wreplsrv_process(struct wreplsrv_in_connection *wrepl_conn, struct wreplsrv_in_call *call = *_call; ndr_err = ndr_pull_struct_blob(&call->in, call, - lp_iconv_convenience(wrepl_conn->service->task->lp_ctx), &call->req_packet, (ndr_pull_flags_fn_t)ndr_pull_wrepl_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -78,7 +77,6 @@ static NTSTATUS wreplsrv_process(struct wreplsrv_in_connection *wrepl_conn, /* and now encode the reply */ packet_out_wrap.packet = call->rep_packet; ndr_err = ndr_push_struct_blob(&call->out, call, - lp_iconv_convenience(wrepl_conn->service->task->lp_ctx), &packet_out_wrap, (ndr_push_flags_fn_t) ndr_push_wrepl_wrap); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c index 5c15ac8d87..dcbc888a8d 100644 --- a/source4/wrepl_server/wrepl_out_helpers.c +++ b/source4/wrepl_server/wrepl_out_helpers.c @@ -187,7 +187,7 @@ static struct composite_context *wreplsrv_out_connect_send(struct wreplsrv_partn wreplconn->service = service; wreplconn->partner = partner; - wreplconn->sock = wrepl_socket_init(wreplconn, service->task->event_ctx, lp_iconv_convenience(service->task->lp_ctx)); + wreplconn->sock = wrepl_socket_init(wreplconn, service->task->event_ctx); if (!wreplconn->sock) goto failed; state->stage = WREPLSRV_OUT_CONNECT_STAGE_WAIT_SOCKET; |