From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22673 invoked by alias); 3 Sep 2008 12:32:45 -0000 Received: (qmail 22667 invoked by alias); 3 Sep 2008 12:32:44 -0000 X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: master - config: fix ldap load bug caused by new objdb ordering in corosync To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 3941e5e4ce38ac3ac49d7dcf4e838dd30b063c62 X-Git-Newrev: e5918ff498807891c2074fa5ddfebfc5f649cae5 From: Christine Caulfield Message-Id: <20080903123139.47DD3C07B7@lists.fedorahosted.org> Date: Wed, 03 Sep 2008 12:34:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 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: 2008-q3/txt/msg00369.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e5918ff498807891c2074fa5ddfebfc5f649cae5 Commit: e5918ff498807891c2074fa5ddfebfc5f649cae5 Parent: 3941e5e4ce38ac3ac49d7dcf4e838dd30b063c62 Author: Christine Caulfield AuthorDate: Wed Sep 3 13:29:54 2008 +0100 Committer: Christine Caulfield CommitterDate: Wed Sep 3 13:29:54 2008 +0100 config: fix ldap load bug caused by new objdb ordering in corosync The LDAP loader assumed the old obdb behaviour that objects entered into the appeared in reverse order. This is no longer true - they are in the same order they were created. So this fixes LDAP to match this assumption. Signed-off-by: Christine Caulfield --- cman/daemon/cman-preconfig.c | 3 --- config/plugins/ldap/configldap.c | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c index 4926591..9d3f8f8 100644 --- a/cman/daemon/cman-preconfig.c +++ b/cman/daemon/cman-preconfig.c @@ -553,9 +553,6 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) write_cman_pipe("This node has no nodeid in cluster.conf"); return -1; } - sprintf(error_reason, "Failed to find node name in cluster.conf"); - write_cman_pipe("Failed to find node name in cluster.conf"); - return -1; } objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle); diff --git a/config/plugins/ldap/configldap.c b/config/plugins/ldap/configldap.c index 0f49cc0..7c2fbab 100644 --- a/config/plugins/ldap/configldap.c +++ b/config/plugins/ldap/configldap.c @@ -139,7 +139,7 @@ static unsigned int find_parent(struct objdb_iface_ver0 *objdb, LDAPDN dn, int s objdb->object_find_create(parent_handle, dn[i][0][0].la_value.bv_val, dn[i][0][0].la_value.bv_len, &find_handle); - if (!objdb->object_find_next(find_handle, &object_handle)) { + while (!objdb->object_find_next(find_handle, &object_handle)) { parent_handle = object_handle; } objdb->object_find_destroy(find_handle); @@ -203,7 +203,6 @@ static int read_config_for(LDAP *ld, struct objdb_iface_ver0 *objdb, unsigned in /* 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, parsed_dn[1][0][0].la_value.bv_len); - } /* Finished with the text representation */ @@ -236,10 +235,12 @@ static int read_config_for(LDAP *ld, struct objdb_iface_ver0 *objdb, unsigned in * as they don't provide anything we can use */ if (strcmp("objectClass", attr) && - strcmp("cn", attr)) + strcmp("cn", attr)) { objdb->object_key_create(object_handle, attr, strlen(attr), val_ber[i]->bv_val, val_ber[i]->bv_len+1); + fprintf(stderr, "Created key %s=%s\n",attr, val_ber[i]->bv_val); + } i++; } ldap_memfree(attr);