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

kdc: always ldb escape the realm

This commit is contained in:
Andrew Bartlett 2011-04-05 16:21:14 +10:00
parent 663dc94e63
commit 86baefe224

View File

@ -1002,9 +1002,19 @@ static krb5_error_code samba_kdc_lookup_trust(krb5_context context, struct ldb_c
const char * const *attrs = trust_attrs;
struct ldb_result *res = NULL;
filter = talloc_asprintf(mem_ctx, "(&(objectClass=trustedDomain)(|(flatname=%s)(trustPartner=%s)))", realm, realm);
char *realm_encoded = ldb_binary_encode_string(mem_ctx, realm);
if (!realm_encoded) {
if (!filter) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "talloc_asprintf: out of memory");
return ret;
}
}
filter = talloc_asprintf(mem_ctx, "(&(objectClass=trustedDomain)(|(flatname=%s)(trustPartner=%s)))",
realm_encoded, realm_encoded);
if (!filter) {
talloc_free(realm_encoded);
ret = ENOMEM;
krb5_set_error_message(context, ret, "talloc_asprintf: out of memory");
return ret;