public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: master - config: fix ldap load bug caused by new objdb ordering in corosync
Date: Wed, 03 Sep 2008 12:34:00 -0000	[thread overview]
Message-ID: <20080903123139.47DD3C07B7@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e5918ff498807891c2074fa5ddfebfc5f649cae5
Commit:        e5918ff498807891c2074fa5ddfebfc5f649cae5
Parent:        3941e5e4ce38ac3ac49d7dcf4e838dd30b063c62
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Sep 3 13:29:54 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
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 <ccaulfie@redhat.com>
---
 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);


                 reply	other threads:[~2008-09-03 12:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080903123139.47DD3C07B7@lists.fedorahosted.org \
    --to=chrissie@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).