Blame SOURCES/0092-sysdb-add-userMappedCertificate-to-the-index.patch

9f2ebf
From 57a83eb8657a125d203a335b052d965c7a3b15de Mon Sep 17 00:00:00 2001
9f2ebf
From: Sumit Bose <sbose@redhat.com>
9f2ebf
Date: Mon, 8 Jan 2018 18:22:17 +0100
9f2ebf
Subject: [PATCH 92/96] sysdb: add userMappedCertificate to the index
9f2ebf
MIME-Version: 1.0
9f2ebf
Content-Type: text/plain; charset=UTF-8
9f2ebf
Content-Transfer-Encoding: 8bit
9f2ebf
9f2ebf
Related to https://pagure.io/SSSD/sssd/issue/3503
9f2ebf
9f2ebf
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
9f2ebf
(cherry picked from commit 5b78fff78bb44d1af5420db23b02210f755f5f17)
9f2ebf
---
9f2ebf
 src/db/sysdb_private.h |  1 +
9f2ebf
 src/db/sysdb_upgrade.c | 12 ++++++++++++
9f2ebf
 2 files changed, 13 insertions(+)
9f2ebf
9f2ebf
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
9f2ebf
index cac06ba46da23080d1ab661502d0792bd37b9291..c0a8e29ab9578acb27cf8d1db049c4260904fdda 100644
9f2ebf
--- a/src/db/sysdb_private.h
9f2ebf
+++ b/src/db/sysdb_private.h
9f2ebf
@@ -78,6 +78,7 @@
9f2ebf
      "@IDXATTR: canonicalUserPrincipalName\n" \
9f2ebf
      "@IDXATTR: uniqueID\n" \
9f2ebf
      "@IDXATTR: mail\n" \
9f2ebf
+     "@IDXATTR: userMappedCertificate\n" \
9f2ebf
      "\n" \
9f2ebf
      "dn: @MODULES\n" \
9f2ebf
      "@LIST: asq,memberof\n" \
9f2ebf
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
9f2ebf
index bc157a24664239bc1255e49a1825243a07acc90f..46df971e98f73dc28bc6764a478f13d871515124 100644
9f2ebf
--- a/src/db/sysdb_upgrade.c
9f2ebf
+++ b/src/db/sysdb_upgrade.c
9f2ebf
@@ -2475,6 +2475,18 @@ int sysdb_upgrade_19(struct sysdb_ctx *sysdb, const char **ver)
9f2ebf
         goto done;
9f2ebf
     }
9f2ebf
 
9f2ebf
+    ret = ldb_msg_add_empty(msg, "@IDXATTR", LDB_FLAG_MOD_ADD, NULL);
9f2ebf
+    if (ret != LDB_SUCCESS) {
9f2ebf
+        ret = ENOMEM;
9f2ebf
+        goto done;
9f2ebf
+    }
9f2ebf
+
9f2ebf
+    ret = ldb_msg_add_string(msg, "@IDXATTR", SYSDB_USER_MAPPED_CERT);
9f2ebf
+    if (ret != LDB_SUCCESS) {
9f2ebf
+        ret = ENOMEM;
9f2ebf
+        goto done;
9f2ebf
+    }
9f2ebf
+
9f2ebf
     ret = ldb_modify(sysdb->ldb, msg);
9f2ebf
     if (ret != LDB_SUCCESS) {
9f2ebf
         ret = sysdb_error_to_errno(ret);
9f2ebf
-- 
9f2ebf
2.14.3
9f2ebf