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

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