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