summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2017-03-02 13:52:54 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-03-02 17:29:04 +0100
commit8718ff9ccd29f6431bfa8630bfa3576b2692c9ee (patch)
treee8ff8e799ab839821bd01c68fc13a25d5f11b8d9 /src/db
parente0ca21d9f899c60cc50030c6ae793c48e92b5b7f (diff)
downloadsssd-8718ff9ccd29f6431bfa8630bfa3576b2692c9ee.tar.gz
sssd-8718ff9ccd29f6431bfa8630bfa3576b2692c9ee.tar.xz
sssd-8718ff9ccd29f6431bfa8630bfa3576b2692c9ee.zip
UTIL: Store UPN suffixes when creating a new subdomain
We used to store UPN suffixes pointer into the domain structure only if the domain changed, not when a new domain was created. As an effect, the enterprise principals flag was not enabled unless a domain changed, preventing logins with enterprise principals. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_private.h1
-rw-r--r--src/db/sysdb_subdomains.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
index b6bf3706e..bfd247999 100644
--- a/src/db/sysdb_private.h
+++ b/src/db/sysdb_private.h
@@ -190,6 +190,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
bool mpg,
bool enumerate,
const char *forest,
+ const char **upn_suffixes,
uint32_t trust_direction);
/* Helper functions to deal with the timestamp cache should not be used
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 1f43bfc12..01f49763b 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -32,6 +32,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
bool mpg,
bool enumerate,
const char *forest,
+ const char **upn_suffixes,
uint32_t trust_direction)
{
struct sss_domain_info *dom;
@@ -108,6 +109,14 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
}
}
+ if (upn_suffixes != NULL) {
+ dom->upn_suffixes = dup_string_list(dom, upn_suffixes);
+ if (dom->upn_suffixes == NULL) {
+ DEBUG(SSSDBG_OP_FAILURE, "Failed to copy UPN upn_suffixes.\n");
+ goto fail;
+ }
+ }
+
dom->enumerate = enumerate;
dom->fqnames = true;
dom->mpg = mpg;
@@ -442,7 +451,7 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
if (dom == NULL) {
dom = new_subdomain(domain, domain, name, realm,
flat, id, mpg, enumerate, forest,
- trust_direction);
+ upn_suffixes, trust_direction);
if (dom == NULL) {
ret = ENOMEM;
goto done;