From 6f12e4ace1609fbf00d42226134b1dbb259f38bc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 Dec 2003 09:50:49 +0000 Subject: it turns out that a wire policy handle isn't a blob either, its a uint32 followed by a GUID. I needed to fix this to support running in mixed-mode rpc (where smbtorture is bigendian and w2k3 is little-endian). Otherwise when you send back a policy handle the server doesn't recognise it. (This used to be commit 9b1c76a8e9e953e051072441f8938ee17a674d35) --- source4/lib/util_uuid.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/util_uuid.c b/source4/lib/util_uuid.c index 0c607fb823..c7858aae72 100644 --- a/source4/lib/util_uuid.c +++ b/source4/lib/util_uuid.c @@ -28,3 +28,29 @@ void uuid_generate_random(struct GUID *out) out->clock_seq[0] = (out->clock_seq[0] & 0x3F) | 0x80; out->time_hi_and_version = (out->time_hi_and_version & 0x0FFF) | 0x4000; } + +BOOL uuid_all_zero(const struct GUID *u) +{ + if (u->time_low != 0 || + u->time_mid != 0 || + u->time_hi_and_version != 0 || + u->clock_seq[0] != 0 || + u->clock_seq[1] != 0 || + !all_zero(u->node, 6)) { + return False; + } + return True; +} + +BOOL uuid_equal(const struct GUID *u1, const struct GUID *u2) +{ + if (u1->time_low != u2->time_low || + u1->time_mid != u2->time_mid || + u1->time_hi_and_version != u2->time_hi_and_version || + u1->clock_seq[0] != u2->clock_seq[0] || + u1->clock_seq[1] != u2->clock_seq[1] || + memcmp(u1->node, u2->node, 6) != 0) { + return False; + } + return True; +} -- cgit