s4-ldb: use GUID_to_ndr_blob()
[kai/samba.git] / source4 / lib / ldb / common / ldb_dn.c
index 3721fa733352de3e7c7009271591d3bfd6686d9f..63cec8995305972c90ff512665d189670e2bf108 100644 (file)
@@ -232,7 +232,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
                        /* any others get \XX form */
                        unsigned char v;
                        const char *hexbytes = "0123456789ABCDEF";
-                       v = *(unsigned char *)p;
+                       v = *(const unsigned char *)p;
                        *d++ = '\\';
                        *d++ = hexbytes[v>>4];
                        *d++ = hexbytes[v&0xF];
@@ -1901,6 +1901,11 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
                }
        }
 
+       if (val == NULL) {
+               /* removing a value that doesn't exist is not an error */
+               return LDB_SUCCESS;
+       }
+
        p = dn->ext_components
                = talloc_realloc(dn,
                                 dn->ext_components,