From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26793 invoked by alias); 10 Sep 2009 13:31:42 -0000 Received: (qmail 26781 invoked by alias); 10 Sep 2009 13:31:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - config: Remove superflous empty objects created by LDAP loader. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 0a053b10bf5888a0bc879296bef6fe7e5565400a X-Git-Newrev: 631ec23c7baf7fc4ff6cad16fba7f8a02ebe0dcc From: Christine Caulfield Message-Id: <20090910133112.3C5681201EF@lists.fedorahosted.org> Date: Thu, 10 Sep 2009 13:31:00 -0000 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00332.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=631ec23c7baf7fc4ff6cad16fba7f8a02ebe0dcc Commit: 631ec23c7baf7fc4ff6cad16fba7f8a02ebe0dcc Parent: 0a053b10bf5888a0bc879296bef6fe7e5565400a Author: Christine Caulfield AuthorDate: Thu Sep 10 14:29:11 2009 +0100 Committer: Christine Caulfield 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 --- 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;