From: Douglas Bagnall Date: Wed, 17 Apr 2024 13:49:11 +0000 (+1200) Subject: ldb-samba: remove unused ldif_comparision_objectSid_isString() X-Git-Tag: tdb-1.4.11~815 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e899ef5bfa67a12e8eb18cbebc06367f37a8376;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index 5b9737542e9..b803c4486d3 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -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