cluster: STABLE3 - config: Remove superflous empty objects created by LDAP loader.
Christine Caulfield
chrissie@fedoraproject.org
Thu Sep 10 13:31:00 GMT 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=631ec23c7baf7fc4ff6cad16fba7f8a02ebe0dcc
Commit: 631ec23c7baf7fc4ff6cad16fba7f8a02ebe0dcc
Parent: 0a053b10bf5888a0bc879296bef6fe7e5565400a
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Thu Sep 10 14:29:11 2009 +0100
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Thu Sep 10 14:29:11 2009 +0100
config: Remove superflous empty objects created by LDAP loader.
These could cause the configuration to fail to validate. It would work
OK but ccs_config_validate didn't like it. ... and it looked odd.
Also corrected an error message that said ldap_bind_simple failed when
it was actually ldap_initialize (sic).
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
config/plugins/ldap/configldap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/config/plugins/ldap/configldap.c b/config/plugins/ldap/configldap.c
index 704763f..c4549ae 100644
--- a/config/plugins/ldap/configldap.c
+++ b/config/plugins/ldap/configldap.c
@@ -195,6 +195,9 @@ static int read_config_for(LDAP *ld, struct objdb_iface_ver0 *objdb, hdb_handle_
parsed_dn[0][0][0].la_value.bv_len);
}
else {
+ /* Remove redundant empty parent. */
+ objdb->object_destroy(object_handle);
+
parent_handle = find_parent(objdb, parsed_dn, 2, object);
/* Create a new object with the same name as the current one */
objdb->object_create(parent_handle, &object_handle, parsed_dn[1][0][0].la_value.bv_val,
@@ -264,7 +267,7 @@ static int init_config(struct objdb_iface_ver0 *objdb)
/* Connect to the LDAP server */
if (ldap_initialize(&ld, ldap_url)) {
- sprintf(error_reason, "ldap_simple_bind failed: %s\n", strerror(errno));
+ sprintf(error_reason, "ldap_initialize failed: %s\n", strerror(errno));
return -1;
}
version = LDAP_VERSION3;
More information about the Cluster-cvs
mailing list