diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl index 59a795a74e3..a45855be12c 100644 --- a/librpc/idl/drsuapi.idl +++ b/librpc/idl/drsuapi.idl @@ -790,28 +790,28 @@ interface drsuapi uint32 decompressed_length; uint32 compressed_length; [subcontext(4),subcontext_size(compressed_length), - compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)] + compression(NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2,compressed_length,decompressed_length)] drsuapi_DsGetNCChangesCtr1TS *ts; - } drsuapi_DsGetNCChangesXPRESSCtr1; + } drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1; typedef [nopush] struct { uint32 decompressed_length; uint32 compressed_length; [subcontext(4),subcontext_size(compressed_length), - compression(NDR_COMPRESSION_XPRESS,compressed_length,decompressed_length)] + compression(NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2,compressed_length,decompressed_length)] drsuapi_DsGetNCChangesCtr6TS *ts; - } drsuapi_DsGetNCChangesXPRESSCtr6; + } drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6; typedef [enum16bit] enum { DRSUAPI_COMPRESSION_TYPE_MSZIP = 2, - DRSUAPI_COMPRESSION_TYPE_XPRESS = 3 + DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 = 3 /* CompressOrDecompressWin2k3 DRS_COMP_ALG_WIN2K3 */ } drsuapi_DsGetNCChangesCompressionType; typedef [nodiscriminant,flag(NDR_PAHEX)] union { [case(1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr1 mszip1; [case(6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16))] drsuapi_DsGetNCChangesMSZIPCtr6 mszip6; - [case(1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr1 xpress1; - [case(6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16))] drsuapi_DsGetNCChangesXPRESSCtr6 xpress6; + [case(1|(DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2<<16))] drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1 xpress1; + [case(6|(DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2<<16))] drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6 xpress6; } drsuapi_DsGetNCChangesCompressedCtr; typedef struct { diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h index 98f8ff870d2..65b111d532c 100644 --- a/librpc/ndr/libndr.h +++ b/librpc/ndr/libndr.h @@ -292,7 +292,8 @@ enum ndr_err_code { enum ndr_compression_alg { NDR_COMPRESSION_MSZIP_CAB = 1, NDR_COMPRESSION_MSZIP = 2, - NDR_COMPRESSION_XPRESS = 3 + NDR_COMPRESSION_XPRESS = 3, + NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2 = 4, /* Unimplemented */ }; /* diff --git a/librpc/ndr/ndr_drsuapi.c b/librpc/ndr/ndr_drsuapi.c index cda2e2cf3c5..d4cc5a92a5c 100644 --- a/librpc/ndr/ndr_drsuapi.c +++ b/librpc/ndr/ndr_drsuapi.c @@ -291,7 +291,7 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, return NDR_ERR_SUCCESS; } -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r) +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr1 *r) { if (ndr_flags & NDR_SCALARS) { uint32_t decompressed_length = 0; @@ -302,10 +302,10 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1)); { struct ndr_push *_ndr_ts_compressed; - NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); decompressed_length = _ndr_ts_compressed->offset; - NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); } compressed_length = _ndr_ts->offset; talloc_free(_ndr_ts); @@ -323,9 +323,9 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1)); { struct ndr_push *_ndr_ts_compressed; - NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); } NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1)); } @@ -334,7 +334,7 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr return NDR_ERR_SUCCESS; } -enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r) +enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesWIN2K3_LZ77_DIRECT2Ctr6 *r) { if (ndr_flags & NDR_SCALARS) { uint32_t decompressed_length = 0; @@ -345,10 +345,10 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1)); { struct ndr_push *_ndr_ts_compressed; - NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); decompressed_length = _ndr_ts_compressed->offset; - NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); } compressed_length = _ndr_ts->offset; talloc_free(_ndr_ts); @@ -366,9 +366,9 @@ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1)); { struct ndr_push *_ndr_ts_compressed; - NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts)); - NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1)); + NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_WIN2K3_LZ77_DIRECT2, -1)); } NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1)); } diff --git a/python/samba/tests/blackbox/ndrdump.py b/python/samba/tests/blackbox/ndrdump.py index 11d9441e51a..f7734735a1b 100644 --- a/python/samba/tests/blackbox/ndrdump.py +++ b/python/samba/tests/blackbox/ndrdump.py @@ -525,7 +525,7 @@ dump OK self.assertEqual(actual, expected) def test_ndrdump_fuzzed_ndr_compression(self): - expected = 'pull returned Buffer Size Error' + expected = 'ndr_pull_compression_start: ndr_pull_error\(Compression Error\): Bad compression algorithm 4 \(PULL\)' command = ( "ndrdump --debug-stdout drsuapi 3 out --base64-input " "--input BwAAAAcAAAAGAAAAAwAgICAgICAJAAAAICAgIAkAAAAgIAAA//////8=") @@ -535,7 +535,7 @@ dump OK self.fail(e) # check_output will return bytes # convert expected to bytes for python 3 - self.assertRegex(actual.decode('utf8'), expected + '$') + self.assertRegex(actual.decode('utf8'), expected) def test_ndrdump_short_dnsProperty(self): expected = b'''pull returned Success diff --git a/source3/libnet/libnet_dssync.c b/source3/libnet/libnet_dssync.c index e593ae8536c..7d5d8366b22 100644 --- a/source3/libnet/libnet_dssync.c +++ b/source3/libnet/libnet_dssync.c @@ -522,7 +522,7 @@ static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx, ctr6 = &ctr.ctr7.ctr.mszip6.ts->ctr6; } else if (level_out == 7 && ctr.ctr7.level == 6 - && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS + && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 && ctr.ctr7.ctr.xpress6.ts) { out_level = 6; ctr6 = &ctr.ctr7.ctr.xpress6.ts->ctr6; diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c index 59ce7d3f3bd..bf87a26a8d5 100644 --- a/source3/rpcclient/cmd_drsuapi.c +++ b/source3/rpcclient/cmd_drsuapi.c @@ -642,7 +642,7 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, ctr6 = &ctr.ctr7.ctr.mszip6.ts->ctr6; } else if (level_out == 7 && ctr.ctr7.level == 6 - && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS + && ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 && ctr.ctr7.ctr.xpress6.ts) { out_level = 6; ctr6 = &ctr.ctr7.ctr.xpress6.ts->ctr6; diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c index 401d2bf2728..c4aa784674f 100644 --- a/source4/dsdb/repl/drepl_out_helpers.c +++ b/source4/dsdb/repl/drepl_out_helpers.c @@ -724,7 +724,7 @@ static void dreplsrv_op_pull_source_get_changes_done(struct tevent_req *subreq) ctr6 = &r->out.ctr->ctr7.ctr.mszip6.ts->ctr6; } else if (*r->out.level_out == 7 && r->out.ctr->ctr7.level == 6 && - r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS && + r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 && r->out.ctr->ctr7.ctr.xpress6.ts) { ctr_level = 6; ctr6 = &r->out.ctr->ctr7.ctr.xpress6.ts->ctr6; diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index e9153a04922..f40e4f9ffe8 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -2725,7 +2725,7 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state ctr6 = &r->out.ctr->ctr7.ctr.mszip6.ts->ctr6; } else if (*r->out.level_out == 7 && r->out.ctr->ctr7.level == 6 && - r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS && + r->out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 && r->out.ctr->ctr7.ctr.xpress6.ts) { ctr_level = 6; ctr6 = &r->out.ctr->ctr7.ctr.xpress6.ts->ctr6; diff --git a/source4/torture/drs/rpc/dssync.c b/source4/torture/drs/rpc/dssync.c index df63c294db4..64d04980bc7 100644 --- a/source4/torture/drs/rpc/dssync.c +++ b/source4/torture/drs/rpc/dssync.c @@ -859,7 +859,7 @@ static bool test_GetNCChanges(struct torture_context *tctx, ctr6 = &r.out.ctr->ctr7.ctr.mszip6.ts->ctr6; } else if (ret == true && *r.out.level_out == 7 && r.out.ctr->ctr7.level == 6 - && r.out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS + && r.out.ctr->ctr7.type == DRSUAPI_COMPRESSION_TYPE_WIN2K3_LZ77_DIRECT2 && r.out.ctr->ctr7.ctr.xpress6.ts) { out_level = 6; ctr6 = &r.out.ctr->ctr7.ctr.xpress6.ts->ctr6;