1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ldb-samba: remove unused ldif_comparision_objectSid_isString()

This is unused because it does things badly, by just guessing and
not allowing valid sids that start with "s-". All the places that used
to use it were calling ldif_read_objectSid() or similar which correctly
check for string SIDs by actually trying to parse them. That begins
with looking for the "S-"/"s-", so this shortcut is not saving any real
work.

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>
This commit is contained in:
Douglas Bagnall 2024-04-18 01:49:11 +12:00 committed by Andrew Bartlett
parent 8c70273564
commit 3e899ef5bf

View File

@ -138,17 +138,6 @@ int ldif_write_objectSid(struct ldb_context *ldb, void *mem_ctx,
return 0;
}
bool ldif_comparision_objectSid_isString(const struct ldb_val *v)
{
if (v->length < 3) {
return false;
}
if (strncmp("S-", (const char *)v->data, 2) != 0) return false;
return true;
}
/*
compare two objectSids