From f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 9 May 2010 17:20:01 +0200 Subject: Finish removal of iconv_convenience in public API's. --- libcli/auth/ntlmssp_ndr.c | 22 ++++++++-------------- libcli/auth/ntlmssp_ndr.h | 6 ------ libcli/auth/schannel_state.h | 3 --- libcli/auth/schannel_state_tdb.c | 17 ++++++----------- libcli/cldap/cldap.c | 7 +------ libcli/cldap/cldap.h | 3 --- libcli/ldap/ldap_ndr.c | 4 ++-- libcli/named_pipe_auth/npa_tstream.c | 7 ++----- libcli/named_pipe_auth/npa_tstream.h | 1 - libcli/nbt/libnbt.h | 6 ++---- libcli/nbt/nbtname.c | 6 +++--- libcli/nbt/nbtsocket.c | 8 ++------ libcli/nbt/pynbt.c | 12 ++++++------ libcli/nbt/tools/nmblookup.c | 2 +- libcli/ndr_netlogon.c | 6 +++--- libcli/netlogon.c | 17 +++-------------- libcli/netlogon_proto.h | 4 ---- libcli/registry/util_reg.c | 19 ++++++++----------- libcli/samsync/decrypt.c | 2 +- libcli/security/secace.c | 4 ++-- 20 files changed, 50 insertions(+), 106 deletions(-) (limited to 'libcli') diff --git a/libcli/auth/ntlmssp_ndr.c b/libcli/auth/ntlmssp_ndr.c index 53a2378e20..8f15044e1a 100644 --- a/libcli/auth/ntlmssp_ndr.c +++ b/libcli/auth/ntlmssp_ndr.c @@ -22,10 +22,10 @@ #include "../librpc/gen_ndr/ndr_ntlmssp.h" #include "../libcli/auth/ntlmssp_ndr.h" -#define NTLMSSP_PULL_MESSAGE(type, blob, mem_ctx, ic, r) \ +#define NTLMSSP_PULL_MESSAGE(type, blob, mem_ctx, r) \ do { \ enum ndr_err_code __ndr_err; \ - __ndr_err = ndr_pull_struct_blob(blob, mem_ctx, ic, r, \ + __ndr_err = ndr_pull_struct_blob(blob, mem_ctx, r, \ (ndr_pull_flags_fn_t)ndr_pull_ ##type); \ if (!NDR_ERR_CODE_IS_SUCCESS(__ndr_err)) { \ return ndr_map_error2ntstatus(__ndr_err); \ @@ -58,10 +58,9 @@ do { \ NTSTATUS ntlmssp_pull_NEGOTIATE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct NEGOTIATE_MESSAGE *r) { - NTLMSSP_PULL_MESSAGE(NEGOTIATE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PULL_MESSAGE(NEGOTIATE_MESSAGE, blob, mem_ctx, r); } /** @@ -74,10 +73,9 @@ NTSTATUS ntlmssp_pull_NEGOTIATE_MESSAGE(const DATA_BLOB *blob, NTSTATUS ntlmssp_pull_CHALLENGE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct CHALLENGE_MESSAGE *r) { - NTLMSSP_PULL_MESSAGE(CHALLENGE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PULL_MESSAGE(CHALLENGE_MESSAGE, blob, mem_ctx, r); } /** @@ -90,10 +88,9 @@ NTSTATUS ntlmssp_pull_CHALLENGE_MESSAGE(const DATA_BLOB *blob, NTSTATUS ntlmssp_pull_AUTHENTICATE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct AUTHENTICATE_MESSAGE *r) { - NTLMSSP_PULL_MESSAGE(AUTHENTICATE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PULL_MESSAGE(AUTHENTICATE_MESSAGE, blob, mem_ctx, r); } /** @@ -106,10 +103,9 @@ NTSTATUS ntlmssp_pull_AUTHENTICATE_MESSAGE(const DATA_BLOB *blob, NTSTATUS ntlmssp_push_NEGOTIATE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct NEGOTIATE_MESSAGE *r) { - NTLMSSP_PUSH_MESSAGE(NEGOTIATE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PUSH_MESSAGE(NEGOTIATE_MESSAGE, blob, mem_ctx, r); } /** @@ -122,10 +118,9 @@ NTSTATUS ntlmssp_push_NEGOTIATE_MESSAGE(DATA_BLOB *blob, NTSTATUS ntlmssp_push_CHALLENGE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct CHALLENGE_MESSAGE *r) { - NTLMSSP_PUSH_MESSAGE(CHALLENGE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PUSH_MESSAGE(CHALLENGE_MESSAGE, blob, mem_ctx, r); } /** @@ -138,8 +133,7 @@ NTSTATUS ntlmssp_push_CHALLENGE_MESSAGE(DATA_BLOB *blob, NTSTATUS ntlmssp_push_AUTHENTICATE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct AUTHENTICATE_MESSAGE *r) { - NTLMSSP_PUSH_MESSAGE(AUTHENTICATE_MESSAGE, blob, mem_ctx, ic, r); + NTLMSSP_PUSH_MESSAGE(AUTHENTICATE_MESSAGE, blob, mem_ctx, r); } diff --git a/libcli/auth/ntlmssp_ndr.h b/libcli/auth/ntlmssp_ndr.h index 52990b2a56..e61923170e 100644 --- a/libcli/auth/ntlmssp_ndr.h +++ b/libcli/auth/ntlmssp_ndr.h @@ -20,25 +20,19 @@ NTSTATUS ntlmssp_pull_NEGOTIATE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct NEGOTIATE_MESSAGE *r); NTSTATUS ntlmssp_pull_CHALLENGE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct CHALLENGE_MESSAGE *r); NTSTATUS ntlmssp_pull_AUTHENTICATE_MESSAGE(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct AUTHENTICATE_MESSAGE *r); NTSTATUS ntlmssp_push_NEGOTIATE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct NEGOTIATE_MESSAGE *r); NTSTATUS ntlmssp_push_CHALLENGE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct CHALLENGE_MESSAGE *r); NTSTATUS ntlmssp_push_AUTHENTICATE_MESSAGE(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const struct AUTHENTICATE_MESSAGE *r); diff --git a/libcli/auth/schannel_state.h b/libcli/auth/schannel_state.h index d378a39d8f..017fdbe28d 100644 --- a/libcli/auth/schannel_state.h +++ b/libcli/auth/schannel_state.h @@ -24,18 +24,15 @@ #define _LIBCLI_AUTH_SCHANNEL_STATE_H__ NTSTATUS schannel_get_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, const char *computer_name, struct netlogon_creds_CredentialState **creds); NTSTATUS schannel_save_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, struct netlogon_creds_CredentialState *creds); NTSTATUS schannel_check_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, const char *computer_name, struct netr_Authenticator *received_authenticator, diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c index 3f6618c744..9e767810a1 100644 --- a/libcli/auth/schannel_state_tdb.c +++ b/libcli/auth/schannel_state_tdb.c @@ -103,7 +103,6 @@ static struct tdb_wrap *open_schannel_session_store(TALLOC_CTX *mem_ctx, static NTSTATUS schannel_store_session_key_tdb(struct tdb_wrap *tdb_sc, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, struct netlogon_creds_CredentialState *creds) { enum ndr_err_code ndr_err; @@ -125,7 +124,7 @@ NTSTATUS schannel_store_session_key_tdb(struct tdb_wrap *tdb_sc, return NT_STATUS_NO_MEMORY; } - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, ic, creds, + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, creds, (ndr_push_flags_fn_t)ndr_push_netlogon_creds_CredentialState); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(keystr); @@ -161,7 +160,6 @@ NTSTATUS schannel_store_session_key_tdb(struct tdb_wrap *tdb_sc, static NTSTATUS schannel_fetch_session_key_tdb(struct tdb_wrap *tdb_sc, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *computer_name, struct netlogon_creds_CredentialState **pcreds) { @@ -203,7 +201,7 @@ NTSTATUS schannel_fetch_session_key_tdb(struct tdb_wrap *tdb_sc, blob = data_blob_const(value.dptr, value.dsize); - ndr_err = ndr_pull_struct_blob(&blob, creds, ic, creds, + ndr_err = ndr_pull_struct_blob(&blob, creds, creds, (ndr_pull_flags_fn_t)ndr_pull_netlogon_creds_CredentialState); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -240,7 +238,6 @@ NTSTATUS schannel_fetch_session_key_tdb(struct tdb_wrap *tdb_sc, *******************************************************************************/ NTSTATUS schannel_get_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, const char *computer_name, struct netlogon_creds_CredentialState **_creds) @@ -260,7 +257,7 @@ NTSTATUS schannel_get_creds_state(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } - status = schannel_fetch_session_key_tdb(tdb_sc, tmpctx, ic, + status = schannel_fetch_session_key_tdb(tdb_sc, tmpctx, computer_name, &creds); if (NT_STATUS_IS_OK(status)) { *_creds = talloc_steal(mem_ctx, creds); @@ -279,7 +276,6 @@ NTSTATUS schannel_get_creds_state(TALLOC_CTX *mem_ctx, *******************************************************************************/ NTSTATUS schannel_save_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, struct netlogon_creds_CredentialState *creds) { @@ -297,7 +293,7 @@ NTSTATUS schannel_save_creds_state(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } - status = schannel_store_session_key_tdb(tdb_sc, tmpctx, ic, creds); + status = schannel_store_session_key_tdb(tdb_sc, tmpctx, creds); talloc_free(tmpctx); return status; @@ -314,7 +310,6 @@ NTSTATUS schannel_save_creds_state(TALLOC_CTX *mem_ctx, ********************************************************************/ NTSTATUS schannel_check_creds_state(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *ic, const char *db_priv_dir, const char *computer_name, struct netr_Authenticator *received_authenticator, @@ -348,7 +343,7 @@ NTSTATUS schannel_check_creds_state(TALLOC_CTX *mem_ctx, * disconnects) we must update the database every time we * update the structure */ - status = schannel_fetch_session_key_tdb(tdb_sc, tmpctx, ic, + status = schannel_fetch_session_key_tdb(tdb_sc, tmpctx, computer_name, &creds); if (!NT_STATUS_IS_OK(status)) { tdb_transaction_cancel(tdb_sc->tdb); @@ -363,7 +358,7 @@ NTSTATUS schannel_check_creds_state(TALLOC_CTX *mem_ctx, goto done; } - status = schannel_store_session_key_tdb(tdb_sc, tmpctx, ic, creds); + status = schannel_store_session_key_tdb(tdb_sc, tmpctx, creds); if (!NT_STATUS_IS_OK(status)) { tdb_transaction_cancel(tdb_sc->tdb); goto done; diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index 191d0eeee4..896319e75c 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -946,7 +946,6 @@ static void cldap_netlogon_state_done(struct tevent_req *subreq) receive a cldap netlogon reply */ NTSTATUS cldap_netlogon_recv(struct tevent_req *req, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct cldap_netlogon *io) { @@ -974,7 +973,6 @@ NTSTATUS cldap_netlogon_recv(struct tevent_req *req, data = state->search.out.response->attributes[0].values; status = pull_netlogon_samlogon_response(data, mem_ctx, - iconv_convenience, &io->out.netlogon); if (!NT_STATUS_IS_OK(status)) { goto failed; @@ -994,7 +992,6 @@ failed: sync cldap netlogon search */ NTSTATUS cldap_netlogon(struct cldap_socket *cldap, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct cldap_netlogon *io) { @@ -1017,7 +1014,7 @@ NTSTATUS cldap_netlogon(struct cldap_socket *cldap, return NT_STATUS_INTERNAL_ERROR; } - status = cldap_netlogon_recv(req, iconv_convenience, mem_ctx, io); + status = cldap_netlogon_recv(req, mem_ctx, io); talloc_free(req); return status; @@ -1081,7 +1078,6 @@ NTSTATUS cldap_error_reply(struct cldap_socket *cldap, send a netlogon reply */ NTSTATUS cldap_netlogon_reply(struct cldap_socket *cldap, - struct smb_iconv_convenience *iconv_convenience, uint32_t message_id, struct tsocket_address *dest, uint32_t version, @@ -1095,7 +1091,6 @@ NTSTATUS cldap_netlogon_reply(struct cldap_socket *cldap, DATA_BLOB blob; status = push_netlogon_samlogon_response(&blob, tmp_ctx, - iconv_convenience, netlogon); if (!NT_STATUS_IS_OK(status)) { talloc_free(tmp_ctx); diff --git a/libcli/cldap/cldap.h b/libcli/cldap/cldap.h index 111fa2cfc4..d05e5b9936 100644 --- a/libcli/cldap/cldap.h +++ b/libcli/cldap/cldap.h @@ -116,16 +116,13 @@ struct tevent_req *cldap_netlogon_send(TALLOC_CTX *mem_ctx, struct cldap_socket *cldap, const struct cldap_netlogon *io); NTSTATUS cldap_netlogon_recv(struct tevent_req *req, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct cldap_netlogon *io); NTSTATUS cldap_netlogon(struct cldap_socket *cldap, - struct smb_iconv_convenience *iconv_convenience, TALLOC_CTX *mem_ctx, struct cldap_netlogon *io); NTSTATUS cldap_netlogon_reply(struct cldap_socket *cldap, - struct smb_iconv_convenience *iconv_convenience, uint32_t message_id, struct tsocket_address *dst, uint32_t version, diff --git a/libcli/ldap/ldap_ndr.c b/libcli/ldap/ldap_ndr.c index c176d0e1e0..3b40fbba25 100644 --- a/libcli/ldap/ldap_ndr.c +++ b/libcli/ldap/ldap_ndr.c @@ -51,7 +51,7 @@ char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) DATA_BLOB blob; enum ndr_err_code ndr_err; char *ret; - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, sid, + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return NULL; @@ -89,7 +89,7 @@ NTSTATUS ldap_decode_ndr_GUID(TALLOC_CTX *mem_ctx, struct ldb_val val, struct GU blob.data = val.data; blob.length = val.length; - ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, guid, + ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, guid, (ndr_pull_flags_fn_t)ndr_pull_GUID); talloc_free(val.data); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c index b41fa3eb6d..20228a2df2 100644 --- a/libcli/named_pipe_auth/npa_tstream.c +++ b/libcli/named_pipe_auth/npa_tstream.c @@ -39,7 +39,6 @@ struct tstream_npa { struct tstream_npa_connect_state { struct { struct tevent_context *ev; - struct smb_iconv_convenience *smb_iconv_c; } caller; const char *unix_path; @@ -59,7 +58,6 @@ static void tstream_npa_connect_unix_done(struct tevent_req *subreq); struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct smb_iconv_convenience *smb_iconv_c, const char *directory, const char *npipe, const struct tsocket_address *client, @@ -83,7 +81,6 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, } state->caller.ev = ev; - state->caller.smb_iconv_c = smb_iconv_c; state->unix_path = talloc_asprintf(state, "%s/%s", directory, @@ -161,7 +158,7 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, } ndr_err = ndr_push_struct_blob(&state->auth_req_blob, - state, smb_iconv_c, &state->auth_req, + state, &state->auth_req, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { tevent_req_error(req, EINVAL); @@ -343,7 +340,7 @@ static void tstream_npa_connect_readv_done(struct tevent_req *subreq) ndr_err = ndr_pull_struct_blob( &state->auth_rep_blob, state, - state->caller.smb_iconv_c, &state->auth_rep, + &state->auth_rep, (ndr_pull_flags_fn_t)ndr_pull_named_pipe_auth_rep); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/libcli/named_pipe_auth/npa_tstream.h b/libcli/named_pipe_auth/npa_tstream.h index bff010f094..7a19e10410 100644 --- a/libcli/named_pipe_auth/npa_tstream.h +++ b/libcli/named_pipe_auth/npa_tstream.h @@ -26,7 +26,6 @@ struct netr_SamInfo3; struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct smb_iconv_convenience *smb_iconv_c, const char *directory, const char *npipe, const struct tsocket_address *client, diff --git a/libcli/nbt/libnbt.h b/libcli/nbt/libnbt.h index e150b35566..6165548320 100644 --- a/libcli/nbt/libnbt.h +++ b/libcli/nbt/libnbt.h @@ -95,7 +95,6 @@ struct nbt_name_request { struct nbt_name_socket { struct socket_context *sock; struct tevent_context *event_ctx; - struct smb_iconv_convenience *iconv_convenience; /* a queue of requests pending to be sent */ struct nbt_name_request *send_queue; @@ -275,8 +274,7 @@ struct nbt_name_release { }; struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, - struct tevent_context *event_ctx, - struct smb_iconv_convenience *iconv_convenience); + struct tevent_context *event_ctx); void nbt_name_socket_handle_response_packet(struct nbt_name_request *req, struct nbt_name_packet *packet, struct socket_address *src); @@ -294,7 +292,7 @@ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock, TALLOC_CTX *mem_ctx, struct nbt_name_status *io); NTSTATUS nbt_name_dup(TALLOC_CTX *mem_ctx, struct nbt_name *name, struct nbt_name *newname); -NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, DATA_BLOB *blob, struct nbt_name *name); +NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct nbt_name *name); NTSTATUS nbt_name_from_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, struct nbt_name *name); void nbt_choose_called_name(TALLOC_CTX *mem_ctx, struct nbt_name *n, const char *name, int type); char *nbt_name_string(TALLOC_CTX *mem_ctx, const struct nbt_name *name); diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c index 385905abf1..3f0a1228e7 100644 --- a/libcli/nbt/nbtname.c +++ b/libcli/nbt/nbtname.c @@ -381,11 +381,11 @@ _PUBLIC_ NTSTATUS nbt_name_dup(TALLOC_CTX *mem_ctx, struct nbt_name *name, struc /** push a nbt name into a blob */ -_PUBLIC_ NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, DATA_BLOB *blob, struct nbt_name *name) +_PUBLIC_ NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct nbt_name *name) { enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(blob, mem_ctx, iconv_convenience, name, (ndr_push_flags_fn_t)ndr_push_nbt_name); + ndr_err = ndr_push_struct_blob(blob, mem_ctx, name, (ndr_push_flags_fn_t)ndr_push_nbt_name); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } @@ -400,7 +400,7 @@ _PUBLIC_ NTSTATUS nbt_name_from_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, { enum ndr_err_code ndr_err; - ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, name, + ndr_err = ndr_pull_struct_blob(blob, mem_ctx, name, (ndr_pull_flags_fn_t)ndr_pull_nbt_name); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c index d9bc72e499..2b792c5e2d 100644 --- a/libcli/nbt/nbtsocket.c +++ b/libcli/nbt/nbtsocket.c @@ -191,7 +191,7 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock) } /* parse the request */ - ndr_err = ndr_pull_struct_blob(&blob, packet, nbtsock->iconv_convenience, packet, + ndr_err = ndr_pull_struct_blob(&blob, packet, packet, (ndr_pull_flags_fn_t)ndr_pull_nbt_name_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { status = ndr_map_error2ntstatus(ndr_err); @@ -332,8 +332,7 @@ static void nbt_name_socket_handler(struct tevent_context *ev, struct tevent_fd then operations will use that event context */ _PUBLIC_ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, - struct tevent_context *event_ctx, - struct smb_iconv_convenience *iconv_convenience) + struct tevent_context *event_ctx) { struct nbt_name_socket *nbtsock; NTSTATUS status; @@ -358,7 +357,6 @@ _PUBLIC_ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, nbtsock->num_pending = 0; nbtsock->incoming.handler = NULL; nbtsock->unexpected.handler = NULL; - nbtsock->iconv_convenience = iconv_convenience; nbtsock->fde = event_add_fd(nbtsock->event_ctx, nbtsock, socket_get_fd(nbtsock->sock), 0, @@ -416,7 +414,6 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock, talloc_set_destructor(req, nbt_name_request_destructor); ndr_err = ndr_push_struct_blob(&req->encoded, req, - req->nbtsock->iconv_convenience, request, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) goto failed; @@ -465,7 +462,6 @@ _PUBLIC_ NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock, } ndr_err = ndr_push_struct_blob(&req->encoded, req, - req->nbtsock->iconv_convenience, request, (ndr_push_flags_fn_t)ndr_push_nbt_name_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c index 425ad13c6d..dbb4d18237 100644 --- a/libcli/nbt/pynbt.c +++ b/libcli/nbt/pynbt.c @@ -52,7 +52,7 @@ static PyObject *py_nbt_node_init(PyTypeObject *self, PyObject *args, PyObject * return NULL; ev = s4_event_context_init(ret->mem_ctx); - ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, py_iconv_convenience(ret->mem_ctx)); + ret->socket = nbt_name_socket_init(ret->mem_ctx, ev); return (PyObject *)ret; } @@ -124,7 +124,7 @@ static bool PyObject_AsNBTName(PyObject *obj, struct nbt_name_socket *name_socke return false; } -static PyObject *PyObject_FromNBTName(struct nbt_name_socket *name_socket, struct smb_iconv_convenience *ic, +static PyObject *PyObject_FromNBTName(struct nbt_name_socket *name_socket, struct nbt_name *name) { if (name->scope) { @@ -175,7 +175,7 @@ static PyObject *py_nbt_name_query(PyObject *self, PyObject *args, PyObject *kwa return NULL; PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); - py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(node->socket), &io.out.name); + py_name = PyObject_FromNBTName(node->socket, &io.out.name); if (py_name == NULL) return NULL; @@ -233,7 +233,7 @@ static PyObject *py_nbt_name_status(PyObject *self, PyObject *args, PyObject *kw return NULL; PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); - py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL), &io.out.name); + py_name = PyObject_FromNBTName(node->socket, &io.out.name); if (py_name == NULL) return NULL; @@ -296,7 +296,7 @@ static PyObject *py_nbt_name_register(PyObject *self, PyObject *args, PyObject * return NULL; PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); - py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL), &io.out.name); + py_name = PyObject_FromNBTName(node->socket, &io.out.name); if (py_name == NULL) return NULL; @@ -351,7 +351,7 @@ static PyObject *py_nbt_name_refresh(PyObject *self, PyObject *args, PyObject *k return NULL; PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); - py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL), &io.out.name); + py_name = PyObject_FromNBTName(node->socket, &io.out.name); if (py_name == NULL) return NULL; diff --git a/libcli/nbt/tools/nmblookup.c b/libcli/nbt/tools/nmblookup.c index 96023f64c3..b756c1e30c 100644 --- a/libcli/nbt/tools/nmblookup.c +++ b/libcli/nbt/tools/nmblookup.c @@ -212,7 +212,7 @@ static bool process_one(struct loadparm_context *lp_ctx, struct tevent_context * node_name = talloc_strdup(tmp_ctx, name); } - nbtsock = nbt_name_socket_init(tmp_ctx, ev, lp_iconv_convenience(lp_ctx)); + nbtsock = nbt_name_socket_init(tmp_ctx, ev); if (options.root_port) { all_zero_addr = socket_address_from_strings(tmp_ctx, nbtsock->sock->backend_name, diff --git a/libcli/ndr_netlogon.c b/libcli/ndr_netlogon.c index 1c6b2bccb6..d15154d2c9 100644 --- a/libcli/ndr_netlogon.c +++ b/libcli/ndr_netlogon.c @@ -137,12 +137,12 @@ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_ NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site)); NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site)); if (r->nt_version & NETLOGON_NT_VERSION_5EX_WITH_IP) { - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); { struct ndr_push *_ndr_sockaddr; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS|NDR_BUFFERS, &r->sockaddr)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->iconv_convenience, ndr->flags))); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags))); } } if (r->nt_version & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) { diff --git a/libcli/netlogon.c b/libcli/netlogon.c index 9ad941cfb6..e32842ec0a 100644 --- a/libcli/netlogon.c +++ b/libcli/netlogon.c @@ -30,23 +30,19 @@ #define DEBUGLEVEL 0 NTSTATUS push_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct netlogon_samlogon_response *response) { enum ndr_err_code ndr_err; if (response->ntver == NETLOGON_NT_VERSION_1) { ndr_err = ndr_push_struct_blob(data, mem_ctx, - iconv_convenience, &response->data.nt4, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40); } else if (response->ntver & NETLOGON_NT_VERSION_5EX) { ndr_err = ndr_push_struct_blob(data, mem_ctx, - iconv_convenience, &response->data.nt5_ex, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags); } else if (response->ntver & NETLOGON_NT_VERSION_5) { ndr_err = ndr_push_struct_blob(data, mem_ctx, - iconv_convenience, &response->data.nt5, (ndr_push_flags_fn_t)ndr_push_NETLOGON_SAM_LOGON_RESPONSE); } else { @@ -62,7 +58,6 @@ NTSTATUS push_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, } NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct netlogon_samlogon_response *response) { uint32_t ntver; @@ -85,7 +80,6 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, if (ntver == NETLOGON_NT_VERSION_1) { ndr_err = ndr_pull_struct_blob_all(data, mem_ctx, - iconv_convenience, &response->data.nt4, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40); response->ntver = NETLOGON_NT_VERSION_1; @@ -96,7 +90,7 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, } else if (ntver & NETLOGON_NT_VERSION_5EX) { struct ndr_pull *ndr; - ndr = ndr_pull_init_blob(data, mem_ctx, iconv_convenience); + ndr = ndr_pull_init_blob(data, mem_ctx); if (!ndr) { return NT_STATUS_NO_MEMORY; } @@ -116,7 +110,6 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, } else if (ntver & NETLOGON_NT_VERSION_5) { ndr_err = ndr_pull_struct_blob_all(data, mem_ctx, - iconv_convenience, &response->data.nt5, (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE); response->ntver = NETLOGON_NT_VERSION_5; @@ -183,7 +176,6 @@ void map_netlogon_samlogon_response(struct netlogon_samlogon_response *response) } NTSTATUS push_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct nbt_netlogon_response *response) { NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE; @@ -191,7 +183,6 @@ NTSTATUS push_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, switch (response->response_type) { case NETLOGON_GET_PDC: ndr_err = ndr_push_struct_blob(data, mem_ctx, - iconv_convenience, &response->data.get_pdc, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_response_from_pdc); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -207,7 +198,7 @@ NTSTATUS push_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, break; case NETLOGON_SAMLOGON: status = push_netlogon_samlogon_response( - data, mem_ctx, iconv_convenience, + data, mem_ctx, &response->data.samlogon); break; } @@ -216,7 +207,6 @@ NTSTATUS push_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, NTSTATUS pull_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct nbt_netlogon_response *response) { NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE; @@ -231,7 +221,6 @@ NTSTATUS pull_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, switch (command) { case NETLOGON_RESPONSE_FROM_PDC: ndr_err = ndr_pull_struct_blob_all(data, mem_ctx, - iconv_convenience, &response->data.get_pdc, (ndr_pull_flags_fn_t)ndr_pull_nbt_netlogon_response_from_pdc); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -253,7 +242,7 @@ NTSTATUS pull_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, case LOGON_SAM_LOGON_PAUSE_RESPONSE_EX: case LOGON_SAM_LOGON_USER_UNKNOWN_EX: status = pull_netlogon_samlogon_response( - data, mem_ctx, iconv_convenience, + data, mem_ctx, &response->data.samlogon); response->response_type = NETLOGON_SAMLOGON; break; diff --git a/libcli/netlogon_proto.h b/libcli/netlogon_proto.h index 905feed876..53c7d004ee 100644 --- a/libcli/netlogon_proto.h +++ b/libcli/netlogon_proto.h @@ -13,17 +13,13 @@ /* The following definitions come from ../libcli/netlogon.c */ NTSTATUS push_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct netlogon_samlogon_response *response); NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct netlogon_samlogon_response *response); void map_netlogon_samlogon_response(struct netlogon_samlogon_response *response); NTSTATUS push_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct nbt_netlogon_response *response); NTSTATUS pull_nbt_netlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, struct nbt_netlogon_response *response); #undef _PRINTF_ATTRIBUTE #define _PRINTF_ATTRIBUTE(a1, a2) diff --git a/libcli/registry/util_reg.c b/libcli/registry/util_reg.c index 6ab2be0a11..3a1168f615 100644 --- a/libcli/registry/util_reg.c +++ b/libcli/registry/util_reg.c @@ -75,13 +75,12 @@ _PUBLIC_ int regtype_by_string(const char *str) push a string in unix charset into a REG_SZ UCS2 null terminated blob ********************************************************************/ -bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - DATA_BLOB *blob, const char *s) +bool push_reg_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *s) { union winreg_Data data; enum ndr_err_code ndr_err; data.string = s; - ndr_err = ndr_push_union_blob(blob, mem_ctx, ic, &data, REG_SZ, + ndr_err = ndr_push_union_blob(blob, mem_ctx, &data, REG_SZ, (ndr_push_flags_fn_t)ndr_push_winreg_Data); return NDR_ERR_CODE_IS_SUCCESS(ndr_err); } @@ -91,13 +90,12 @@ bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, terminated blob ********************************************************************/ -bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - DATA_BLOB *blob, const char **a) +bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **a) { union winreg_Data data; enum ndr_err_code ndr_err; data.string_array = a; - ndr_err = ndr_push_union_blob(blob, mem_ctx, ic, &data, REG_MULTI_SZ, + ndr_err = ndr_push_union_blob(blob, mem_ctx, &data, REG_MULTI_SZ, (ndr_push_flags_fn_t)ndr_push_winreg_Data); return NDR_ERR_CODE_IS_SUCCESS(ndr_err); } @@ -106,12 +104,11 @@ bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, pull a string in unix charset out of a REG_SZ UCS2 null terminated blob ********************************************************************/ -bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, - const DATA_BLOB *blob, const char **s) +bool pull_reg_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char **s) { union winreg_Data data; enum ndr_err_code ndr_err; - ndr_err = ndr_pull_union_blob(blob, mem_ctx, ic, &data, REG_SZ, + ndr_err = ndr_pull_union_blob(blob, mem_ctx, &data, REG_SZ, (ndr_pull_flags_fn_t)ndr_pull_winreg_Data); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; @@ -125,12 +122,12 @@ bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, terminated blob ********************************************************************/ -bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, +bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char ***a) { union winreg_Data data; enum ndr_err_code ndr_err; - ndr_err = ndr_pull_union_blob(blob, mem_ctx, ic, &data, REG_MULTI_SZ, + ndr_err = ndr_pull_union_blob(blob, mem_ctx, &data, REG_MULTI_SZ, (ndr_pull_flags_fn_t)ndr_pull_winreg_Data); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; diff --git a/libcli/samsync/decrypt.c b/libcli/samsync/decrypt.c index b3fab712bc..117151e887 100644 --- a/libcli/samsync/decrypt.c +++ b/libcli/samsync/decrypt.c @@ -79,7 +79,7 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx, user->user_private_info.SensitiveData = data.data; user->user_private_info.DataLength = data.length; - ndr_err = ndr_pull_struct_blob(&data, mem_ctx, NULL, &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)) { dump_data(10, data.data, data.length); diff --git a/libcli/security/secace.c b/libcli/security/secace.c index 8a73a6ab94..2ee5bfaee5 100644 --- a/libcli/security/secace.c +++ b/libcli/security/secace.c @@ -63,7 +63,7 @@ void init_sec_ace(struct security_ace *t, const struct dom_sid *sid, enum securi { t->type = type; t->flags = flag; - t->size = ndr_size_dom_sid(sid, NULL, 0) + 8; + t->size = ndr_size_dom_sid(sid, 0) + 8; t->access_mask = mask; t->trustee = *sid; @@ -89,7 +89,7 @@ NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, struct security_ace **pp_new, struct s (*pp_new)[i].type = SEC_ACE_TYPE_ACCESS_ALLOWED; (*pp_new)[i].flags = 0; - (*pp_new)[i].size = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, NULL, 0); + (*pp_new)[i].size = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, 0); (*pp_new)[i].access_mask = mask; (*pp_new)[i].trustee = *sid; return NT_STATUS_OK; -- cgit