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

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