diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-12-13 15:33:23 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-01-22 16:48:36 +0100 |
commit | cdcca90249aadb72bf2978a63c202c5b68642224 (patch) | |
tree | 756d8edd48804aba4b227cb6f9a9e92f8ee2aa93 /src | |
parent | 1e4a582e29c119e2c0e58a02dcb41b829e6b5e39 (diff) | |
download | sssd-cdcca90249aadb72bf2978a63c202c5b68642224.tar.gz sssd-cdcca90249aadb72bf2978a63c202c5b68642224.tar.xz sssd-cdcca90249aadb72bf2978a63c202c5b68642224.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
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ldap/sdap_idmap.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c index eed0b02b8..aad8e34aa 100644 --- a/src/providers/ldap/sdap_idmap.c +++ b/src/providers/ldap/sdap_idmap.c @@ -527,9 +527,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; } |