summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-11-10 20:35:32 +0100
committerGünther Deschner <gd@samba.org>2008-11-10 21:46:25 +0100
commite78379be0b829da3d41971182f468892a623dd7e (patch)
tree5ea12b5b932c3b379039ca44c377ade5aed23d52 /source4
parent0474c8665d47ca6f89e483ff20f6401698095b55 (diff)
downloadsamba-e78379be0b829da3d41971182f468892a623dd7e.tar.gz
samba-e78379be0b829da3d41971182f468892a623dd7e.tar.bz2
samba-e78379be0b829da3d41971182f468892a623dd7e.zip
s4-dsdb: add samdb_result_parameters.
Guenther
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/common/util.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 69e456274c..de2073fee0 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -657,6 +657,28 @@ uint32_t samdb_result_acct_flags(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ct
return acct_flags;
}
+struct lsa_BinaryString samdb_result_parameters(TALLOC_CTX *mem_ctx,
+ struct ldb_message *msg,
+ const char *attr)
+{
+ struct lsa_BinaryString s;
+ const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
+
+ ZERO_STRUCT(s);
+
+ if (!val) {
+ return s;
+ }
+
+ s.array = talloc_array(mem_ctx, uint16_t, val->length/2);
+ if (!s.array) {
+ return s;
+ }
+ s.length = s.size = val->length/2;
+ memcpy(s.array, val->data, val->length);
+
+ return s;
+}
/* Find an attribute, with a particular value */