summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-12-13 15:33:23 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-22 16:52:04 +0100
commit0a33b13e2125de2be64ba2add63021abfc973492 (patch)
treea9c5864810453d6009b1e4ddd27f447939a61b51
parent507c0d939b7882e5708ac2c7589f67be2af89892 (diff)
downloadsssd-0a33b13e2125de2be64ba2add63021abfc973492.tar.gz
sssd-0a33b13e2125de2be64ba2add63021abfc973492.tar.xz
sssd-0a33b13e2125de2be64ba2add63021abfc973492.zip
sdap_idamp: Fall back to another method if sid is wrong
sss_idmap_domain_has_algorithmic_mapping can return also IDMAP_SID_INVALID, but it does not mean that idmaping is unavailable. We should fall back to another method of detection (sss_idmap_domain_by_name_has_algorithmic_mapping) and do not return false immediately. Resolves: https://fedorahosted.org/sssd/ticket/2172
-rw-r--r--src/providers/ldap/sdap_idmap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c
index b6455b81f..57c448fff 100644
--- a/src/providers/ldap/sdap_idmap.c
+++ b/src/providers/ldap/sdap_idmap.c
@@ -529,9 +529,15 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx,
err = sss_idmap_domain_has_algorithmic_mapping(ctx->map, dom_sid,
&has_algorithmic_mapping);
- if (err == IDMAP_SUCCESS) {
+ switch (err){
+ case IDMAP_SUCCESS:
return has_algorithmic_mapping;
- } else if (err != IDMAP_SID_UNKNOWN && err != IDMAP_NO_DOMAIN) {
+ case IDMAP_SID_INVALID: /* FALLTHROUGH */
+ case IDMAP_SID_UNKNOWN: /* FALLTHROUGH */
+ case IDMAP_NO_DOMAIN: /* FALLTHROUGH */
+ /* continue with idmap_domain_by_name */
+ break;
+ default:
return false;
}