summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-14 02:41:20 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-14 02:41:20 +0200
commit389cfee579a3222e6f536971af2fc0cb30596475 (patch)
tree3bcd6271861fa3166791aee6aa8ff5d7156e6301
parent4c81727a003e4c49c314e0c5a1b4584b8825e7fe (diff)
downloadsamba-389cfee579a3222e6f536971af2fc0cb30596475.tar.gz
samba-389cfee579a3222e6f536971af2fc0cb30596475.tar.bz2
samba-389cfee579a3222e6f536971af2fc0cb30596475.zip
Use GUID_random.
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/util_uuid.c11
-rw-r--r--source3/passdb/secrets.c2
3 files changed, 1 insertions, 13 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 480b3eb4d9..8f2c813954 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1762,7 +1762,6 @@ int islower_ascii(int c);
void smb_uuid_pack(const struct GUID uu, UUID_FLAT *ptr);
void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu);
-void smb_uuid_generate_random(struct GUID *uu);
char *guid_binstring(const struct GUID *guid);
/* The following definitions come from lib/version.c */
diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c
index 7e67d791e3..c681b66d34 100644
--- a/source3/lib/util_uuid.c
+++ b/source3/lib/util_uuid.c
@@ -38,17 +38,6 @@ void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu)
memcpy(uu->node, in.info+10, 6);
}
-void smb_uuid_generate_random(struct GUID *uu)
-{
- UUID_FLAT tmp;
-
- generate_random_buffer(tmp.info, sizeof(tmp.info));
- smb_uuid_unpack(tmp, uu);
-
- uu->clock_seq[0] = (uu->clock_seq[0] & 0x3F) | 0x80;
- uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
-}
-
/*****************************************************************
Return the binary string representation of a GUID.
Caller must free.
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 306d4d0a35..a6adb904e2 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -238,7 +238,7 @@ bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid)
if (!dyn_guid) {
if (lp_server_role() == ROLE_DOMAIN_PDC) {
- smb_uuid_generate_random(&new_guid);
+ new_guid = GUID_random();
if (!secrets_store_domain_guid(domain, &new_guid))
return False;
dyn_guid = (struct GUID *)secrets_fetch(key, &size);