summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_groups.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-05-29 00:56:53 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-07 00:14:13 +0200
commit3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a (patch)
tree9cc777431457b2f827864a8b744b019534aec33c /src/providers/ldap/sdap_async_groups.c
parent556040eac686265f8a3b20e2a744210607cba95c (diff)
downloadsssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.tar.gz
sssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.tar.xz
sssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.zip
LDAP: store FQDNs for trusted users and groups
Because the NSS responder expects the name attribute to contain FQDN, we must save the name as FQDN in the LDAP provider if the domain we save to is a subdomain.
Diffstat (limited to 'src/providers/ldap/sdap_async_groups.c')
-rw-r--r--src/providers/ldap/sdap_async_groups.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index 5a5bedc8f..04ce2f9fb 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -429,6 +429,7 @@ static int sdap_save_group(TALLOC_CTX *memctx,
struct ldb_message_element *el;
struct sysdb_attrs *group_attrs;
const char *name = NULL;
+ char *group_name;
gid_t gid;
errno_t ret;
char *usn_value = NULL;
@@ -614,7 +615,7 @@ static int sdap_save_group(TALLOC_CTX *memctx,
goto done;
}
- ret = sdap_save_all_names(name, attrs, !dom->case_sensitive, group_attrs);
+ ret = sdap_save_all_names(name, attrs, dom, group_attrs);
if (ret != EOK) {
DEBUG(1, ("Failed to save group names\n"));
goto done;
@@ -622,8 +623,15 @@ static int sdap_save_group(TALLOC_CTX *memctx,
DEBUG(6, ("Storing info for group %s\n", name));
+ group_name = sss_get_domain_name(tmpctx, name, dom);
+ if (!group_name) {
+ DEBUG(SSSDBG_OP_FAILURE, ("failed to format user name,\n"));
+ ret = ENOMEM;
+ goto done;
+ }
+
ret = sdap_store_group_with_gid(ctx, dom,
- name, gid, group_attrs,
+ group_name, gid, group_attrs,
dom->group_timeout,
posix_group, now);
if (ret) {