diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-12-16 09:50:49 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-12-16 09:50:49 +0000 |
commit | 6f12e4ace1609fbf00d42226134b1dbb259f38bc (patch) | |
tree | 7f116155578f01adfed2c4c5085a022b717025ea /source4/lib | |
parent | 7779b1e00022599f9b77dab7f5f983d930514f15 (diff) | |
download | samba-6f12e4ace1609fbf00d42226134b1dbb259f38bc.tar.gz samba-6f12e4ace1609fbf00d42226134b1dbb259f38bc.tar.bz2 samba-6f12e4ace1609fbf00d42226134b1dbb259f38bc.zip |
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)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/util_uuid.c | 26 |
1 files changed, 26 insertions, 0 deletions
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; +} |