diff options
author | Sumit Bose <sbose@redhat.com> | 2013-06-27 21:49:26 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-28 20:20:59 +0200 |
commit | 09d7c105839bfc7447ea0f766413ed86675ca075 (patch) | |
tree | 382c007bb5182e17af6243f67fd06e08627aad82 /src/providers | |
parent | 20ccfd63a17dc15dd24e6543424d86913d511c4b (diff) | |
download | sssd-09d7c105839bfc7447ea0f766413ed86675ca075.tar.gz sssd-09d7c105839bfc7447ea0f766413ed86675ca075.tar.bz2 sssd-09d7c105839bfc7447ea0f766413ed86675ca075.zip |
Save mpg state for subdomains
The information of a subdomain will use magic private groups (mpg) or
not will be stored together with other information about the domain in
the cache.
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/ad/ad_subdomains.c | 4 | ||||
-rw-r--r-- | src/providers/ipa/ipa_subdomains.c | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c index 20aaa2d7..724d0736 100644 --- a/src/providers/ad/ad_subdomains.c +++ b/src/providers/ad/ad_subdomains.c @@ -220,7 +220,9 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx, goto done; } - ret = sysdb_subdomain_store(domain->sysdb, name, realm, flat, sid_str); + /* AD subdomains are currently all mpg */ + ret = sysdb_subdomain_store(domain->sysdb, name, realm, flat, sid_str, + true); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_subdomain_store failed.\n")); goto done; diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index 119f44a5..a67526c8 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -23,6 +23,7 @@ */ #include "providers/ldap/sdap_async.h" +#include "providers/ldap/sdap_idmap.h" #include "providers/ipa/ipa_subdomains.h" #include "providers/ipa/ipa_common.h" #include <ctype.h> @@ -232,6 +233,7 @@ done: } static errno_t ipa_subdom_store(struct sss_domain_info *domain, + struct sdap_idmap_ctx *sdap_idmap_ctx, struct sysdb_attrs *attrs) { TALLOC_CTX *tmp_ctx; @@ -240,6 +242,7 @@ static errno_t ipa_subdom_store(struct sss_domain_info *domain, const char *flat; const char *id; int ret; + bool mpg; tmp_ctx = talloc_new(domain); if (tmp_ctx == NULL) { @@ -270,7 +273,9 @@ static errno_t ipa_subdom_store(struct sss_domain_info *domain, goto done; } - ret = sysdb_subdomain_store(domain->sysdb, name, realm, flat, id); + mpg = sdap_idmap_domain_has_algorithmic_mapping(sdap_idmap_ctx, id); + + ret = sysdb_subdomain_store(domain->sysdb, name, realm, flat, id, mpg); if (ret) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_subdomain_store failed.\n")); goto done; @@ -323,7 +328,8 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, } } else { /* ok let's try to update it */ - ret = ipa_subdom_store(domain, reply[c]); + ret = ipa_subdom_store(domain, ctx->sdap_id_ctx->opts->idmap_ctx, + reply[c]); if (ret) { /* Nothing we can do about the errorr. Let's at least try * to reuse the existing domain @@ -352,7 +358,8 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, /* Nothing we can do about the errorr. Let's at least try * to reuse the existing domain. */ - ret = ipa_subdom_store(domain, reply[c]); + ret = ipa_subdom_store(domain, ctx->sdap_id_ctx->opts->idmap_ctx, + reply[c]); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to parse subdom data, " "will try to use cached subdomain\n")); |