diff options
author | Simo Sorce <idra@samba.org> | 2006-08-13 07:33:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:31 -0500 |
commit | faed8175063b16df94d5332581baf1af0562bb09 (patch) | |
tree | eb7c5b5fee25bf0e004f76ba40dad3785ef3ef9f /source4/lib/ldb/common/ldb_msg.c | |
parent | a9ad616a6820cb98f85e2543f65a2b711e080da7 (diff) | |
download | samba-faed8175063b16df94d5332581baf1af0562bb09.tar.gz samba-faed8175063b16df94d5332581baf1af0562bb09.tar.bz2 samba-faed8175063b16df94d5332581baf1af0562bb09.zip |
r17514: Simplify the way to set ldb errors and add another
helper function to set them.
(This used to be commit 260868bae56194fcb98d55afc22fc66d96a303df)
Diffstat (limited to 'source4/lib/ldb/common/ldb_msg.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 2fe9e39e68..b0dc74bdb5 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -571,12 +571,12 @@ int ldb_msg_sanity_check(struct ldb_context *ldb, /* basic check on DN */ if (msg->dn == NULL) { /* TODO: return also an error string */ - ldb_set_errstring(ldb, talloc_strdup(ldb, "ldb message lacks a DN!")); + ldb_set_errstring(ldb, "ldb message lacks a DN!"); return LDB_ERR_INVALID_DN_SYNTAX; } if (msg->dn->comp_num == 0) { /* root dse has empty dn */ - ldb_set_errstring(ldb, talloc_strdup(ldb, "DN on new ldb message is '' (not permitted)!")); + ldb_set_errstring(ldb, "DN on new ldb message is '' (not permitted)!"); return LDB_ERR_ENTRY_ALREADY_EXISTS; } @@ -587,9 +587,9 @@ int ldb_msg_sanity_check(struct ldb_context *ldb, TALLOC_CTX *mem_ctx = talloc_new(ldb); /* an attribute cannot be empty */ /* TODO: return also an error string */ - ldb_set_errstring(ldb, talloc_asprintf(mem_ctx, "Element %s has empty attribute in ldb message (%s)!", - msg->elements[i].name, - ldb_dn_linearize(mem_ctx, msg->dn))); + ldb_asprintf_errstring(ldb, "Element %s has empty attribute in ldb message (%s)!", + msg->elements[i].name, + ldb_dn_linearize(mem_ctx, msg->dn)); talloc_free(mem_ctx); return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX; } |