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

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