summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_msg.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-04 00:38:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:44 -0500
commitf5ebc8e404f4397c0ef2c8b838984df1767c955c (patch)
treed2a1594cb7180375d4c11986cc308c42f391ad4d /source4/lib/ldb/common/ldb_msg.c
parentc838f4965b8b7b2b134fd4855301227f19e4c95d (diff)
downloadsamba-f5ebc8e404f4397c0ef2c8b838984df1767c955c.tar.gz
samba-f5ebc8e404f4397c0ef2c8b838984df1767c955c.tar.bz2
samba-f5ebc8e404f4397c0ef2c8b838984df1767c955c.zip
r13324: From now on check attribute names obey rfc2251
Also add a way to provide utf8 compliant functions by registering them with ldb_set_utf8_fns() Next comes code to register samba internal utf8 functions. Simo. (This used to be commit ac9b8a41ffca8e06c5e849d544d3203a665b8e0d)
Diffstat (limited to 'source4/lib/ldb/common/ldb_msg.c')
-rw-r--r--source4/lib/ldb/common/ldb_msg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index 513a4de1f8..497d2cb0d5 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -123,6 +123,10 @@ int ldb_msg_add_empty(struct ldb_message *msg, const char *attr_name, int flags)
{
struct ldb_message_element *els;
+ if (! ldb_valid_attr_name(attr_name)) {
+ return -1;
+ }
+
els = talloc_realloc(msg, msg->elements,
struct ldb_message_element, msg->num_elements+1);
if (!els) {
@@ -135,6 +139,7 @@ int ldb_msg_add_empty(struct ldb_message *msg, const char *attr_name, int flags)
els[msg->num_elements].flags = flags;
els[msg->num_elements].name = talloc_strdup(els, attr_name);
if (!els[msg->num_elements].name) {
+ errno = ENOMEM;
return -1;
}