summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/common
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-16 11:18:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:52 -0500
commit9e7e5938abd9d542966a54374ca652679f42e8ee (patch)
tree17dce4f0438c6014e914e7445329494ea758270f /source3/lib/ldb/common
parent5a77ccfbfc070ccb77004cb47e2a582883e4862c (diff)
downloadsamba-9e7e5938abd9d542966a54374ca652679f42e8ee.tar.gz
samba-9e7e5938abd9d542966a54374ca652679f42e8ee.tar.bz2
samba-9e7e5938abd9d542966a54374ca652679f42e8ee.zip
r19744: merge from samba4
metze (This used to be commit fe61e6ebf7d771ce6441198bf2e330d53bf7b10e)
Diffstat (limited to 'source3/lib/ldb/common')
-rw-r--r--source3/lib/ldb/common/ldb_msg.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/lib/ldb/common/ldb_msg.c b/source3/lib/ldb/common/ldb_msg.c
index 9cb4cf5ed0..65d1ecacb7 100644
--- a/source3/lib/ldb/common/ldb_msg.c
+++ b/source3/lib/ldb/common/ldb_msg.c
@@ -654,7 +654,7 @@ const char **ldb_attr_list_copy(TALLOC_CTX *mem_ctx, const char * const *attrs)
/*
copy an attribute list. This only copies the array, not the elements
- (ie. the elements are left as the same pointers)
+ (ie. the elements are left as the same pointers). The new attribute is added to the list.
*/
const char **ldb_attr_list_copy_add(TALLOC_CTX *mem_ctx, const char * const *attrs, const char *new_attr)
{
@@ -738,6 +738,18 @@ void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr)
}
/*
+ remove the specified element in a search result
+*/
+void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element *el)
+{
+ int n = (el - msg->elements);
+ if (n != msg->num_elements-1) {
+ memmove(el, el+1, ((msg->num_elements-1) - n)*sizeof(*el));
+ }
+ msg->num_elements--;
+}
+
+/*
return a LDAP formatted time string
*/
char *ldb_timestring(TALLOC_CTX *mem_ctx, time_t t)