summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-05-04 08:47:29 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-05-04 02:34:40 +0200
commitc8e6d8b4875e7dc67734597b6db8e81806d94faa (patch)
tree8a8dd3834e4ea583d2482710d0aff5a6a3877ce0 /source4/dsdb/samdb/ldb_modules
parent62503179b5f3e8efe22abcf3b30ddb795db5d8c9 (diff)
downloadsamba-c8e6d8b4875e7dc67734597b6db8e81806d94faa.tar.gz
samba-c8e6d8b4875e7dc67734597b6db8e81806d94faa.tar.bz2
samba-c8e6d8b4875e7dc67734597b6db8e81806d94faa.zip
s4-dsdb: Use data_blob_string_const and add explaination for open-coded function in samldb
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri May 4 02:34:41 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 7db7ff0f04..41c97bf32a 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -2018,8 +2018,11 @@ static int samldb_service_principal_names_change(struct samldb_ctx *ac)
}
/*
- * append the new "servicePrincipalName" - code derived
- * from ldb_msg_add_value()
+ * append the new "servicePrincipalName" -
+ * code derived from ldb_msg_add_value().
+ *
+ * Open coded to make it clear that we must
+ * append to the MOD_REPLACE el created above.
*/
vals = talloc_realloc(ac->msg, el->values,
struct ldb_val,
@@ -2028,8 +2031,7 @@ static int samldb_service_principal_names_change(struct samldb_ctx *ac)
return ldb_module_oom(ac->module);
}
el->values = vals;
- el->values[el->num_values].data = (uint8_t *) new_str;
- el->values[el->num_values].length = strlen(new_str);
+ el->values[el->num_values] = data_blob_string_const(new_str);
++(el->num_values);
}
}