diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-03-22 16:50:12 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-03-29 15:06:58 -0400 |
commit | ef6dbf7b5a7a0550628b4a1aa4d60cddef556158 (patch) | |
tree | 90da39717cf60a0f02330a49005897c4899ff8ea /src | |
parent | 62def404cb14e02d2903c68fb730c5281ad902fe (diff) | |
download | sssd-ef6dbf7b5a7a0550628b4a1aa4d60cddef556158.tar.gz sssd-ef6dbf7b5a7a0550628b4a1aa4d60cddef556158.tar.xz sssd-ef6dbf7b5a7a0550628b4a1aa4d60cddef556158.zip |
LDAP services: Save lowercased protocol names in case-insensitive domains
https://fedorahosted.org/sssd/ticket/1260
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ldap/sdap_async_services.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c index ae96d8882..c87d07c44 100644 --- a/src/providers/ldap/sdap_async_services.c +++ b/src/providers/ldap/sdap_async_services.c @@ -351,6 +351,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, const char *name = NULL; const char **aliases; const char **protocols; + const char **cased_protocols; + const char **store_protocols; char **missing; uint16_t port; uint64_t cache_timeout; @@ -412,6 +414,20 @@ sdap_save_service(TALLOC_CTX *mem_ctx, goto done; } + if (dom->case_sensitive == false) { + /* Don't perform the extra mallocs if not necessary */ + ret = sss_get_cased_name_list(tmp_ctx, protocols, + dom->case_sensitive, &cased_protocols); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, + ("Failed to get case_sensitive protocols names: [%s]\n", + strerror(ret))); + goto done; + } + } + + store_protocols = dom->case_sensitive ? protocols : cased_protocols; + /* Get the USN value, if available */ ret = sysdb_attrs_get_el(attrs, opts->service_map[SDAP_AT_SERVICE_USN].sys_name, &el); @@ -456,7 +472,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, cache_timeout = dom->service_timeout; - ret = sysdb_store_service(sysdb, name, port, aliases, protocols, + ret = sysdb_store_service(sysdb, name, port, aliases, store_protocols, svc_attrs, missing, cache_timeout, now); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, |