summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-10 11:26:36 +1100
committerAndrew Tridgell <tridge@samba.org>2009-12-10 17:51:27 +1100
commitd337cefa92e959a611027307e52118de787ab7f5 (patch)
treeb75cf4c756710e0a568e716a7583d3e71873109c /source4/dsdb
parent56b887e5b94efedd0203550f6bc21d767da5d6c6 (diff)
downloadsamba-d337cefa92e959a611027307e52118de787ab7f5.tar.gz
samba-d337cefa92e959a611027307e52118de787ab7f5.tar.bz2
samba-d337cefa92e959a611027307e52118de787ab7f5.zip
s4-dsdb: simplify samdb_result_guid()
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index dceff3643e..470406ea55 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -396,22 +396,15 @@ struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa
struct GUID samdb_result_guid(const struct ldb_message *msg, const char *attr)
{
const struct ldb_val *v;
- enum ndr_err_code ndr_err;
struct GUID guid;
- TALLOC_CTX *mem_ctx;
-
- ZERO_STRUCT(guid);
+ NTSTATUS status;
v = ldb_msg_find_ldb_val(msg, attr);
if (!v) return guid;
- mem_ctx = talloc_named_const(NULL, 0, "samdb_result_guid");
- if (!mem_ctx) return guid;
- ndr_err = ndr_pull_struct_blob(v, mem_ctx, NULL, &guid,
- (ndr_pull_flags_fn_t)ndr_pull_GUID);
- talloc_free(mem_ctx);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return guid;
+ status = GUID_from_ndr_blob(v, &guid);
+ if (!NT_STATUS_IS_OK(status)) {
+ return GUID_zero();
}
return guid;