1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

ldb:rdn_name: normalize rdn_name in rdn_rename_callback()

We already do that on 'add'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Stefan Metzmacher 2016-11-10 14:01:21 +01:00 committed by Andrew Bartlett
parent f599a2d244
commit 25aa26178f

View File

@ -243,6 +243,7 @@ static int rdn_rename_callback(struct ldb_request *req, struct ldb_reply *ares)
struct rename_context *ac;
struct ldb_request *mod_req;
const char *rdn_name;
const struct ldb_schema_attribute *a = NULL;
const struct ldb_val *rdn_val_p;
struct ldb_val rdn_val;
struct ldb_message *msg;
@ -286,6 +287,15 @@ static int rdn_rename_callback(struct ldb_request *req, struct ldb_reply *ares)
goto error;
}
a = ldb_schema_attribute_by_name(ldb, rdn_name);
if (a == NULL) {
goto error;
}
if (a->name != NULL) {
rdn_name = a->name;
}
rdn_val_p = ldb_dn_get_rdn_val(msg->dn);
if (rdn_val_p == NULL) {
goto error;