summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_attributes.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-07-02 17:30:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:06 -0500
commit1c5105065a44173667de2a022dd2417e56b527d6 (patch)
tree165be48497b07108926b29cc9b9e94f79ab9632d /source4/lib/ldb/common/ldb_attributes.c
parent2e419725b0e7b4dcb43340ae93ae7bb60b4a5597 (diff)
downloadsamba-1c5105065a44173667de2a022dd2417e56b527d6.tar.gz
samba-1c5105065a44173667de2a022dd2417e56b527d6.tar.bz2
samba-1c5105065a44173667de2a022dd2417e56b527d6.zip
r8082: large rewite of ldb_dn.c
- we do not support multpiple attribute components anymore, makes code a lot easier they will be readded later if we found out they are really used, so far my tests show w2k3 do not handle them as well - fix escaping issues, move component value to be in an ldb_val structure still need to handle binary values case - make cononicalize functions leak less memory by giving a specific memory context - fix tests scripts so that test-ldap can start - make test not delete databases on completion so that I can inspect them (This used to be commit 624a73148d125690ce18515f19231d26df207738)
Diffstat (limited to 'source4/lib/ldb/common/ldb_attributes.c')
-rw-r--r--source4/lib/ldb/common/ldb_attributes.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c
index e053ccbbf2..3d4f24771f 100644
--- a/source4/lib/ldb/common/ldb_attributes.c
+++ b/source4/lib/ldb/common/ldb_attributes.c
@@ -60,10 +60,16 @@ int ldb_set_attrib_handlers(struct ldb_context *ldb,
default function for read/write/canonicalise
*/
static int ldb_default_copy(struct ldb_context *ldb,
+ void *mem_ctx,
const struct ldb_val *in,
struct ldb_val *out)
{
- *out = *in;
+ *out = ldb_val_dup(mem_ctx, in);
+
+ if (out->length == 0) {
+ return -1;
+ }
+
return 0;
}
@@ -71,6 +77,7 @@ static int ldb_default_copy(struct ldb_context *ldb,
default function for comparison
*/
static int ldb_default_cmp(struct ldb_context *ldb,
+ void *mem_ctx,
const struct ldb_val *v1,
const struct ldb_val *v2)
{