summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-12-13 18:20:08 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-22 16:48:36 +0100
commit16b27fcceebcbbaeefaf5b9bdf2dec3065adba4a (patch)
treeab269b1b19243829c91e73725cb05e7c20e3b879 /src/providers
parent630329785c4d6400a3df2fba29ee0fa9a6bb29ef (diff)
downloadsssd-16b27fcceebcbbaeefaf5b9bdf2dec3065adba4a.tar.gz
sssd-16b27fcceebcbbaeefaf5b9bdf2dec3065adba4a.tar.xz
sssd-16b27fcceebcbbaeefaf5b9bdf2dec3065adba4a.zip
LDAP: Don't fail if subdomain cannot be found by sid
Domain needn't contain sid if id_provider is ldap. With enabled id mapping, user couldn't be stored, because domain couldn't be found by sid. Resolves: https://fedorahosted.org/sssd/ticket/2172
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap_async_users.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c
index ebbc171e4..56d5b2146 100644
--- a/src/providers/ldap/sdap_async_users.c
+++ b/src/providers/ldap/sdap_async_users.c
@@ -123,6 +123,7 @@ int sdap_save_user(TALLOC_CTX *memctx,
bool use_id_mapping;
char *sid_str;
char *dom_sid_str = NULL;
+ struct sss_domain_info *subdomain;
DEBUG(SSSDBG_TRACE_FUNC, ("Save user\n"));
@@ -161,11 +162,12 @@ int sdap_save_user(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;
}
}