mirror of
https://github.com/samba-team/samba.git
synced 2025-03-24 10:50:22 +03:00
Finish removal of iconv_convenience in public API's.
This commit is contained in:
parent
e9f5bdf6b5
commit
f9ca9e46ad
@ -163,7 +163,7 @@ NTSTATUS tdr_pull_charset(struct tdr_pull *tdr, TALLOC_CTX *ctx, const char **v,
|
||||
|
||||
TDR_PULL_NEED_BYTES(tdr, el_size*length);
|
||||
|
||||
if (!convert_string_talloc_convenience(ctx, tdr->iconv_convenience, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret, false)) {
|
||||
if (!convert_string_talloc(ctx, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret, false)) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@ -183,7 +183,8 @@ NTSTATUS tdr_push_charset(struct tdr_push *tdr, const char **v, uint32_t length,
|
||||
required = el_size * length;
|
||||
TDR_PUSH_NEED_BYTES(tdr, required);
|
||||
|
||||
if (!convert_string_convenience(tdr->iconv_convenience, CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required, &ret, false)) {
|
||||
ret = convert_string(CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required, false);
|
||||
if (ret == -1) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@ -343,33 +344,29 @@ NTSTATUS tdr_pull_DATA_BLOB(struct tdr_pull *tdr, TALLOC_CTX *ctx, DATA_BLOB *bl
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
struct tdr_push *tdr_push_init(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic)
|
||||
struct tdr_push *tdr_push_init(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct tdr_push *push = talloc_zero(mem_ctx, struct tdr_push);
|
||||
|
||||
if (push == NULL)
|
||||
return NULL;
|
||||
|
||||
push->iconv_convenience = talloc_reference(push, ic);
|
||||
|
||||
return push;
|
||||
}
|
||||
|
||||
struct tdr_pull *tdr_pull_init(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic)
|
||||
struct tdr_pull *tdr_pull_init(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct tdr_pull *pull = talloc_zero(mem_ctx, struct tdr_pull);
|
||||
|
||||
if (pull == NULL)
|
||||
return NULL;
|
||||
|
||||
pull->iconv_convenience = talloc_reference(pull, ic);
|
||||
|
||||
return pull;
|
||||
}
|
||||
|
||||
NTSTATUS tdr_push_to_fd(int fd, struct smb_iconv_convenience *iconv_convenience, tdr_push_fn_t push_fn, const void *p)
|
||||
NTSTATUS tdr_push_to_fd(int fd, tdr_push_fn_t push_fn, const void *p)
|
||||
{
|
||||
struct tdr_push *push = tdr_push_init(NULL, iconv_convenience);
|
||||
struct tdr_push *push = tdr_push_init(NULL);
|
||||
|
||||
if (push == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -33,13 +33,11 @@ struct tdr_pull {
|
||||
DATA_BLOB data;
|
||||
uint32_t offset;
|
||||
int flags;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
};
|
||||
|
||||
struct tdr_push {
|
||||
DATA_BLOB data;
|
||||
int flags;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
};
|
||||
|
||||
struct tdr_print {
|
||||
|
@ -25,7 +25,7 @@
|
||||
static bool test_push_uint8(struct torture_context *tctx)
|
||||
{
|
||||
uint8_t v = 4;
|
||||
struct tdr_push *tdr = tdr_push_init(tctx, global_iconv_convenience);
|
||||
struct tdr_push *tdr = tdr_push_init(tctx);
|
||||
|
||||
torture_assert_ntstatus_ok(tctx, tdr_push_uint8(tdr, &v), "push failed");
|
||||
torture_assert_int_equal(tctx, tdr->data.length, 1, "length incorrect");
|
||||
@ -37,7 +37,7 @@ static bool test_pull_uint8(struct torture_context *tctx)
|
||||
{
|
||||
uint8_t d = 2;
|
||||
uint8_t l;
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx, global_iconv_convenience);
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx);
|
||||
tdr->data.data = &d;
|
||||
tdr->data.length = 1;
|
||||
tdr->offset = 0;
|
||||
@ -52,7 +52,7 @@ static bool test_pull_uint8(struct torture_context *tctx)
|
||||
static bool test_push_uint16(struct torture_context *tctx)
|
||||
{
|
||||
uint16_t v = 0xF32;
|
||||
struct tdr_push *tdr = tdr_push_init(tctx, global_iconv_convenience);
|
||||
struct tdr_push *tdr = tdr_push_init(tctx);
|
||||
|
||||
torture_assert_ntstatus_ok(tctx, tdr_push_uint16(tdr, &v), "push failed");
|
||||
torture_assert_int_equal(tctx, tdr->data.length, 2, "length incorrect");
|
||||
@ -65,7 +65,7 @@ static bool test_pull_uint16(struct torture_context *tctx)
|
||||
{
|
||||
uint8_t d[2] = { 782 & 0xFF, (782 & 0xFF00) / 0x100 };
|
||||
uint16_t l;
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx, global_iconv_convenience);
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx);
|
||||
tdr->data.data = d;
|
||||
tdr->data.length = 2;
|
||||
tdr->offset = 0;
|
||||
@ -80,7 +80,7 @@ static bool test_pull_uint16(struct torture_context *tctx)
|
||||
static bool test_push_uint32(struct torture_context *tctx)
|
||||
{
|
||||
uint32_t v = 0x100F32;
|
||||
struct tdr_push *tdr = tdr_push_init(tctx, global_iconv_convenience);
|
||||
struct tdr_push *tdr = tdr_push_init(tctx);
|
||||
|
||||
torture_assert_ntstatus_ok(tctx, tdr_push_uint32(tdr, &v), "push failed");
|
||||
torture_assert_int_equal(tctx, tdr->data.length, 4, "length incorrect");
|
||||
@ -95,7 +95,7 @@ static bool test_pull_uint32(struct torture_context *tctx)
|
||||
{
|
||||
uint8_t d[4] = { 782 & 0xFF, (782 & 0xFF00) / 0x100, 0, 0 };
|
||||
uint32_t l;
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx, global_iconv_convenience);
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx);
|
||||
tdr->data.data = d;
|
||||
tdr->data.length = 4;
|
||||
tdr->offset = 0;
|
||||
@ -109,7 +109,7 @@ static bool test_pull_uint32(struct torture_context *tctx)
|
||||
|
||||
static bool test_pull_charset(struct torture_context *tctx)
|
||||
{
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx, global_iconv_convenience);
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx);
|
||||
const char *l = NULL;
|
||||
tdr->data.data = (uint8_t *)talloc_strdup(tctx, "bla");
|
||||
tdr->data.length = 4;
|
||||
@ -131,7 +131,7 @@ static bool test_pull_charset(struct torture_context *tctx)
|
||||
|
||||
static bool test_pull_charset_empty(struct torture_context *tctx)
|
||||
{
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx, global_iconv_convenience);
|
||||
struct tdr_pull *tdr = tdr_pull_init(tctx);
|
||||
const char *l = NULL;
|
||||
tdr->data.data = (uint8_t *)talloc_strdup(tctx, "bla");
|
||||
tdr->data.length = 4;
|
||||
@ -150,7 +150,7 @@ static bool test_pull_charset_empty(struct torture_context *tctx)
|
||||
static bool test_push_charset(struct torture_context *tctx)
|
||||
{
|
||||
const char *l = "bloe";
|
||||
struct tdr_push *tdr = tdr_push_init(tctx, global_iconv_convenience);
|
||||
struct tdr_push *tdr = tdr_push_init(tctx);
|
||||
torture_assert_ntstatus_ok(tctx, tdr_push_charset(tdr, &l, 4, 1, CH_UTF8),
|
||||
"push failed");
|
||||
torture_assert_int_equal(tctx, 4, tdr->data.length, "offset invalid");
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -92,13 +92,13 @@ interface drsblobs {
|
||||
|
||||
typedef [public,gensize,flag(NDR_PAHEX)] struct {
|
||||
/* this includes the 8 bytes of the repsFromToBlob header */
|
||||
[value(ndr_size_repsFromTo1(this, ndr->iconv_convenience, ndr->flags)+8)] uint32 blobsize;
|
||||
[value(ndr_size_repsFromTo1(this, ndr->flags)+8)] uint32 blobsize;
|
||||
uint32 consecutive_sync_failures;
|
||||
NTTIME_1sec last_success;
|
||||
NTTIME_1sec last_attempt;
|
||||
WERROR result_last_attempt;
|
||||
[relative] repsFromTo1OtherInfo *other_info;
|
||||
[value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->iconv_convenience, ndr->flags))] uint32 other_info_length;
|
||||
[value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->flags))] uint32 other_info_length;
|
||||
drsuapi_DrsOptions replica_flags;
|
||||
uint8 schedule[84];
|
||||
[value(0)] uint32 reserved;
|
||||
@ -109,7 +109,7 @@ interface drsblobs {
|
||||
} repsFromTo1;
|
||||
|
||||
typedef [public,relative_base,gensize] struct {
|
||||
[value(ndr_size_repsFromTo2OtherInfo(this,ndr->iconv_convenience, ndr->flags))]
|
||||
[value(ndr_size_repsFromTo2OtherInfo(this,ndr->flags))]
|
||||
uint32 __ndr_size;
|
||||
[relative] nstring *dns_name1;
|
||||
uint32 unknown1;
|
||||
@ -119,13 +119,13 @@ interface drsblobs {
|
||||
|
||||
typedef [public,gensize,flag(NDR_PAHEX)] struct {
|
||||
/* this includes the 8 bytes of the repsFromToBlob header */
|
||||
[value(ndr_size_repsFromTo2(this, ndr->iconv_convenience, ndr->flags)+8)] uint32 blobsize;
|
||||
[value(ndr_size_repsFromTo2(this, ndr->flags)+8)] uint32 blobsize;
|
||||
uint32 consecutive_sync_failures;
|
||||
NTTIME_1sec last_success;
|
||||
NTTIME_1sec last_attempt;
|
||||
WERROR result_last_attempt;
|
||||
[relative] repsFromTo2OtherInfo *other_info;
|
||||
[value(ndr_size_repsFromTo2OtherInfo(other_info, ndr->iconv_convenience, ndr->flags))] uint32 other_info_length;
|
||||
[value(ndr_size_repsFromTo2OtherInfo(other_info, ndr->flags))] uint32 other_info_length;
|
||||
drsuapi_DrsOptions replica_flags;
|
||||
uint8 schedule[84];
|
||||
[value(0)] uint32 reserved;
|
||||
@ -209,7 +209,7 @@ interface drsblobs {
|
||||
|
||||
typedef [public,gensize] struct {
|
||||
uint32 num_entries;
|
||||
[value(ndr_size_drsuapi_MSPrefixMap_Ctr(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_MSPrefixMap_Ctr(r, ndr->flags))] uint32 __ndr_size;
|
||||
drsuapi_MSPrefixMap_Entry entries[num_entries];
|
||||
} drsuapi_MSPrefixMap_Ctr;
|
||||
|
||||
@ -255,7 +255,7 @@ interface drsblobs {
|
||||
NTTIME time;
|
||||
uint32 u2;
|
||||
uint32 u3;
|
||||
[value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, ndr->iconv_convenience, 0))]
|
||||
[value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))]
|
||||
uint32 extra_length;
|
||||
drsuapi_DsReplicaHighWaterMark highwatermark;
|
||||
GUID guid1;
|
||||
@ -316,7 +316,7 @@ interface drsblobs {
|
||||
|
||||
typedef [public] struct {
|
||||
[value(0)] uint32 unknown1;
|
||||
[value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->flags))] uint32 __ndr_size;
|
||||
[value(0)] uint32 unknown2;
|
||||
[subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub;
|
||||
[value(0)] uint8 unknown3;
|
||||
@ -499,8 +499,8 @@ interface drsblobs {
|
||||
uint8 confounder[512];
|
||||
[subcontext(0),subcontext_size(outgoing_size)] trustCurrentPasswords outgoing;
|
||||
[subcontext(0),subcontext_size(incoming_size)] trustCurrentPasswords incoming;
|
||||
[value(ndr_size_trustCurrentPasswords(&outgoing, ndr->iconv_convenience, ndr->flags))] uint32 outgoing_size;
|
||||
[value(ndr_size_trustCurrentPasswords(&incoming, ndr->iconv_convenience, ndr->flags))] uint32 incoming_size;
|
||||
[value(ndr_size_trustCurrentPasswords(&outgoing, ndr->flags))] uint32 outgoing_size;
|
||||
[value(ndr_size_trustCurrentPasswords(&incoming, ndr->flags))] uint32 incoming_size;
|
||||
} trustDomainPasswords;
|
||||
|
||||
[nopython] void decode_trustDomainPasswords(
|
||||
@ -631,7 +631,7 @@ interface drsblobs {
|
||||
} ForestTrustInfoRecord;
|
||||
|
||||
typedef [flag(NDR_NOALIGN)] struct {
|
||||
[value(ndr_size_ForestTrustInfoRecord(&record, ndr->iconv_convenience, ndr->flags))] uint32 record_size;
|
||||
[value(ndr_size_ForestTrustInfoRecord(&record, ndr->flags))] uint32 record_size;
|
||||
ForestTrustInfoRecord record;
|
||||
} ForestTrustInfoRecordArmor;
|
||||
|
||||
|
@ -186,7 +186,7 @@ interface drsuapi
|
||||
/*****************/
|
||||
/* Function 0x02 */
|
||||
typedef [public,gensize] struct {
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags)-4)] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags)-4)] uint32 __ndr_size;
|
||||
[value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid;
|
||||
GUID guid;
|
||||
dom_sid28 sid;
|
||||
@ -532,7 +532,7 @@ interface drsuapi
|
||||
|
||||
/* DN String values */
|
||||
typedef [public,gensize] struct {
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
|
||||
GUID guid;
|
||||
dom_sid28 sid;
|
||||
@ -541,7 +541,7 @@ interface drsuapi
|
||||
} drsuapi_DsReplicaObjectIdentifier3;
|
||||
|
||||
typedef [public] struct {
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->flags))] uint32 __ndr_size;
|
||||
[value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid;
|
||||
GUID guid;
|
||||
dom_sid28 sid;
|
||||
@ -604,7 +604,7 @@ interface drsuapi
|
||||
drsuapi_DsExtendedError extended_ret; /* w2k sends the nc_object_count value here */
|
||||
uint32 object_count;
|
||||
/* this +55 is sometimes +56, so I don't know where this comes from... --metze */
|
||||
[value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] uint32 __ndr_size;
|
||||
drsuapi_DsReplicaObjectListItemEx *first_object;
|
||||
boolean32 more_data;
|
||||
} drsuapi_DsGetNCChangesCtr1;
|
||||
@ -638,7 +638,7 @@ interface drsuapi
|
||||
drsuapi_DsExtendedError extended_ret;
|
||||
uint32 object_count;
|
||||
/* this +55 is sometimes +56, so I don't know where this comes from... --metze */
|
||||
[value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;
|
||||
[value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] uint32 __ndr_size;
|
||||
drsuapi_DsReplicaObjectListItemEx *first_object;
|
||||
boolean32 more_data;
|
||||
uint32 nc_object_count; /* estimated amount of objects in the whole NC */
|
||||
|
@ -216,7 +216,7 @@ interface epmapper
|
||||
} epm_tower;
|
||||
|
||||
typedef struct {
|
||||
[value(ndr_size_epm_tower(&tower, ndr->iconv_convenience, ndr->flags))] uint32 tower_length;
|
||||
[value(ndr_size_epm_tower(&tower, ndr->flags))] uint32 tower_length;
|
||||
[subcontext(4)] epm_tower tower;
|
||||
} epm_twr_t;
|
||||
|
||||
|
@ -338,7 +338,7 @@ interface frsrpc
|
||||
[value(1)] uint32 cs_id;
|
||||
[value(pkt_len+12)] uint32 memory_len;
|
||||
[value(ndr_size_frsrpc_CommPktChunkCtr(r->ctr,
|
||||
ndr->iconv_convenience, ndr->flags))]
|
||||
ndr->flags))]
|
||||
[range(0, 262144)]
|
||||
uint32 pkt_len;
|
||||
[value(0)] uint32 upk_len;
|
||||
|
@ -48,7 +48,7 @@ interface named_pipe_auth
|
||||
|
||||
typedef [public,gensize] struct {
|
||||
[flag(NDR_BIG_ENDIAN),
|
||||
value(ndr_size_named_pipe_auth_req(r,ndr->iconv_convenience,ndr->flags)-4)]
|
||||
value(ndr_size_named_pipe_auth_req(r,ndr->flags)-4)]
|
||||
uint32 length;
|
||||
[charset(DOS),value(NAMED_PIPE_AUTH_MAGIC)] uint8 magic[4];
|
||||
uint32 level;
|
||||
@ -76,7 +76,7 @@ interface named_pipe_auth
|
||||
|
||||
typedef [public,gensize] struct {
|
||||
[flag(NDR_BIG_ENDIAN),
|
||||
value(ndr_size_named_pipe_auth_rep(r,ndr->iconv_convenience,ndr->flags)-4)]
|
||||
value(ndr_size_named_pipe_auth_rep(r,ndr->flags)-4)]
|
||||
uint32 length;
|
||||
[charset(DOS),value(NAMED_PIPE_AUTH_MAGIC)] uint8 magic[4];
|
||||
uint32 level;
|
||||
|
@ -458,7 +458,7 @@ interface nbt
|
||||
nbt_string client_site;
|
||||
|
||||
/* Optional on NETLOGON_NT_VERSION_5EX_WITH_IP */
|
||||
[value(ndr_size_nbt_sockaddr(&sockaddr, ndr->iconv_convenience, ndr->flags))] uint8 sockaddr_size;
|
||||
[value(ndr_size_nbt_sockaddr(&sockaddr, ndr->flags))] uint8 sockaddr_size;
|
||||
[subcontext(0),subcontext_size(sockaddr_size)] nbt_sockaddr sockaddr;
|
||||
|
||||
/* Optional on NETLOGON_NT_VERSION_WITH_CLOSEST_SITE */
|
||||
|
@ -1056,7 +1056,7 @@ interface netlogon
|
||||
[in] [subcontext(4)/*,subcontext_size(change_log_entry_size)*/]
|
||||
netr_ChangeLogEntry change_log_entry,
|
||||
[in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,
|
||||
ndr->iconv_convenience, ndr->flags))]
|
||||
ndr->flags))]
|
||||
uint32 change_log_entry_size,
|
||||
[out,ref] netr_DELTA_ENUM_ARRAY **delta_enum_array
|
||||
);
|
||||
|
@ -162,7 +162,7 @@ interface ntlmssp
|
||||
|
||||
typedef [public,flag(NDR_NOALIGN)] struct {
|
||||
ntlmssp_AvId AvId;
|
||||
[value(ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience, 0))] uint16 AvLen;
|
||||
[value(ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0))] uint16 AvLen;
|
||||
[subcontext(0),subcontext_size(AvLen),switch_is(AvId)] ntlmssp_AvValue Value;
|
||||
} AV_PAIR;
|
||||
|
||||
@ -182,7 +182,7 @@ interface ntlmssp
|
||||
NEGOTIATE NegotiateFlags;
|
||||
uint8 ServerChallenge[8];
|
||||
uint8 Reserved[8];
|
||||
[value(ndr_size_AV_PAIR_LIST(TargetInfo, ndr->iconv_convenience, ndr->flags))] uint16 TargetInfoLen;
|
||||
[value(ndr_size_AV_PAIR_LIST(TargetInfo, ndr->flags))] uint16 TargetInfoLen;
|
||||
[value(TargetInfoLen)] uint16 TargetNameInfoMaxLen;
|
||||
[relative] [subcontext(0),subcontext_size(TargetInfoLen)] AV_PAIR_LIST *TargetInfo;
|
||||
[switch_is(NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_Version Version;
|
||||
|
@ -405,7 +405,7 @@ interface security
|
||||
typedef [public,nopull,gensize,nosize] struct {
|
||||
security_ace_type type; /* SEC_ACE_TYPE_* */
|
||||
security_ace_flags flags; /* SEC_ACE_FLAG_* */
|
||||
[value(ndr_size_security_ace(r,ndr->iconv_convenience,ndr->flags))] uint16 size;
|
||||
[value(ndr_size_security_ace(r,ndr->flags))] uint16 size;
|
||||
uint32 access_mask;
|
||||
[switch_is(type)] security_ace_object_ctr object;
|
||||
dom_sid trustee;
|
||||
@ -420,7 +420,7 @@ interface security
|
||||
|
||||
typedef [public,gensize,nosize] struct {
|
||||
security_acl_revision revision;
|
||||
[value(ndr_size_security_acl(r,ndr->iconv_convenience,ndr->flags))] uint16 size;
|
||||
[value(ndr_size_security_acl(r,ndr->flags))] uint16 size;
|
||||
[range(0,1000)] uint32 num_aces;
|
||||
security_ace aces[num_aces];
|
||||
} security_acl;
|
||||
@ -462,7 +462,7 @@ interface security
|
||||
} security_descriptor;
|
||||
|
||||
typedef [public] struct {
|
||||
[range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->iconv_convenience,ndr->flags))] uint32 sd_size;
|
||||
[range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->flags))] uint32 sd_size;
|
||||
[subcontext(4)] security_descriptor *sd;
|
||||
} sec_desc_buf;
|
||||
|
||||
|
@ -29,7 +29,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
} spoolss_Time;
|
||||
|
||||
typedef struct {
|
||||
[value(ndr_size_spoolss_Time(time, ndr->iconv_convenience, ndr->flags))] uint32 size;
|
||||
[value(ndr_size_spoolss_Time(time, ndr->flags))] uint32 size;
|
||||
[unique] spoolss_Time *time;
|
||||
} spoolss_TimeCtr;
|
||||
|
||||
@ -333,7 +333,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
uint16 caColorfulness;
|
||||
uint16 caRedGreenTint;
|
||||
uint16 wCoreJTExpSize;
|
||||
[value(ndr_size_spoolss_PSDRVEXTRA(r, ndr->iconv_convenience, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
|
||||
[value(ndr_size_spoolss_PSDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
|
||||
uint32 fxScrFreq;
|
||||
uint32 fxScrAngle;
|
||||
spoolss_DMPS_Dialect iDialect;
|
||||
@ -404,7 +404,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature;
|
||||
[value(0x0022)] uint16 wVer;
|
||||
uint16 wCoreJTExpSize;
|
||||
[value(ndr_size_spoolss_UNIDRVEXTRA(r, ndr->iconv_convenience, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
|
||||
[value(ndr_size_spoolss_UNIDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize;
|
||||
uint16 wOEMExtra;
|
||||
uint32 dwChecksum32;
|
||||
spoolss_DMUNI_Flags dwFlags;
|
||||
@ -884,7 +884,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
/******************/
|
||||
/* Function: 0x01 */
|
||||
typedef struct {
|
||||
[value(_ndr_size_spoolss_DeviceMode(devmode, ndr->iconv_convenience, ndr->flags))] uint32 _ndr_size;
|
||||
[value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size;
|
||||
[subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode;
|
||||
} spoolss_DevmodeContainer;
|
||||
|
||||
@ -1291,7 +1291,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
/* Function: 0x09 */
|
||||
|
||||
typedef [public] struct {
|
||||
[value((ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;
|
||||
[value((ndr_size_spoolss_StringArray(r, ndr->flags)-4)/2)] uint32 _ndr_size;
|
||||
/*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string;
|
||||
} spoolss_StringArray;
|
||||
|
||||
@ -1325,7 +1325,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *help_file;
|
||||
[string,charset(UTF16)] uint16 *monitor_name;
|
||||
[string,charset(UTF16)] uint16 *default_datatype;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
spoolss_StringArray *dependent_files;
|
||||
} spoolss_AddDriverInfo3;
|
||||
|
||||
@ -1339,9 +1339,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *help_file;
|
||||
[string,charset(UTF16)] uint16 *monitor_name;
|
||||
[string,charset(UTF16)] uint16 *default_datatype;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
spoolss_StringArray *dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
spoolss_StringArray *previous_names;
|
||||
} spoolss_AddDriverInfo4;
|
||||
|
||||
@ -1371,9 +1371,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *help_file;
|
||||
[string,charset(UTF16)] uint16 *monitor_name;
|
||||
[string,charset(UTF16)] uint16 *default_datatype;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
spoolss_StringArray *dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
spoolss_StringArray *previous_names;
|
||||
NTTIME driver_date;
|
||||
hyper driver_version;
|
||||
@ -1393,9 +1393,9 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *help_file;
|
||||
[string,charset(UTF16)] uint16 *monitor_name;
|
||||
[string,charset(UTF16)] uint16 *default_datatype;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;
|
||||
spoolss_StringArray *dependent_files;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
[value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;
|
||||
spoolss_StringArray *previous_names;
|
||||
NTTIME driver_date;
|
||||
hyper driver_version;
|
||||
@ -1405,11 +1405,11 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
[string,charset(UTF16)] uint16 *provider;
|
||||
[string,charset(UTF16)] uint16 *print_processor;
|
||||
[string,charset(UTF16)] uint16 *vendor_setup;
|
||||
[value(((ndr_size_spoolss_StringArray(color_profiles, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
|
||||
[value(((ndr_size_spoolss_StringArray(color_profiles, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;
|
||||
spoolss_StringArray *color_profiles;
|
||||
[string,charset(UTF16)] uint16 *inf_path;
|
||||
uint32 printer_driver_attributes;
|
||||
[value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
|
||||
[value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;
|
||||
spoolss_StringArray *core_driver_dependencies;
|
||||
NTTIME min_inbox_driver_ver_date;
|
||||
hyper min_inbox_driver_ver_version;
|
||||
@ -1826,7 +1826,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
const string SPOOLSS_DEFAULT_SERVER_PATH = "C:\\WINDOWS\\system32\\spool";
|
||||
|
||||
typedef [public,gensize] struct {
|
||||
[value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
|
||||
[value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size;
|
||||
uint32 major;
|
||||
uint32 minor;
|
||||
uint32 build;
|
||||
@ -1835,7 +1835,7 @@ cpp_quote("#define spoolss_security_descriptor security_descriptor")
|
||||
} spoolss_OSVersion;
|
||||
|
||||
typedef [public,gensize] struct {
|
||||
[value(ndr_size_spoolss_OSVersionEx(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size;
|
||||
[value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size;
|
||||
uint32 major;
|
||||
uint32 minor;
|
||||
uint32 build;
|
||||
|
@ -60,8 +60,6 @@ struct ndr_pull {
|
||||
uint32_t data_size;
|
||||
uint32_t offset;
|
||||
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
|
||||
uint32_t relative_highest_offset;
|
||||
uint32_t relative_base_offset;
|
||||
struct ndr_token_list *relative_base_list;
|
||||
@ -97,8 +95,6 @@ struct ndr_push {
|
||||
|
||||
/* this is used to ensure we generate unique reference IDs */
|
||||
uint32_t ptr_count;
|
||||
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
};
|
||||
|
||||
/* structure passed to functions that print IDL structures */
|
||||
@ -106,7 +102,6 @@ struct ndr_print {
|
||||
uint32_t flags; /* LIBNDR_FLAG_* */
|
||||
uint32_t depth;
|
||||
struct ndr_token_list *switch_list;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
void (*print)(struct ndr_print *, const char *, ...) PRINTF_ATTRIBUTE(2,3);
|
||||
void *private_data;
|
||||
};
|
||||
@ -381,10 +376,10 @@ size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags);
|
||||
void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip);
|
||||
void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
|
||||
bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2);
|
||||
enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_push_flags_fn_t fn);
|
||||
size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push, struct smb_iconv_convenience *);
|
||||
size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push, struct smb_iconv_convenience *);
|
||||
enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_push_flags_fn_t fn);
|
||||
size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
|
||||
size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push);
|
||||
uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
|
||||
void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset);
|
||||
enum ndr_err_code ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset);
|
||||
@ -402,9 +397,9 @@ enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, ui
|
||||
enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p);
|
||||
enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v);
|
||||
size_t ndr_align_size(uint32_t offset, size_t n);
|
||||
struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
|
||||
struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
|
||||
enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size);
|
||||
struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
|
||||
struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx);
|
||||
DATA_BLOB ndr_push_blob(struct ndr_push *ndr);
|
||||
enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size);
|
||||
void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
|
||||
@ -459,10 +454,10 @@ enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *
|
||||
uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p);
|
||||
uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p);
|
||||
uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p);
|
||||
enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
|
||||
enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
|
||||
|
||||
/* from libndr_basic.h */
|
||||
#define NDR_SCALAR_PROTO(name, type) \
|
||||
|
@ -58,7 +58,7 @@ _PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n)
|
||||
/*
|
||||
initialise a ndr parse structure from a data blob
|
||||
*/
|
||||
_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience)
|
||||
_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct ndr_pull *ndr;
|
||||
|
||||
@ -68,7 +68,6 @@ _PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *
|
||||
|
||||
ndr->data = blob->data;
|
||||
ndr->data_size = blob->length;
|
||||
ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience);
|
||||
|
||||
return ndr;
|
||||
}
|
||||
@ -102,7 +101,7 @@ static enum ndr_err_code ndr_pull_set_offset(struct ndr_pull *ndr, uint32_t ofs)
|
||||
}
|
||||
|
||||
/* create a ndr_push structure, ready for some marshalling */
|
||||
_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience)
|
||||
_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct ndr_push *ndr;
|
||||
|
||||
@ -117,7 +116,6 @@ _PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_icon
|
||||
if (!ndr->data) {
|
||||
return NULL;
|
||||
}
|
||||
ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience);
|
||||
|
||||
return ndr;
|
||||
}
|
||||
@ -256,14 +254,6 @@ _PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name
|
||||
ndr->depth = 1;
|
||||
ndr->flags = 0;
|
||||
|
||||
/* this is a s4 hack until we build up the courage to pass
|
||||
* this all the way down
|
||||
*/
|
||||
#if _SAMBA_BUILD_ == 4
|
||||
ndr->iconv_convenience = smb_iconv_convenience_reinit(talloc_autofree_context(),
|
||||
"ASCII", "UTF-8", true, NULL);
|
||||
#endif
|
||||
|
||||
fn(ndr, name, flags, ptr);
|
||||
talloc_free(ndr);
|
||||
}
|
||||
@ -286,14 +276,6 @@ _PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, c
|
||||
ndr->depth = 1;
|
||||
ndr->flags = 0;
|
||||
|
||||
/* this is a s4 hack until we build up the courage to pass
|
||||
* this all the way down
|
||||
*/
|
||||
#if _SAMBA_BUILD_ == 4
|
||||
ndr->iconv_convenience = smb_iconv_convenience_reinit(talloc_autofree_context(),
|
||||
"ASCII", "UTF-8", true, NULL);
|
||||
#endif
|
||||
|
||||
fn(ndr, name, ptr);
|
||||
ret = talloc_steal(mem_ctx, (char *)ndr->private_data);
|
||||
failed:
|
||||
@ -555,7 +537,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_subcontext_start(struct ndr_pull *ndr,
|
||||
subndr->data = ndr->data + ndr->offset;
|
||||
subndr->offset = 0;
|
||||
subndr->data_size = r_content_size;
|
||||
subndr->iconv_convenience = talloc_reference(subndr, ndr->iconv_convenience);
|
||||
|
||||
if (force_le) {
|
||||
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
|
||||
@ -591,7 +572,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_subcontext_start(struct ndr_push *ndr,
|
||||
{
|
||||
struct ndr_push *subndr;
|
||||
|
||||
subndr = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
|
||||
subndr = ndr_push_init_ctx(ndr);
|
||||
NDR_ERR_HAVE_NO_MEMORY(subndr);
|
||||
subndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64;
|
||||
|
||||
@ -852,11 +833,11 @@ _PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *
|
||||
/*
|
||||
pull a struct from a blob using NDR
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p,
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
|
||||
ndr_pull_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_pull *ndr;
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
|
||||
talloc_free(ndr);
|
||||
@ -867,12 +848,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CT
|
||||
pull a struct from a blob using NDR - failing if all bytes are not consumed
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *iconv_convenience,
|
||||
void *p, ndr_pull_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_pull *ndr;
|
||||
uint32_t highest_ofs;
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
|
||||
if (ndr->offset > ndr->relative_highest_offset) {
|
||||
@ -896,11 +876,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLO
|
||||
pull a union from a blob using NDR, given the union discriminator
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *iconv_convenience, void *p,
|
||||
void *p,
|
||||
uint32_t level, ndr_pull_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_pull *ndr;
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
NDR_CHECK_FREE(ndr_pull_set_switch_value(ndr, p, level));
|
||||
NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
|
||||
@ -913,12 +893,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX
|
||||
failing if all bytes are not consumed
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *iconv_convenience, void *p,
|
||||
void *p,
|
||||
uint32_t level, ndr_pull_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_pull *ndr;
|
||||
uint32_t highest_ofs;
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience);
|
||||
ndr = ndr_pull_init_blob(blob, mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
NDR_CHECK_FREE(ndr_pull_set_switch_value(ndr, p, level));
|
||||
NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
|
||||
@ -942,10 +922,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC
|
||||
/*
|
||||
push a struct to a blob using NDR
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn)
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_push *ndr;
|
||||
ndr = ndr_push_init_ctx(mem_ctx, iconv_convenience);
|
||||
ndr = ndr_push_init_ctx(mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
|
||||
NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
|
||||
@ -960,11 +940,11 @@ _PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem
|
||||
/*
|
||||
push a union to a blob using NDR
|
||||
*/
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p,
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
|
||||
uint32_t level, ndr_push_flags_fn_t fn)
|
||||
{
|
||||
struct ndr_push *ndr;
|
||||
ndr = ndr_push_init_ctx(mem_ctx, iconv_convenience);
|
||||
ndr = ndr_push_init_ctx(mem_ctx);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndr);
|
||||
|
||||
NDR_CHECK(ndr_push_set_switch_value(ndr, p, level));
|
||||
@ -980,7 +960,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_
|
||||
/*
|
||||
generic ndr_size_*() handler for structures
|
||||
*/
|
||||
_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push, struct smb_iconv_convenience *iconv_convenience)
|
||||
_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
|
||||
{
|
||||
struct ndr_push *ndr;
|
||||
enum ndr_err_code status;
|
||||
@ -989,7 +969,7 @@ _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t pu
|
||||
/* avoid recursion */
|
||||
if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
|
||||
|
||||
ndr = ndr_push_init_ctx(NULL, iconv_convenience);
|
||||
ndr = ndr_push_init_ctx(NULL);
|
||||
if (!ndr) return 0;
|
||||
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
|
||||
status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
|
||||
@ -1005,7 +985,7 @@ _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t pu
|
||||
/*
|
||||
generic ndr_size_*() handler for unions
|
||||
*/
|
||||
_PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push, struct smb_iconv_convenience *iconv_convenience)
|
||||
_PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push)
|
||||
{
|
||||
struct ndr_push *ndr;
|
||||
enum ndr_err_code status;
|
||||
@ -1014,7 +994,7 @@ _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_pus
|
||||
/* avoid recursion */
|
||||
if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0;
|
||||
|
||||
ndr = ndr_push_init_ctx(NULL, iconv_convenience);
|
||||
ndr = ndr_push_init_ctx(NULL);
|
||||
if (!ndr) return 0;
|
||||
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
|
||||
|
||||
|
@ -391,7 +391,7 @@ enum ndr_err_code ndr_pull_compression_start(struct ndr_pull *subndr,
|
||||
bool last = false;
|
||||
z_stream z;
|
||||
|
||||
ndrpush = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
|
||||
ndrpush = ndr_push_init_ctx(subndr);
|
||||
NDR_ERR_HAVE_NO_MEMORY(ndrpush);
|
||||
|
||||
switch (compression_alg) {
|
||||
@ -431,8 +431,6 @@ enum ndr_err_code ndr_pull_compression_start(struct ndr_pull *subndr,
|
||||
comndr->data_size = uncompressed.length;
|
||||
comndr->offset = 0;
|
||||
|
||||
comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
|
||||
|
||||
*_comndr = comndr;
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
@ -465,7 +463,7 @@ enum ndr_err_code ndr_push_compression_start(struct ndr_push *subndr,
|
||||
compression_alg);
|
||||
}
|
||||
|
||||
uncomndr = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
|
||||
uncomndr = ndr_push_init_ctx(subndr);
|
||||
NDR_ERR_HAVE_NO_MEMORY(uncomndr);
|
||||
uncomndr->flags = subndr->flags;
|
||||
|
||||
@ -492,8 +490,6 @@ enum ndr_err_code ndr_push_compression_end(struct ndr_push *subndr,
|
||||
ndrpull->data_size = uncomndr->offset;
|
||||
ndrpull->offset = 0;
|
||||
|
||||
ndrpull->iconv_convenience = talloc_reference(ndrpull, subndr->iconv_convenience);
|
||||
|
||||
switch (compression_alg) {
|
||||
case NDR_COMPRESSION_MSZIP:
|
||||
ZERO_STRUCT(z);
|
||||
|
@ -258,9 +258,9 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags)
|
||||
_PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags)
|
||||
{
|
||||
return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic);
|
||||
return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
|
||||
}
|
||||
|
||||
_PUBLIC_ void ndr_print_drsuapi_SecBufferType(struct ndr_print *ndr, const char *name, enum drsuapi_SecBufferType r)
|
||||
|
@ -28,7 +28,7 @@ void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char
|
||||
void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name,
|
||||
const struct drsuapi_DsReplicaObjectListItemEx *r);
|
||||
|
||||
size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags);
|
||||
size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags);
|
||||
|
||||
|
||||
#endif /* _LIBRPC_NDR_NDR_DRSUAPI_H */
|
||||
|
@ -84,11 +84,9 @@ enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
|
||||
}
|
||||
|
||||
size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r,
|
||||
struct smb_iconv_convenience *ic,
|
||||
int flags)
|
||||
{
|
||||
flags |= LIBNDR_FLAG_NOALIGN;
|
||||
return ndr_size_struct(r, flags,
|
||||
(ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr,
|
||||
ic);
|
||||
(ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr);
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
|
||||
int ndr_flags,
|
||||
struct frsrpc_CommPktChunkCtr *r);
|
||||
size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r,
|
||||
struct smb_iconv_convenience *ic,
|
||||
int flags);
|
||||
|
||||
#endif /* _LIBRPC_NDR_NDR_FRSRPC_H */
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/ndr_krb5pac.h"
|
||||
|
||||
static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
|
||||
static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
|
||||
{
|
||||
size_t s = ndr_size_PAC_INFO(r, level, ic, flags);
|
||||
size_t s = ndr_size_PAC_INFO(r, level, flags);
|
||||
switch (level) {
|
||||
case PAC_TYPE_LOGON_INFO:
|
||||
return NDR_ROUND(s,8);
|
||||
@ -34,9 +34,9 @@ static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct
|
||||
}
|
||||
}
|
||||
|
||||
static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
|
||||
static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags)
|
||||
{
|
||||
size_t s = ndr_size_PAC_INFO(r, level, ic, flags);
|
||||
size_t s = ndr_size_PAC_INFO(r, level, flags);
|
||||
return NDR_ROUND(s,8);
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const
|
||||
if (ndr_flags & NDR_SCALARS) {
|
||||
NDR_CHECK(ndr_push_align(ndr, 4));
|
||||
NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type));
|
||||
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience,0)));
|
||||
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,0)));
|
||||
{
|
||||
uint32_t _flags_save_PAC_INFO = ndr->flags;
|
||||
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
|
||||
@ -62,10 +62,10 @@ enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const
|
||||
NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->info));
|
||||
{
|
||||
struct ndr_push *_ndr_info;
|
||||
NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience, 0)));
|
||||
NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0)));
|
||||
NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->info, r->type));
|
||||
NDR_CHECK(ndr_push_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info));
|
||||
NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience,0)));
|
||||
NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0)));
|
||||
}
|
||||
NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->info));
|
||||
}
|
||||
@ -128,7 +128,7 @@ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct
|
||||
ndr_print_struct(ndr, name, "PAC_BUFFER");
|
||||
ndr->depth++;
|
||||
ndr_print_PAC_TYPE(ndr, "type", r->type);
|
||||
ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,ndr->iconv_convenience,0):r->_ndr_size);
|
||||
ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size);
|
||||
ndr_print_ptr(ndr, "info", r->info);
|
||||
ndr->depth++;
|
||||
if (r->info) {
|
||||
|
@ -108,7 +108,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_AV_PAIR_LIST(struct ndr_pull *ndr, int ndr_f
|
||||
}
|
||||
|
||||
_PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *ic,
|
||||
const DATA_BLOB *nt_response,
|
||||
bool ntlmv2)
|
||||
{
|
||||
@ -117,7 +116,7 @@ _PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx,
|
||||
if (ntlmv2) {
|
||||
struct NTLMv2_RESPONSE nt;
|
||||
if (nt_response->length > 24) {
|
||||
ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, ic, &nt,
|
||||
ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, &nt,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_NTLMv2_RESPONSE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(NTLMv2_RESPONSE, &nt);
|
||||
@ -126,7 +125,7 @@ _PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx,
|
||||
} else {
|
||||
struct NTLM_RESPONSE nt;
|
||||
if (nt_response->length == 24) {
|
||||
ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, ic, &nt,
|
||||
ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, &nt,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_NTLM_RESPONSE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(NTLM_RESPONSE, &nt);
|
||||
@ -136,7 +135,6 @@ _PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
_PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *ic,
|
||||
const DATA_BLOB *lm_response,
|
||||
bool ntlmv2)
|
||||
{
|
||||
@ -145,7 +143,7 @@ _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
|
||||
if (ntlmv2) {
|
||||
struct LMv2_RESPONSE lm;
|
||||
if (lm_response->length == 24) {
|
||||
ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, ic, &lm,
|
||||
ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, &lm,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_LMv2_RESPONSE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(LMv2_RESPONSE, &lm);
|
||||
@ -154,7 +152,7 @@ _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
|
||||
} else {
|
||||
struct LM_RESPONSE lm;
|
||||
if (lm_response->length == 24) {
|
||||
ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, ic, &lm,
|
||||
ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, &lm,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_LM_RESPONSE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(LM_RESPONSE, &lm);
|
||||
|
@ -24,11 +24,9 @@ _PUBLIC_ uint32_t ndr_ntlmssp_negotiated_string_flags(uint32_t negotiate_flags);
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_AV_PAIR_LIST(struct ndr_push *ndr, int ndr_flags, const struct AV_PAIR_LIST *r);
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_AV_PAIR_LIST(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR_LIST *r);
|
||||
_PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *ic,
|
||||
const DATA_BLOB *nt_response,
|
||||
bool ntlmv2);
|
||||
_PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx,
|
||||
struct smb_iconv_convenience *ic,
|
||||
const DATA_BLOB *lm_response,
|
||||
bool ntlmv2);
|
||||
_PUBLIC_ void ndr_print_ntlmssp_Version(struct ndr_print *ndr, const char *name, const union ntlmssp_Version *r);
|
||||
|
@ -85,7 +85,7 @@ void dump_NL_AUTH_SIGNATURE(TALLOC_CTX *mem_ctx,
|
||||
switch (signature_algorithm) {
|
||||
case NL_SIGN_HMAC_MD5: {
|
||||
struct NL_AUTH_SIGNATURE r;
|
||||
ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &r,
|
||||
ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &r,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SIGNATURE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(NL_AUTH_SIGNATURE, &r);
|
||||
@ -94,7 +94,7 @@ void dump_NL_AUTH_SIGNATURE(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
case NL_SIGN_HMAC_SHA256: {
|
||||
struct NL_AUTH_SHA2_SIGNATURE r;
|
||||
ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &r,
|
||||
ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &r,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SHA2_SIGNATURE);
|
||||
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
NDR_PRINT_DEBUG(NL_AUTH_SHA2_SIGNATURE, &r);
|
||||
|
@ -30,13 +30,13 @@
|
||||
/*
|
||||
return the wire size of a security_ace
|
||||
*/
|
||||
size_t ndr_size_security_ace(const struct security_ace *ace, struct smb_iconv_convenience *ic, int flags)
|
||||
size_t ndr_size_security_ace(const struct security_ace *ace, int flags)
|
||||
{
|
||||
size_t ret;
|
||||
|
||||
if (!ace) return 0;
|
||||
|
||||
ret = 8 + ndr_size_dom_sid(&ace->trustee, ic, flags);
|
||||
ret = 8 + ndr_size_dom_sid(&ace->trustee, flags);
|
||||
|
||||
switch (ace->type) {
|
||||
case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
|
||||
@ -91,14 +91,14 @@ enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, str
|
||||
/*
|
||||
return the wire size of a security_acl
|
||||
*/
|
||||
size_t ndr_size_security_acl(const struct security_acl *theacl, struct smb_iconv_convenience *ic, int flags)
|
||||
size_t ndr_size_security_acl(const struct security_acl *theacl, int flags)
|
||||
{
|
||||
size_t ret;
|
||||
int i;
|
||||
if (!theacl) return 0;
|
||||
ret = 8;
|
||||
for (i=0;i<theacl->num_aces;i++) {
|
||||
ret += ndr_size_security_ace(&theacl->aces[i], ic, flags);
|
||||
ret += ndr_size_security_ace(&theacl->aces[i], flags);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -106,23 +106,23 @@ size_t ndr_size_security_acl(const struct security_acl *theacl, struct smb_iconv
|
||||
/*
|
||||
return the wire size of a security descriptor
|
||||
*/
|
||||
size_t ndr_size_security_descriptor(const struct security_descriptor *sd, struct smb_iconv_convenience *ic, int flags)
|
||||
size_t ndr_size_security_descriptor(const struct security_descriptor *sd, int flags)
|
||||
{
|
||||
size_t ret;
|
||||
if (!sd) return 0;
|
||||
|
||||
ret = 20;
|
||||
ret += ndr_size_dom_sid(sd->owner_sid, ic, flags);
|
||||
ret += ndr_size_dom_sid(sd->group_sid, ic, flags);
|
||||
ret += ndr_size_security_acl(sd->dacl, ic, flags);
|
||||
ret += ndr_size_security_acl(sd->sacl, ic, flags);
|
||||
ret += ndr_size_dom_sid(sd->owner_sid, flags);
|
||||
ret += ndr_size_dom_sid(sd->group_sid, flags);
|
||||
ret += ndr_size_security_acl(sd->dacl, flags);
|
||||
ret += ndr_size_security_acl(sd->sacl, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
return the wire size of a dom_sid
|
||||
*/
|
||||
size_t ndr_size_dom_sid(const struct dom_sid *sid, struct smb_iconv_convenience *ic, int flags)
|
||||
size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags)
|
||||
{
|
||||
if (!sid) return 0;
|
||||
return 8 + 4*sid->num_auths;
|
||||
|
@ -60,7 +60,7 @@
|
||||
}\
|
||||
if (r->in.buffer) {\
|
||||
DATA_BLOB _data_blob_info;\
|
||||
_ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);\
|
||||
_ndr_info = ndr_push_init_ctx(ndr);\
|
||||
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
|
||||
_ndr_info->flags= ndr->flags;\
|
||||
if (r->out.info) {\
|
||||
@ -137,7 +137,7 @@
|
||||
if (_r.out.info) {\
|
||||
struct ndr_pull *_ndr_info;\
|
||||
NDR_PULL_ALLOC(ndr, *r->out.info);\
|
||||
_ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info, ndr->iconv_convenience);\
|
||||
_ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info);\
|
||||
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
|
||||
_ndr_info->flags= ndr->flags;\
|
||||
if (r->in.offered != _ndr_info->data_size) {\
|
||||
@ -181,7 +181,7 @@
|
||||
#define NDR_SPOOLSS_SIZE_ENUM_LEVEL(fn) do { \
|
||||
struct __##fn __r;\
|
||||
DATA_BLOB _data_blob_info;\
|
||||
struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, iconv_convenience);\
|
||||
struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\
|
||||
if (!_ndr_info) return 0;\
|
||||
_ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\
|
||||
__r.in.level = level;\
|
||||
@ -196,7 +196,7 @@
|
||||
#define NDR_SPOOLSS_SIZE_ENUM(fn) do { \
|
||||
struct __##fn __r;\
|
||||
DATA_BLOB _data_blob_info;\
|
||||
struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, iconv_convenience);\
|
||||
struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\
|
||||
if (!_ndr_info) return 0;\
|
||||
_ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\
|
||||
__r.in.count = count;\
|
||||
@ -234,7 +234,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags,
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinters);
|
||||
}
|
||||
@ -270,7 +270,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, str
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_JobInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumJobs);
|
||||
}
|
||||
@ -302,7 +302,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_DriverInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_DriverInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers);
|
||||
}
|
||||
@ -330,7 +330,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, int flags, st
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_FormInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_FormInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumForms);
|
||||
}
|
||||
@ -358,7 +358,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, int flags, st
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PortInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PortInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPorts);
|
||||
}
|
||||
@ -386,7 +386,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags,
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info)
|
||||
uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumMonitors);
|
||||
}
|
||||
@ -418,7 +418,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessors);
|
||||
@ -451,7 +451,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr,
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes);
|
||||
@ -481,7 +481,7 @@ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int f
|
||||
_r.out.info = data_blob(NULL, 0);
|
||||
if (r->in.offered >= *r->out.needed) {
|
||||
struct __spoolss_EnumPrinterDataEx __r;
|
||||
_ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience);
|
||||
_ndr_info = ndr_push_init_ctx(ndr);
|
||||
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
|
||||
_ndr_info->flags= ndr->flags;
|
||||
__r.in.count = *r->out.count;
|
||||
@ -531,7 +531,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int f
|
||||
if (_r.out.info.length) {
|
||||
struct ndr_pull *_ndr_info;
|
||||
NDR_PULL_ALLOC(ndr, *r->out.info);
|
||||
_ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info, ndr->iconv_convenience);
|
||||
_ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info);
|
||||
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);
|
||||
_ndr_info->flags= ndr->flags;
|
||||
if (r->in.offered != _ndr_info->data_size) {
|
||||
@ -551,25 +551,25 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int f
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t count, struct spoolss_PrinterEnumValues *info)
|
||||
{
|
||||
NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDataEx);
|
||||
}
|
||||
|
||||
uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags)
|
||||
uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, uint32_t flags)
|
||||
{
|
||||
if (!devmode) return 0;
|
||||
return ndr_size_spoolss_DeviceMode(devmode,ic,flags);
|
||||
return ndr_size_spoolss_DeviceMode(devmode, flags);
|
||||
}
|
||||
|
||||
_PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags)
|
||||
_PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, int flags)
|
||||
{
|
||||
if (!r) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray, ic);
|
||||
return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray);
|
||||
}
|
||||
|
||||
/* hand marshall as pidl cannot (yet) generate a relative pointer to a fixed array of
|
||||
@ -1114,12 +1114,12 @@ void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const unio
|
||||
}
|
||||
}
|
||||
|
||||
_PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
|
||||
_PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, int flags)
|
||||
{
|
||||
if (!r) {
|
||||
return 0;
|
||||
}
|
||||
return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData, ic);
|
||||
return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData);
|
||||
}
|
||||
|
||||
void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r)
|
||||
|
@ -14,40 +14,40 @@
|
||||
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinters *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinters *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, const struct spoolss_EnumJobs *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, struct spoolss_EnumJobs *r);
|
||||
uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_JobInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDrivers *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDrivers *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_DriverInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_DriverInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumForms(struct ndr_push *ndr, int flags, const struct spoolss_EnumForms *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, int flags, struct spoolss_EnumForms *r);
|
||||
uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_FormInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_FormInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, int flags, const struct spoolss_EnumPorts *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, int flags, struct spoolss_EnumPorts *r);
|
||||
uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PortInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PortInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, int flags, const struct spoolss_EnumMonitors *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags, struct spoolss_EnumMonitors *r);
|
||||
uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info);
|
||||
uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessors *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info);
|
||||
enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r);
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,
|
||||
uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx,
|
||||
uint32_t count, struct spoolss_PrinterEnumValues *info);
|
||||
uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags);
|
||||
size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags);
|
||||
uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, uint32_t flags);
|
||||
size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, int flags);
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r);
|
||||
_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r);
|
||||
void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r);
|
||||
size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags);
|
||||
size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, int flags);
|
||||
void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r);
|
||||
enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r);
|
||||
enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r);
|
||||
|
@ -31,7 +31,7 @@
|
||||
_PUBLIC_ NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b)
|
||||
{
|
||||
enum ndr_err_code ndr_err;
|
||||
ndr_err = ndr_push_struct_blob(b, mem_ctx, NULL, guid,
|
||||
ndr_err = ndr_push_struct_blob(b, mem_ctx, guid,
|
||||
(ndr_push_flags_fn_t)ndr_push_GUID);
|
||||
return ndr_map_error2ntstatus(ndr_err);
|
||||
}
|
||||
@ -48,7 +48,7 @@ _PUBLIC_ NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid)
|
||||
mem_ctx = talloc_new(NULL);
|
||||
NT_STATUS_HAVE_NO_MEMORY(mem_ctx);
|
||||
|
||||
ndr_err = ndr_pull_struct_blob_all(b, mem_ctx, NULL, guid,
|
||||
ndr_err = ndr_pull_struct_blob_all(b, mem_ctx, guid,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_GUID);
|
||||
talloc_free(mem_ctx);
|
||||
return ndr_map_error2ntstatus(ndr_err);
|
||||
|
@ -376,7 +376,7 @@ _PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
|
||||
enum ndr_err_code ndr_err;
|
||||
uint16_t if_version=0;
|
||||
|
||||
ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, NULL);
|
||||
ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx);
|
||||
if (ndr == NULL) {
|
||||
talloc_free(mem_ctx);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
@ -405,7 +405,7 @@ _PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
|
||||
static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
|
||||
{
|
||||
DATA_BLOB blob;
|
||||
struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL);
|
||||
struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
|
||||
|
||||
ndr->flags |= LIBNDR_FLAG_NOALIGN;
|
||||
|
||||
@ -421,7 +421,7 @@ static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct nd
|
||||
static DATA_BLOB dcerpc_floor_pack_rhs_if_version_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
|
||||
{
|
||||
DATA_BLOB blob;
|
||||
struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL);
|
||||
struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
|
||||
|
||||
ndr->flags |= LIBNDR_FLAG_NOALIGN;
|
||||
|
||||
|
@ -294,7 +294,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
blob.data = data;
|
||||
blob.length = size;
|
||||
|
||||
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
|
||||
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||
ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||
if (assume_ndr64) {
|
||||
ndr_pull->flags |= LIBNDR_FLAG_NDR64;
|
||||
@ -330,7 +330,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
blob.data = data;
|
||||
blob.length = size;
|
||||
|
||||
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
|
||||
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx);
|
||||
ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||
if (assume_ndr64) {
|
||||
ndr_pull->flags |= LIBNDR_FLAG_NDR64;
|
||||
@ -372,7 +372,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
uint8_t byte_a, byte_b;
|
||||
bool differ;
|
||||
|
||||
ndr_v_push = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
|
||||
ndr_v_push = ndr_push_init_ctx(mem_ctx);
|
||||
|
||||
ndr_err = f->ndr_push(ndr_v_push, flags, st);
|
||||
status = ndr_map_error2ntstatus(ndr_err);
|
||||
@ -389,7 +389,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
|
||||
ndrdump_data(v_blob.data, v_blob.length, dumpdata);
|
||||
}
|
||||
|
||||
ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
|
||||
ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx);
|
||||
ndr_v_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
||||
|
||||
ndr_err = f->ndr_pull(ndr_v_pull, flags, v_st);
|
||||
|
@ -1618,7 +1618,7 @@ sub ParseStructNdrSize($$$$)
|
||||
if (my $flags = has_property($t, "flag")) {
|
||||
$self->pidl("flags |= $flags;");
|
||||
}
|
||||
$self->pidl("return ndr_size_struct($varname, flags, (ndr_push_flags_fn_t)ndr_push_$name, ic);");
|
||||
$self->pidl("return ndr_size_struct($varname, flags, (ndr_push_flags_fn_t)ndr_push_$name);");
|
||||
}
|
||||
|
||||
sub DeclStruct($$$$)
|
||||
@ -1630,7 +1630,7 @@ sub DeclStruct($$$$)
|
||||
sub ArgsStructNdrSize($$$)
|
||||
{
|
||||
my ($d, $name, $varname) = @_;
|
||||
return "const struct $name *$varname, struct smb_iconv_convenience *ic, int flags";
|
||||
return "const struct $name *$varname, int flags";
|
||||
}
|
||||
|
||||
$typefamily{STRUCT} = {
|
||||
@ -1653,7 +1653,7 @@ sub ParseUnionNdrSize($$$)
|
||||
$self->pidl("flags |= $flags;");
|
||||
}
|
||||
|
||||
$self->pidl("return ndr_size_union($varname, flags, level, (ndr_push_flags_fn_t)ndr_push_$name, ic);");
|
||||
$self->pidl("return ndr_size_union($varname, flags, level, (ndr_push_flags_fn_t)ndr_push_$name);");
|
||||
}
|
||||
|
||||
sub ParseUnionPushPrimitives($$$$)
|
||||
@ -1941,7 +1941,7 @@ sub DeclUnion($$$$)
|
||||
sub ArgsUnionNdrSize($$)
|
||||
{
|
||||
my ($d,$name) = @_;
|
||||
return "const union $name *r, uint32_t level, struct smb_iconv_convenience *ic, int flags";
|
||||
return "const union $name *r, uint32_t level, int flags";
|
||||
}
|
||||
|
||||
$typefamily{UNION} = {
|
||||
|
@ -253,7 +253,7 @@ sub PythonStruct($$$$$$)
|
||||
$self->pidl("$cname *object = ($cname *)py_talloc_get_ptr(py_obj);");
|
||||
$self->pidl("DATA_BLOB blob;");
|
||||
$self->pidl("enum ndr_err_code err;");
|
||||
$self->pidl("err = ndr_push_struct_blob(&blob, py_talloc_get_mem_ctx(py_obj), NULL, object, (ndr_push_flags_fn_t)ndr_push_$name);");
|
||||
$self->pidl("err = ndr_push_struct_blob(&blob, py_talloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_$name);");
|
||||
$self->pidl("if (err != NDR_ERR_SUCCESS) {");
|
||||
$self->indent;
|
||||
$self->pidl("PyErr_SetNdrError(err);");
|
||||
@ -275,7 +275,7 @@ sub PythonStruct($$$$$$)
|
||||
$self->pidl("if (!PyArg_ParseTuple(args, \"s#:__ndr_unpack__\", &blob.data, &blob.length))");
|
||||
$self->pidl("\treturn NULL;");
|
||||
$self->pidl("");
|
||||
$self->pidl("err = ndr_pull_struct_blob_all(&blob, py_talloc_get_mem_ctx(py_obj), NULL, object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
|
||||
$self->pidl("err = ndr_pull_struct_blob_all(&blob, py_talloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
|
||||
$self->pidl("if (err != NDR_ERR_SUCCESS) {");
|
||||
$self->indent;
|
||||
$self->pidl("PyErr_SetNdrError(err);");
|
||||
|
@ -14,8 +14,7 @@ test_samba4_ndr("string-pull-empty",
|
||||
'
|
||||
uint8_t data[] = { 0x00, 0x00, 0x00, 0x00 };
|
||||
DATA_BLOB b = { data, 4 };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
r.in.data = NULL;
|
||||
|
||||
@ -37,8 +36,7 @@ test_samba4_ndr("string-ascii-pull",
|
||||
uint8_t data[] = { 0x03, 0x00, 0x00, 0x00,
|
||||
\'f\', \'o\', \'o\', 0 };
|
||||
DATA_BLOB b = { data, 8 };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
r.in.data = NULL;
|
||||
|
||||
@ -74,8 +72,7 @@ test_samba4_ndr("string-wchar-fixed-array-01",
|
||||
0x02, 0x00, 0x00, 0x00
|
||||
};
|
||||
DATA_BLOB b = { data, sizeof(data) };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
struct TestStringStruct str;
|
||||
r.in.str = &str;
|
||||
@ -120,8 +117,7 @@ test_samba4_ndr("string-wchar-fixed-array-02",
|
||||
0x02, 0x00, 0x00, 0x00
|
||||
};
|
||||
DATA_BLOB b = { data, sizeof(data) };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
struct TestStringStruct str;
|
||||
r.in.str = &str;
|
||||
@ -152,8 +148,7 @@ test_samba4_ndr("string-wchar-fixed-array-03",
|
||||
0x02, 0x00, 0x00, 0x00
|
||||
};
|
||||
DATA_BLOB b = { data, sizeof(data) };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
struct TestStringStruct str;
|
||||
r.in.str = &str;
|
||||
@ -174,8 +169,7 @@ test_samba4_ndr("string-out",
|
||||
uint8_t data[] = { 0x03, 0x00, 0x00, 0x00,
|
||||
\'f\', \'o\', \'o\', 0 };
|
||||
DATA_BLOB b = { data, 8 };
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
|
||||
smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
|
||||
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL);
|
||||
struct TestString r;
|
||||
char *str = NULL;
|
||||
r.out.data = &str;
|
||||
|
@ -601,7 +601,6 @@ typedef char fstring[FSTRING_LEN];
|
||||
|
||||
/* Samba 3 doesn't use iconv_convenience: */
|
||||
extern void *cmdline_lp_ctx;
|
||||
struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
|
||||
|
||||
/* Lists, trees, caching, database... */
|
||||
#include "../lib/util/util.h"
|
||||
|
@ -1294,14 +1294,10 @@ struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
|
||||
/* The following definitions come from ..libcli/registry/util_reg.c */
|
||||
|
||||
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);
|
||||
|
||||
/* The following definitions come from lib/util_seaccess.c */
|
||||
|
||||
|
@ -209,10 +209,6 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name
|
||||
}
|
||||
|
||||
void *cmdline_lp_ctx;
|
||||
struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const struct ndr_syntax_id null_ndr_syntax_id =
|
||||
{ { 0, 0, 0, { 0, 0 }, { 0, 0, 0, 0, 0, 0 } }, 0 };
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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,
|
||||
|
@ -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)) {
|
||||
|
@ -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"));
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user