dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0008-sysdb-sysdb_certmap_add-handle-domains-more-flexible.patch

71e593
From 357323d3312d4f2c6a2bbbea03f2296e3368e45a Mon Sep 17 00:00:00 2001
71e593
From: Sumit Bose <sbose@redhat.com>
71e593
Date: Tue, 3 Jul 2018 11:31:12 +0200
71e593
Subject: [PATCH 08/19] sysdb: sysdb_certmap_add() handle domains more flexible
71e593
71e593
sysdb_ldb_msg_attr_to_certmap_info() creates an empty list if there are
71e593
no domains defined, sysdb_certmap_add() should be able to handle both a
71e593
missing or an empty domains list.
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 06f7005d38d164879b727708feff80004b422f91)
71e593
---
71e593
 src/db/sysdb_certmap.c | 2 +-
71e593
 1 file changed, 1 insertion(+), 1 deletion(-)
71e593
71e593
diff --git a/src/db/sysdb_certmap.c b/src/db/sysdb_certmap.c
71e593
index e37f1ba830f297137991c7757af9c7c4e17b2813..0bcc54c4d1eb0ede7de088e3e945a48f1549c88c 100644
71e593
--- a/src/db/sysdb_certmap.c
71e593
+++ b/src/db/sysdb_certmap.c
71e593
@@ -131,7 +131,7 @@ static errno_t sysdb_certmap_add(struct sysdb_ctx *sysdb,
71e593
         }
71e593
     }
71e593
 
71e593
-    if (certmap->domains != NULL) {
71e593
+    if (certmap->domains != NULL && certmap->domains[0] != NULL) {
71e593
         for (c = 0; certmap->domains[c] != NULL; c++);
71e593
         el = talloc_zero(tmp_ctx, struct ldb_message_element);
71e593
         if (el == NULL) {
71e593
-- 
71e593
2.14.4
71e593