diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-06-15 15:42:18 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2016-06-17 18:13:56 +0200 |
commit | 61cb3a6a3b948b2c1768d29236a59c3620fc4331 (patch) | |
tree | 286e03f36a90540b9407ca4598e7fa3ec5e1829a /lib/ldb-samba | |
parent | 0fc95c12b651efbe3eb1005e42459b60780be482 (diff) | |
download | samba-61cb3a6a3b948b2c1768d29236a59c3620fc4331.tar.gz |
lib/ldb-samba: We can confirm a GUID is a GUID by length
The GUID_from_ndr_blob() is pointless and costly
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 17 18:13:56 CEST 2016 on sn-devel-144
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r-- | lib/ldb-samba/ldif_handlers.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c index 87c171e28d2..c0972a4a6a7 100644 --- a/lib/ldb-samba/ldif_handlers.c +++ b/lib/ldb-samba/ldif_handlers.c @@ -265,8 +265,6 @@ static bool ldif_comparision_objectGUID_isString(const struct ldb_val *v) static int extended_dn_read_GUID(struct ldb_context *ldb, void *mem_ctx, const struct ldb_val *in, struct ldb_val *out) { - struct GUID guid; - NTSTATUS status; if (in->length == 36 && ldif_read_objectGUID(ldb, mem_ctx, in, out) == 0) { return 0; @@ -285,13 +283,13 @@ static int extended_dn_read_GUID(struct ldb_context *ldb, void *mem_ctx, (*out).length = strhex_to_str((char *)out->data, out->length, (const char *)in->data, in->length); - + /* Check it looks like a GUID */ - status = GUID_from_ndr_blob(out, &guid); - if (!NT_STATUS_IS_OK(status)) { + if ((*out).length != 16) { data_blob_free(out); return -1; } + return 0; } |