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

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