summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-06-15 16:56:55 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-07 10:24:57 +0200
commite0243c7f3638c819051b7235097a0bb2d06374fb (patch)
treeb7a1203dca52775715575e75147bf1be38cb1e15 /src/providers/ldap
parentda1fd52202cffa3260470565b74af885a466cb00 (diff)
downloadsssd-e0243c7f3638c819051b7235097a0bb2d06374fb.tar.gz
sssd-e0243c7f3638c819051b7235097a0bb2d06374fb.tar.xz
sssd-e0243c7f3638c819051b7235097a0bb2d06374fb.zip
SDAP: Search functions don't need to construct per-domain names
The names are all internally qualified already, no need to distinguish between subdomain users and main domain users. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/sdap.c10
-rw-r--r--src/providers/ldap/sdap_async_initgroups.c13
2 files changed, 4 insertions, 19 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 9a56d7a14..b0ff02b30 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -1565,15 +1565,9 @@ sdap_get_primary_name(TALLOC_CTX *memctx,
return EINVAL;
}
- name = sss_get_domain_name(memctx, orig_name, dom);
- if (name == NULL) {
- DEBUG(SSSDBG_OP_FAILURE,
- "Failed to format original name [%s]\n", orig_name);
- return ENOMEM;
- }
- DEBUG(SSSDBG_TRACE_FUNC, "Processing object %s\n", name);
+ DEBUG(SSSDBG_TRACE_FUNC, "Processing object %s\n", orig_name);
- *_primary_name = name;
+ *_primary_name = talloc_steal(memctx, name);
return EOK;
}
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index fa19876a4..e76f7b258 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -52,7 +52,6 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
char *sid_str = NULL;
bool use_id_mapping;
bool need_filter;
- char *tmp_name;
/* There are no groups in LDAP but we should add user to groups ?? */
if (ldap_groups_count == 0) return EOK;
@@ -68,20 +67,12 @@ errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
mi = 0;
for (i=0; groupnames[i]; i++) {
- tmp_name = sss_get_domain_name(tmp_ctx, groupnames[i], domain);
- if (tmp_name == NULL) {
- DEBUG(SSSDBG_OP_FAILURE,
- "Failed to format original name [%s]\n", groupnames[i]);
- ret = ENOMEM;
- goto done;
- }
-
- ret = sysdb_search_group_by_name(tmp_ctx, domain, tmp_name, NULL,
+ ret = sysdb_search_group_by_name(tmp_ctx, domain, groupnames[i], NULL,
&msg);
if (ret == EOK) {
continue;
} else if (ret == ENOENT) {
- missing[mi] = talloc_steal(missing, tmp_name);
+ missing[mi] = talloc_strdup(missing, groupnames[i]);
DEBUG(SSSDBG_TRACE_LIBS, "Group #%d [%s][%s] is not cached, " \
"need to add a fake entry\n",
i, groupnames[i], missing[mi]);