summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-12-03 15:25:25 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-12-09 22:36:46 +0100
commit2b4b6b829f197493b4901bec96fefaadbc7a2464 (patch)
tree9a37c411dbb0091a36087e06674bd2fea908a142
parent70a64b33b0e98983cb9c0a71cdfe7c3b524fbe36 (diff)
downloadsssd-2b4b6b829f197493b4901bec96fefaadbc7a2464.tar.gz
sssd-2b4b6b829f197493b4901bec96fefaadbc7a2464.tar.xz
sssd-2b4b6b829f197493b4901bec96fefaadbc7a2464.zip
SUBDOMAINS: Reuse cached results if DP is offline
If Data Provider was unable to refresh the subdomain list, the sss_domain_info->subdomains list was NULL. Which meant that no DP request matched any known domain and hence offline authentication was not working correctly. Resolves: https://fedorahosted.org/sssd/ticket/2168
-rw-r--r--src/providers/ad/ad_subdomains.c7
-rw-r--r--src/providers/ipa/ipa_subdomains.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index 73190faa1..4cf083c91 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -652,5 +652,12 @@ int ad_subdom_init(struct be_ctx *be_ctx,
return EFAULT;
}
+ ret = sysdb_update_subdomains(be_ctx->domain);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("Could not load the list of subdomains. "
+ "Users from trusted domains might not be resolved correctly\n"));
+ /* Ignore this error and try to discover the subdomains later */
+ }
+
return EOK;
}
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 4f7627edd..416e21913 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -809,8 +809,6 @@ static void ipa_subdomains_get_conn_done(struct tevent_req *req)
DEBUG(SSSDBG_MINOR_FAILURE,
("No IPA server is available, cannot get the "
"subdomain list while offline\n"));
-
-/* FIXME: return saved results ?? */
} else {
DEBUG(SSSDBG_OP_FAILURE,
("Failed to connect to IPA server: [%d](%s)\n",
@@ -1291,6 +1289,12 @@ int ipa_subdom_init(struct be_ctx *be_ctx,
DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom offline callback"));
}
+ ret = sysdb_update_subdomains(be_ctx->domain);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("Could not load the list of subdomains. "
+ "Users from trusted domains might not be resolved correctly\n"));
+ }
+
return EOK;
}