summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-10-13 05:04:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:46 -0500
commit0fa924bb8f446e35a0fd543cda20b23c81e7dc9e (patch)
treeecf2d9c4d72b4a33a14a282fb2aada4a51d20147 /source4/lib/ldb/common
parentd96f706bb0a6b41eddec9d467ef3d5f31bee41ab (diff)
downloadsamba-0fa924bb8f446e35a0fd543cda20b23c81e7dc9e.tar.gz
samba-0fa924bb8f446e35a0fd543cda20b23c81e7dc9e.tar.bz2
samba-0fa924bb8f446e35a0fd543cda20b23c81e7dc9e.zip
r10954: added support for canonicalName in the operational module, using the
dn->canonicalName function abartlet just committed (This used to be commit 197e8a27f0557869eacd17b74e1b14e0665883b1)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_msg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index 977f68144b..f4a49e47ce 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -618,6 +618,19 @@ int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *rep
/*
+ remove the specified attribute in a search result
+*/
+void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr)
+{
+ struct ldb_message_element *el = ldb_msg_find_element(msg, attr);
+ 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)