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