diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-11-16 13:14:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:53 -0500 |
commit | c3eb37f292cd0b31063d25f0f0cc3dfe53b320e5 (patch) | |
tree | 2634fa3590dbc03a4c051990b71f4a1ec400d90f /source4 | |
parent | 4af8f37d64dc24e6747589b90eae253d930b311a (diff) | |
download | samba-c3eb37f292cd0b31063d25f0f0cc3dfe53b320e5.tar.gz samba-c3eb37f292cd0b31063d25f0f0cc3dfe53b320e5.tar.bz2 samba-c3eb37f292cd0b31063d25f0f0cc3dfe53b320e5.zip |
r3787: a function to generate a random GUID
metze
(This used to be commit 8bd2e3cb4e5123a3e26965b8535e16ee18005714)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 70fd0b34a4..9507f4d33b 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -1195,6 +1195,16 @@ NTSTATUS GUID_from_string(const char *s, struct GUID *guid) return NT_STATUS_OK; } +/* generate a random GUID */ +struct GUID GUID_random(void) +{ + struct GUID guid; + + generate_random_buffer((uint8_t *)&guid, sizeof(guid)); + + return guid; +} + /* its useful to be able to display these in debugging messages */ |