]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "ldb: User hexchars_upper from replace.h"
authorAndreas Schneider <asn@samba.org>
Tue, 2 Dec 2025 13:02:08 +0000 (14:02 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 3 Dec 2025 09:49:45 +0000 (09:49 +0000)
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 <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/common/ldb_dn.c

index 5b8c0f4f580934b2199d0cf47e3fa95b8f85ba3c..389da4449044ef5848673718cb2ae813a01519b3 100644 (file)
@@ -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;
        }