ldb-samba: ldif_read_objectSid() short-circuits without 'S'
commitbf4af1a28a3580223fcc3a861c7fdd1b43f234d1
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 4 May 2024 01:32:39 +0000 (4 13:32 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 7 May 2024 23:25:35 +0000 (7 23:25 +0000)
tree41741d3bac611aaeee6b035a886cd6571e52c552
parent6c0bdf371878eb1a3a1c3b1663379a89bd0ec2c0
ldb-samba: ldif_read_objectSid() short-circuits without 'S'

This avoids a memcpy, and level 3 debug verbosity from
dom_sid_parse_endp().

In other places we have something like `|| in->data[1] != '-'`, but
that is not useful here -- the value is either a string SID, or a
binary SID that starts with '\1', or some awful value that we *do*
want to get messages about.

This replaces the work of ldif_comparision_objectSid_isString().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10763

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb-samba/ldif_handlers.c