From 5e3966c99180abdcd1e21774a882f1c14c47aae8 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 2 Mar 2009 09:35:06 -0500 Subject: Implement GetUserAttributes in the InfoPipe This patch adds support for requesting user data in the sysdb via the InfoPipe. It currently has support for reading defined entries of integral, floating-point or string types. Tasks remaining: 1) Implement call to the provider when cache is out of date 2) Support byte arrays for userpic and similar I modified sysdb_search_ctx in sysdb_search.c to accept an array of attributes to pass into the LDB search. I also made one additional related fix: the btreemap now sorts in the correct order. Previously I had accidentally transposed the two values for sorting, so the map would always have been in exact reverse order. --- server/util/btreemap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/util/btreemap.c') diff --git a/server/util/btreemap.c b/server/util/btreemap.c index 2d9b1761c..9bfc98550 100644 --- a/server/util/btreemap.c +++ b/server/util/btreemap.c @@ -65,7 +65,7 @@ int btreemap_search_key(struct btreemap *map, const void *key, struct btreemap * tempnode = map; while (found == BTREEMAP_EMPTY) { - result = tempnode->comparator(tempnode->key, key); + result = tempnode->comparator(key, tempnode->key); if (result > 0) { if (tempnode->right) @@ -150,6 +150,8 @@ int btreemap_set_value(TALLOC_CTX *mem_ctx, new_node->key = talloc_steal(new_node, key); new_node->value = talloc_steal(new_node, value); new_node->comparator = comparator; + new_node->left = NULL; + new_node->right = NULL; if (found == BTREEMAP_EMPTY) -- cgit