ndr: short-circuit ace coda if no bytes left
commitac0c8ee01ea624e9c486251da2132710c2a43ddc
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 31 Dec 2023 00:06:40 +0000 (31 13:06 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Feb 2024 02:48:44 +0000 (8 02:48 +0000)
treedb9279d272d3ec74df5038a78d6b40eb727f6021
parent1e6a876c2cc4b3b54895dde879492e756bb9b963
ndr: short-circuit ace coda if no bytes left

The overwhelmingly common case is that there are no bytes left, and
regardless of the ACE type we want to store an empty blob.

We know the blob will be empty if there are no bytes, so we don't need
to allocate a sub-ndr and tokens list and so forth.

This can save almost half the time of a security descriptor pull.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15574
librpc/ndr/ndr_sec_helper.c