Blame SOURCES/0085-ad-add-required-cn-attribute-to-subdomain-object.patch

5a92ae
From 64192cf7c2823ae93820623b0ae285b697fabe12 Mon Sep 17 00:00:00 2001
5a92ae
From: Sumit Bose <sbose@redhat.com>
5a92ae
Date: Thu, 16 Dec 2021 11:14:18 +0100
5a92ae
Subject: [PATCH] ad: add required 'cn' attribute to subdomain object
5a92ae
MIME-Version: 1.0
5a92ae
Content-Type: text/plain; charset=UTF-8
5a92ae
Content-Transfer-Encoding: 8bit
5a92ae
5a92ae
If the forest root is not part of the return trusted domain objects
5a92ae
from the local domain controller we generate an object for further
5a92ae
processing. During this processing it is expected that the 'cn'
5a92ae
attribute is set and contains the name of the forest root. So far this
5a92ae
attribute was missing and it is now added by this patch.
5a92ae
5a92ae
Resolves: https://github.com/SSSD/sssd/issues/5926
5a92ae
5a92ae
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
5a92ae
(cherry picked from commit bf6059eb55c8caa3111ef718db1676c96a67c084)
5a92ae
---
5a92ae
 src/providers/ad/ad_subdomains.c | 7 +++++++
5a92ae
 1 file changed, 7 insertions(+)
5a92ae
5a92ae
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
5a92ae
index e4e248c1d..c92faba95 100644
5a92ae
--- a/src/providers/ad/ad_subdomains.c
5a92ae
+++ b/src/providers/ad/ad_subdomains.c
5a92ae
@@ -1649,6 +1649,13 @@ static void ad_check_root_domain_done(struct tevent_req *subreq)
5a92ae
         goto done;
5a92ae
     }
5a92ae
 
5a92ae
+    ret = sysdb_attrs_add_string(state->reply[0], AD_AT_DOMAIN_NAME,
5a92ae
+                                 state->forest);
5a92ae
+    if (ret != EOK) {
5a92ae
+        DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string() failed.\n");
5a92ae
+        goto done;
5a92ae
+    }
5a92ae
+
5a92ae
     err = sss_idmap_sid_to_bin_sid(state->idmap_ctx->map, id,
5a92ae
                                    &id_val.data, &id_val.length);
5a92ae
     if (err != IDMAP_SUCCESS) {
5a92ae
-- 
5a92ae
2.26.3
5a92ae