diff options
author | Sumit Bose <sbose@redhat.com> | 2010-11-05 21:38:45 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-11-19 13:52:24 -0500 |
commit | f778b38f8d8a04e0afcb8b704dc864bfe0ac2f3a (patch) | |
tree | efa08dc60e253cd168dff1b3324d89d27757b181 /src/providers/ipa | |
parent | b7b8995f3cd6af74f9a87548dc0ee9b555b2043c (diff) | |
download | sssd-f778b38f8d8a04e0afcb8b704dc864bfe0ac2f3a.tar.gz sssd-f778b38f8d8a04e0afcb8b704dc864bfe0ac2f3a.tar.xz sssd-f778b38f8d8a04e0afcb8b704dc864bfe0ac2f3a.zip |
Use a more efficient host search filter
Diffstat (limited to 'src/providers/ipa')
-rw-r--r-- | src/providers/ipa/ipa_access.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c index 47e98cf95..816b652fb 100644 --- a/src/providers/ipa/ipa_access.c +++ b/src/providers/ipa/ipa_access.c @@ -757,7 +757,7 @@ static struct tevent_req *hbac_get_host_info_send(TALLOC_CTX *memctx, state->current_item = 0; state->hbac_host_info = NULL; - state->host_filter = talloc_asprintf(state, "(|"); + state->host_filter = talloc_asprintf(state, "(&(objectclass=ipaHost)(|"); if (state->host_filter == NULL) { DEBUG(1, ("Failed to create filter.\n")); ret = ENOMEM; @@ -770,16 +770,17 @@ static struct tevent_req *hbac_get_host_info_send(TALLOC_CTX *memctx, } state->host_filter = talloc_asprintf_append(state->host_filter, - "(&(objectclass=ipaHost)" - "(|(fqdn=%s)(serverhostname=%s)))", - host, host); + "(%s=%s)(%s=%s)", + IPA_HOST_FQDN, host, + IPA_HOST_SERVERHOSTNAME, host); + if (state->host_filter == NULL) { ret = ENOMEM; goto fail; } talloc_zfree(host); } - state->host_filter = talloc_asprintf_append(state->host_filter, ")"); + state->host_filter = talloc_asprintf_append(state->host_filter, "))"); if (state->host_filter == NULL) { ret = ENOMEM; goto fail; |