From c85f33458fff24c472ad440de3bbc15ee8f94f53 Mon Sep 17 00:00:00 2001 From: Andriy Syrovenko Date: Sat, 26 May 2012 23:41:16 +0300 Subject: [PATCH] Eliminate dependency on an external uuid library. --- lib/addns/dns.h | 4 ---- lib/addns/dnsutils.c | 20 +++++++------------- lib/addns/wscript | 3 ++- lib/addns/wscript_build | 2 +- source3/wscript | 6 +----- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/lib/addns/dns.h b/lib/addns/dns.h index 2864bdf5396..c0820fe0bd8 100644 --- a/lib/addns/dns.h +++ b/lib/addns/dns.h @@ -42,10 +42,6 @@ #include #include -#ifdef HAVE_UUID_UUID_H -#include -#endif - #include /******************************************************************* diff --git a/lib/addns/dnsutils.c b/lib/addns/dnsutils.c index 5a63c61f149..3eeb6ab9e21 100644 --- a/lib/addns/dnsutils.c +++ b/lib/addns/dnsutils.c @@ -22,12 +22,13 @@ License along with this library; if not, see . */ +#include "includes.h" +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/ndr_misc.h" + #include "dns.h" #include -#ifdef HAVE_SYS_UUID_H -#include -#endif static DNS_ERROR LabelList( TALLOC_CTX *mem_ctx, const char *name, @@ -137,17 +138,10 @@ char *dns_generate_keyname( TALLOC_CTX *mem_ctx ) char *result = NULL; #if defined(WITH_DNS_UPDATES) - uuid_t uuid; - - /* - * uuid_unparse gives 36 bytes plus '\0' - */ - if (!(result = talloc_array(mem_ctx, char, 37))) { - return NULL; - } + struct GUID guid; - uuid_generate( uuid ); - uuid_unparse( uuid, result ); + guid = GUID_random(); + result = GUID_string(mem_ctx, &guid); #endif diff --git a/lib/addns/wscript b/lib/addns/wscript index 99e9358a3db..83945bc1b48 100644 --- a/lib/addns/wscript +++ b/lib/addns/wscript @@ -3,4 +3,5 @@ import Options def configure(conf): - conf.CHECK_HEADERS('sys/uuid.h') + pass + #conf.CHECK_HEADERS('sys/uuid.h') diff --git a/lib/addns/wscript_build b/lib/addns/wscript_build index 513060d2f02..5fac61c50fe 100755 --- a/lib/addns/wscript_build +++ b/lib/addns/wscript_build @@ -2,6 +2,6 @@ bld.SAMBA_LIBRARY('addns', source='dnsquery.c dnsrecord.c dnsutils.c dnssock.c dnsgss.c dnsmarshall.c error.c', - public_deps='dnshostsfile samba-util gssapi uuid resolv', + public_deps='dnshostsfile samba-util gssapi ndr resolv', private_library=True, vars=locals()) diff --git a/source3/wscript b/source3/wscript index 0b36b22e610..6aa4c97c49a 100755 --- a/source3/wscript +++ b/source3/wscript @@ -785,11 +785,7 @@ int i; i = PAM_RADIO_TYPE; mandatory=True, msg="Checking whether setuidx is available") if Options.options.with_dnsupdate: - conf.CHECK_HEADERS('uuid/uuid.h') - conf.CHECK_FUNCS_IN('uuid_generate', 'uuid') - if not conf.CONFIG_SET('HAVE_UUID_UUID_H') and not conf.CONFIG_SET('HAVE_UUID_GENERATE'): - Logs.warn("--with-dnsupdate=yes but uuid support not sufficient") - elif not conf.CONFIG_SET('HAVE_KRB5'): + if not conf.CONFIG_SET('HAVE_KRB5'): Logs.warn("--with-dnsupdate=yes but gssapi support not sufficient") else: conf.DEFINE('WITH_DNS_UPDATES', 1) -- 2.11.4.GIT