From: Andreas Schneider Date: Tue, 2 Dec 2025 13:02:08 +0000 (+0100) Subject: Revert "ldb: User hexchars_upper from replace.h" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bb25c0e01d35b1adb3137cb193de27f5c5a65f0;p=thirdparty%2Fsamba.git Revert "ldb: User hexchars_upper from replace.h" This reverts commit 542cf01bfe530a83dfbc8a606d182c0a5a622059. We shouldn't put a hard requirement for libreplace in libldb! We do not need libreplace on Linux until we start using hexbytes_upper. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15961 Signed-off-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index 5b8c0f4f580..389da444904 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -232,10 +232,15 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len) case '\0': { /* any others get \XX form */ unsigned char v; + /* + * Do not use libreplace for this. We don't want to have + * a hard requirement for it. + */ + const char *hexbytes = "0123456789ABCDEF"; v = (const unsigned char)c; *d++ = '\\'; - *d++ = hexchars_upper[v>>4]; - *d++ = hexchars_upper[v&0xF]; + *d++ = hexbytes[v>>4]; + *d++ = hexbytes[v&0xF]; break; } default: @@ -2100,7 +2105,7 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn, unsigned int i; struct ldb_val v2; const struct ldb_dn_extended_syntax *ext_syntax; - + if ( ! ldb_dn_validate(dn)) { return LDB_ERR_OTHER; }