From 15301db1dc1e5e2aafc1805a30e3b28756218c9b Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 2 Jul 2018 12:20:53 +0200 Subject: [PATCH 25/83] AD/LDAP: read certificate mapping rules from config file Related to https://pagure.io/SSSD/sssd/issue/3500 Reviewed-by: Jakub Hrozek --- src/providers/ad/ad_init.c | 16 ++++++++++++++++ src/providers/ldap/ldap_init.c | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c index 637efb7..a908571 100644 --- a/src/providers/ad/ad_init.c +++ b/src/providers/ad/ad_init.c @@ -419,6 +419,22 @@ static errno_t ad_init_misc(struct be_ctx *be_ctx, return ret; } + ret = confdb_certmap_to_sysdb(be_ctx->cdb, be_ctx->domain); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to initialize certificate mapping rules. " + "Authentication with certificates/Smartcards might not work " + "as expected.\n"); + /* not fatal, ignored */ + } + + ret = sdap_init_certmap(sdap_id_ctx, sdap_id_ctx); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to initialized certificate mapping.\n"); + return ret; + } + return EOK; } diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c index 44b3e9a..95e6561 100644 --- a/src/providers/ldap/ldap_init.c +++ b/src/providers/ldap/ldap_init.c @@ -438,6 +438,22 @@ static errno_t ldap_init_misc(struct be_ctx *be_ctx, "[%d]: %s\n", ret, sss_strerror(ret)); } + ret = confdb_certmap_to_sysdb(be_ctx->cdb, be_ctx->domain); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to initialize certificate mapping rules. " + "Authentication with certificates/Smartcards might not work " + "as expected.\n"); + /* not fatal, ignored */ + } + + ret = sdap_init_certmap(id_ctx, id_ctx); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, + "Failed to initialized certificate mapping.\n"); + return ret; + } + return EOK; } -- 2.9.5