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