summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-22 16:50:12 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-03-29 15:06:54 -0400
commit3e7bcf5239f95c7b37b8994f00a8aae918aa8793 (patch)
tree83ef113fc0ef76dc0621eb038ead3f15dd32a450
parent9930aed614d3908e167e64de4e8c1c1c05584a92 (diff)
downloadsssd-3e7bcf5239f95c7b37b8994f00a8aae918aa8793.tar.gz
sssd-3e7bcf5239f95c7b37b8994f00a8aae918aa8793.tar.xz
sssd-3e7bcf5239f95c7b37b8994f00a8aae918aa8793.zip
LDAP services: Save lowercased protocol names in case-insensitive domains
https://fedorahosted.org/sssd/ticket/1260
-rw-r--r--src/providers/ldap/sdap_async_services.c18
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,