summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-19 23:01:39 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-19 23:03:49 +0100
commitbb679a4da3a32c61529fb56a0cbc9f6d6668146e (patch)
treeec39ab19246f17f83045641d5ef235678bb7a49d
parentd0993e1278a9245fa4e5952c779cabc2e41cd3c7 (diff)
downloadsamba-bb679a4da3a32c61529fb56a0cbc9f6d6668146e.tar.gz
samba-bb679a4da3a32c61529fb56a0cbc9f6d6668146e.tar.bz2
samba-bb679a4da3a32c61529fb56a0cbc9f6d6668146e.zip
ldb:ldb_rename on ldap backends - handle the case when the RDN value is empty
Otherwise we get "<RDN name>=(null),..."
-rw-r--r--source4/lib/ldb-samba/ldb_ildap.c2
-rw-r--r--source4/lib/ldb/ldb_ldap/ldb_ldap.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb-samba/ldb_ildap.c b/source4/lib/ldb-samba/ldb_ildap.c
index e2176d65d3..3c28690bd6 100644
--- a/source4/lib/ldb-samba/ldb_ildap.c
+++ b/source4/lib/ldb-samba/ldb_ildap.c
@@ -633,7 +633,7 @@ static int ildb_rename(struct ildb_context *ac)
if ((rdn_name != NULL) && (rdn_val != NULL)) {
msg->r.ModifyDNRequest.newrdn =
talloc_asprintf(msg, "%s=%s", rdn_name,
- ldb_dn_escape_value(msg, *rdn_val));
+ rdn_val->length > 0 ? ldb_dn_escape_value(msg, *rdn_val) : "");
} else {
msg->r.ModifyDNRequest.newrdn = talloc_strdup(msg, "");
}
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index ee677cce94..b328ebf7e3 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -410,7 +410,7 @@ static int lldb_rename(struct lldb_context *lldb_ac)
if ((rdn_name != NULL) && (rdn_val != NULL)) {
newrdn = talloc_asprintf(lldb_ac, "%s=%s", rdn_name,
- ldb_dn_escape_value(lldb, *rdn_val));
+ rdn_val->length > 0 ? ldb_dn_escape_value(lldb, *rdn_val) : "");
} else {
newrdn = talloc_strdup(lldb_ac, "");
}