1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

* fixed NDR flag inheritance across push subcontexts

* don't consider not doing lsa_QueryInfoPolicy level 11 a failure
   (w2k3 doesn't have this level, w2k does)

 * on a NDR validation failure dump the failed data at level 3
This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 11c0fe548e
commit 9d5078962f
3 changed files with 13 additions and 2 deletions

View File

@ -564,6 +564,7 @@ NTSTATUS ndr_push_subcontext_fn(struct ndr_push *ndr,
ndr2 = ndr_push_init_ctx(ndr->mem_ctx); ndr2 = ndr_push_init_ctx(ndr->mem_ctx);
if (!ndr2) return NT_STATUS_NO_MEMORY; if (!ndr2) return NT_STATUS_NO_MEMORY;
ndr2->flags = ndr->flags;
NDR_CHECK(fn(ndr2, base)); NDR_CHECK(fn(ndr2, base));
NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2)); NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2));
NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset)); NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset));
@ -583,6 +584,7 @@ NTSTATUS ndr_push_subcontext_flags_fn(struct ndr_push *ndr,
ndr2 = ndr_push_init_ctx(ndr->mem_ctx); ndr2 = ndr_push_init_ctx(ndr->mem_ctx);
if (!ndr2) return NT_STATUS_NO_MEMORY; if (!ndr2) return NT_STATUS_NO_MEMORY;
ndr2->flags = ndr->flags;
NDR_CHECK(fn(ndr2, NDR_SCALARS|NDR_BUFFERS, base)); NDR_CHECK(fn(ndr2, NDR_SCALARS|NDR_BUFFERS, base));
NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2)); NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2));
NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset)); NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset));
@ -603,6 +605,7 @@ NTSTATUS ndr_push_subcontext_union_fn(struct ndr_push *ndr,
ndr2 = ndr_push_init_ctx(ndr->mem_ctx); ndr2 = ndr_push_init_ctx(ndr->mem_ctx);
if (!ndr2) return NT_STATUS_NO_MEMORY; if (!ndr2) return NT_STATUS_NO_MEMORY;
ndr2->flags = ndr->flags;
NDR_CHECK(fn(ndr2, NDR_SCALARS|NDR_BUFFERS, level, base)); NDR_CHECK(fn(ndr2, NDR_SCALARS|NDR_BUFFERS, level, base));
NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2)); NDR_CHECK(ndr_push_subcontext_header(ndr, sub_size, ndr2));
NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset)); NDR_CHECK(ndr_push_bytes(ndr, ndr2->data, ndr2->offset));

View File

@ -780,6 +780,10 @@ static NTSTATUS dcerpc_ndr_validate_in(TALLOC_CTX *mem_ctx,
blob2 = ndr_push_blob(push); blob2 = ndr_push_blob(push);
if (!data_blob_equal(&blob, &blob2)) { if (!data_blob_equal(&blob, &blob2)) {
DEBUG(3,("original:\n"));
dump_data(3, blob.data, blob.length);
DEBUG(3,("secondary:\n"));
dump_data(3, blob2.data, blob2.length);
return ndr_push_error(push, NDR_ERR_VALIDATE, return ndr_push_error(push, NDR_ERR_VALIDATE,
"Error in input validation data - %s", "Error in input validation data - %s",
nt_errstr(status)); nt_errstr(status));
@ -855,6 +859,10 @@ static NTSTATUS dcerpc_ndr_validate_out(TALLOC_CTX *mem_ctx,
blob2 = ndr_push_blob(push); blob2 = ndr_push_blob(push);
if (!data_blob_equal(&blob, &blob2)) { if (!data_blob_equal(&blob, &blob2)) {
DEBUG(3,("original:\n"));
dump_data(3, blob.data, blob.length);
DEBUG(3,("secondary:\n"));
dump_data(3, blob2.data, blob2.length);
return ndr_push_error(push, NDR_ERR_VALIDATE, return ndr_push_error(push, NDR_ERR_VALIDATE,
"Error in output validation data - %s", "Error in output validation data - %s",
nt_errstr(status)); nt_errstr(status));

View File

@ -443,7 +443,6 @@ static BOOL test_QueryInfoPolicy(struct dcerpc_pipe *p,
NTSTATUS status; NTSTATUS status;
int i; int i;
BOOL ret = True; BOOL ret = True;
printf("\nTesting QueryInfoPolicy\n"); printf("\nTesting QueryInfoPolicy\n");
for (i=1;i<13;i++) { for (i=1;i<13;i++) {
@ -454,8 +453,9 @@ static BOOL test_QueryInfoPolicy(struct dcerpc_pipe *p,
status = dcerpc_lsa_QueryInfoPolicy(p, mem_ctx, &r); status = dcerpc_lsa_QueryInfoPolicy(p, mem_ctx, &r);
if ((i == 9 || i == 10) && if ((i == 9 || i == 10 || i == 11) &&
NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) { NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) {
printf("server failed level %u (OK)\n", i);
continue; continue;
} }