summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-07-16 14:18:49 +0300
committerAndrew Bartlett <abartlet@samba.org>2010-07-19 17:33:35 +1000
commit11a44ce6f885de1c1f78c791cbe85a915934ae8a (patch)
treeba3cb506f18211d9f32a0a6a4446dc550b727718 /source4/lib/ldb
parent31aeb841c9823574cb6f13986f4da34d00bb40a1 (diff)
downloadsamba-11a44ce6f885de1c1f78c791cbe85a915934ae8a.tar.gz
samba-11a44ce6f885de1c1f78c791cbe85a915934ae8a.tar.bz2
samba-11a44ce6f885de1c1f78c791cbe85a915934ae8a.zip
ldb: Mark _DEPRECATED_ ldb_msg_diff() and ldb_msg_canonicalize() functions
They are not quite safe to use (requires caller to steal resulting message in own context) and may lead to holding memory for too long. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/include/ldb.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 065aa31682..b3d874e36f 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -86,6 +86,14 @@ struct ldb_val {
#ifndef PRINTF_ATTRIBUTE
#define PRINTF_ATTRIBUTE(a,b)
#endif
+
+#ifndef _DEPRECATED_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
+#endif
/*! \endcond */
/* opaque ldb_dn structures, see ldb_dn.c for internals */
@@ -1851,8 +1859,17 @@ struct ldb_message *ldb_msg_copy_shallow(TALLOC_CTX *mem_ctx,
struct ldb_message *ldb_msg_copy(TALLOC_CTX *mem_ctx,
const struct ldb_message *msg);
+/*
+ * ldb_msg_canonicalize() is now depreciated
+ * Please use ldb_msg_normalize() instead
+ *
+ * NOTE: Returned ldb_message object is allocated
+ * into *ldb's context. Callers are recommended
+ * to steal the returned object into a TALLOC_CTX
+ * with short lifetime.
+ */
struct ldb_message *ldb_msg_canonicalize(struct ldb_context *ldb,
- const struct ldb_message *msg);
+ const struct ldb_message *msg) _DEPRECATED_;
int ldb_msg_normalize(struct ldb_context *ldb,
TALLOC_CTX *mem_ctx,
@@ -1860,9 +1877,18 @@ int ldb_msg_normalize(struct ldb_context *ldb,
struct ldb_message **_msg_out);
+/*
+ * ldb_msg_diff() is now depreciated
+ * Please use ldb_msg_difference() instead
+ *
+ * NOTE: Returned ldb_message object is allocated
+ * into *ldb's context. Callers are recommended
+ * to steal the returned object into a TALLOC_CTX
+ * with short lifetime.
+ */
struct ldb_message *ldb_msg_diff(struct ldb_context *ldb,
struct ldb_message *msg1,
- struct ldb_message *msg2);
+ struct ldb_message *msg2) _DEPRECATED_;
/**
* return a ldb_message representing the differences between msg1 and msg2.