Blame SOURCES/0002-adcli_entry-add-entry_attrs-with-userAccountControl-.patch

419917
From 7148ab196d0a96ede9b5ef463b0481d0fe372b21 Mon Sep 17 00:00:00 2001
419917
From: Sumit Bose <sbose@redhat.com>
419917
Date: Fri, 11 Jun 2021 12:46:03 +0200
419917
Subject: [PATCH 2/3] adcli_entry: add entry_attrs with userAccountControl
419917
 attribute
419917
419917
---
419917
 library/adentry.c | 8 ++++++--
419917
 1 file changed, 6 insertions(+), 2 deletions(-)
419917
419917
diff --git a/library/adentry.c b/library/adentry.c
419917
index 1cc0518..13dcaf8 100644
419917
--- a/library/adentry.c
419917
+++ b/library/adentry.c
419917
@@ -42,6 +42,7 @@ struct _adcli_entry {
419917
 	char *entry_dn;
419917
 	char *domain_ou;
419917
 	char *entry_container;
419917
+	LDAPMessage *entry_attrs;
419917
 };
419917
 
419917
 static adcli_entry *
419917
@@ -63,6 +64,7 @@ entry_new (adcli_conn *conn,
419917
 
419917
 	entry->builder = builder;
419917
 	entry->object_class = object_class;
419917
+	entry->entry_attrs = NULL;
419917
 	return entry;
419917
 }
419917
 
419917
@@ -82,6 +84,7 @@ entry_free (adcli_entry *entry)
419917
 	free (entry->entry_container);
419917
 	free (entry->entry_dn);
419917
 	free (entry->domain_ou);
419917
+	ldap_msgfree (entry->entry_attrs);
419917
 	adcli_conn_unref (entry->conn);
419917
 	free (entry);
419917
 }
419917
@@ -102,7 +105,7 @@ static adcli_result
419917
 update_entry_from_domain (adcli_entry *entry,
419917
                           LDAP *ldap)
419917
 {
419917
-	const char *attrs[] = { "1.1", NULL };
419917
+	const char *attrs[] = { "userAccountControl", NULL };
419917
 	LDAPMessage *results;
419917
 	LDAPMessage *first;
419917
 	const char *base;
419917
@@ -139,7 +142,8 @@ update_entry_from_domain (adcli_entry *entry,
419917
 		return_unexpected_if_fail (entry->entry_dn != NULL);
419917
 	}
419917
 
419917
-	ldap_msgfree (results);
419917
+	ldap_msgfree (entry->entry_attrs);
419917
+	entry->entry_attrs = results;
419917
 	return ADCLI_SUCCESS;
419917
 }
419917
 
419917
-- 
419917
2.31.1
419917