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

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