summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2014-01-24 17:03:27 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-29 20:43:33 +0100
commit8c41a21bc98eec99a16258c7b4d79f456d85f856 (patch)
tree4d71ad265928d12466356ec4162905f72f5d25b0
parent7f8273d35cb7d563b066bf52ae17022b1e9ec3f8 (diff)
downloadsssd-8c41a21bc98eec99a16258c7b4d79f456d85f856.tar.gz
sssd-8c41a21bc98eec99a16258c7b4d79f456d85f856.tar.xz
sssd-8c41a21bc98eec99a16258c7b4d79f456d85f856.zip
LDAP: store group if subdomain cannot be found by sid
Domain needn't contain sid if id_provider is ldap. With enabled id mapping, group couldn't be stored, because domain couldn't be found by sid. Resolves: https://fedorahosted.org/sssd/ticket/2172
-rw-r--r--src/providers/ldap/sdap_async_groups.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index f203bc962..1e0d7f69e 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -450,6 +450,7 @@ static int sdap_save_group(TALLOC_CTX *memctx,
bool posix_group;
bool use_id_mapping;
char *sid_str;
+ struct sss_domain_info *subdomain;
int32_t ad_group_type;
tmpctx = talloc_new(NULL);
@@ -488,11 +489,12 @@ static int sdap_save_group(TALLOC_CTX *memctx,
/* If this object has a SID available, we will determine the correct
* domain by its SID. */
if (sid_str != NULL) {
- dom = find_subdomain_by_sid(get_domains_head(dom), sid_str);
- if (dom == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, ("SID %s does not belong to any known "
+ subdomain = find_subdomain_by_sid(get_domains_head(dom), sid_str);
+ if (subdomain) {
+ dom = subdomain;
+ } else {
+ DEBUG(SSSDBG_TRACE_FUNC, ("SID %s does not belong to any known "
"domain\n", sid_str));
- return ERR_DOMAIN_NOT_FOUND;
}
}