diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/idl/epmapper.idl | 4 | ||||
-rw-r--r-- | source4/librpc/idl/mgmt.idl | 4 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 16 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_krb5pac.c | 2 |
4 files changed, 17 insertions, 9 deletions
diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl index 6c0a85024a..af0bd2483d 100644 --- a/source4/librpc/idl/epmapper.idl +++ b/source4/librpc/idl/epmapper.idl @@ -14,8 +14,8 @@ http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: bindin endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", "ncalrpc:[EPMAPPER]"), helpstring("EndPoint Mapper"), - pointer_default_top(unique), - pointer_default(unique) + pointer_default_top(sptr), + pointer_default(sptr) ] interface epmapper { diff --git a/source4/librpc/idl/mgmt.idl b/source4/librpc/idl/mgmt.idl index 2c4910e677..23bc09e81d 100644 --- a/source4/librpc/idl/mgmt.idl +++ b/source4/librpc/idl/mgmt.idl @@ -7,8 +7,8 @@ [ uuid("afa8bd80-7d8a-11c9-bef4-08002b102989"), version(1.0), - pointer_default(unique), - pointer_default_top(unique), + pointer_default(sptr), + pointer_default_top(sptr), endpoint("ncalrpc:[EPMAPPER]", "ncacn_ip_tcp:[135]", "ncacn_np:[\\pipe\\epmapper]"), helpstring("DCE/RPC Remote Management") ] diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 0a268ac6c9..8b473724dc 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -128,7 +128,7 @@ NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *v) /* parse a pointer referent identifier */ -NTSTATUS ndr_pull_unique_ptr(struct ndr_pull *ndr, uint32_t *v) +NTSTATUS ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v) { NTSTATUS status; status = ndr_pull_uint32(ndr, NDR_SCALARS, v); @@ -563,14 +563,22 @@ NTSTATUS ndr_push_unique_ptr(struct ndr_push *ndr, const void *p) { uint32_t ptr = 0; if (p) { -#if 0 ptr = ndr->ptr_count * 4; ptr |= 0x00020000; ndr->ptr_count++; -#else + } + return ndr_push_uint32(ndr, NDR_SCALARS, ptr); +} + +/* + push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0 +*/ +NTSTATUS ndr_push_sptr_ptr(struct ndr_push *ndr, const void *p) +{ + uint32_t ptr = 0; + if (p) { ndr->ptr_count++; ptr = ndr->ptr_count; -#endif } return ndr_push_uint32(ndr, NDR_SCALARS, ptr); } diff --git a/source4/librpc/ndr/ndr_krb5pac.c b/source4/librpc/ndr/ndr_krb5pac.c index e373189d89..3af3a185e5 100644 --- a/source4/librpc/ndr/ndr_krb5pac.c +++ b/source4/librpc/ndr/ndr_krb5pac.c @@ -90,7 +90,7 @@ NTSTATUS ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUF { uint32_t _flags_save_PAC_INFO = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); - NDR_CHECK(ndr_pull_unique_ptr(ndr, &_ptr_info)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { NDR_ALLOC(ndr, r->info); NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); |