mirror of
https://github.com/samba-team/samba.git
synced 2025-01-15 23:24:37 +03:00
r19885: special dn's were not casefolded before rev 19831,
act like this again... also when we already have a casefoled value we should not call ldb_dn_casefold_internal() metze (This used to be commit cbf4eb16725992bfdfa5a334e0e5547e6df568e6)
This commit is contained in:
parent
2ad51046e3
commit
6d074bcd4b
@ -628,24 +628,22 @@ const char *ldb_dn_get_casefold(struct ldb_dn *dn)
|
|||||||
int i, len;
|
int i, len;
|
||||||
char *d, *n;
|
char *d, *n;
|
||||||
|
|
||||||
|
if (dn->casefold) return dn->casefold;
|
||||||
|
|
||||||
|
if (dn->special) {
|
||||||
|
dn->casefold = talloc_strdup(dn, dn->linearized);
|
||||||
|
if (!dn->casefold) return NULL;
|
||||||
|
dn->valid_case = true;
|
||||||
|
return dn->casefold;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! ldb_dn_casefold_internal(dn)) {
|
if ( ! ldb_dn_casefold_internal(dn)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dn->casefold) return dn->casefold;
|
|
||||||
|
|
||||||
if (dn->comp_num == 0) {
|
if (dn->comp_num == 0) {
|
||||||
if (dn->special) {
|
dn->casefold = talloc_strdup(dn, "");
|
||||||
len = strlen(dn->linearized);
|
if (!dn->casefold) return NULL;
|
||||||
dn->casefold = talloc_array(dn, char, len * 3 + 1);
|
|
||||||
if ( ! dn->casefold) return NULL;
|
|
||||||
ldb_dn_escape_internal(dn->casefold, dn->linearized, len);
|
|
||||||
/* don't waste more memory than necessary */
|
|
||||||
dn->casefold = talloc_realloc(dn, dn->casefold, char, strlen(dn->casefold) + 1);
|
|
||||||
} else {
|
|
||||||
dn->casefold = talloc_strdup(dn, "");
|
|
||||||
if ( ! dn->casefold) return NULL;
|
|
||||||
}
|
|
||||||
dn->valid_case = true;
|
dn->valid_case = true;
|
||||||
return dn->casefold;
|
return dn->casefold;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user