Eliminate dependency on an external uuid library.
authorAndriy Syrovenko <andriys@gmail.com>
Sat, 26 May 2012 20:41:16 +0000 (23:41 +0300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 27 May 2012 03:15:56 +0000 (13:15 +1000)
lib/addns/dns.h
lib/addns/dnsutils.c
lib/addns/wscript
lib/addns/wscript_build
source3/wscript

index 2864bdf53961110cef36dee082a578bd4ba37829..c0820fe0bd82979ef207b60f118fe6e8a73115ae 100644 (file)
 #include <time.h>
 #include <netdb.h>
 
 #include <time.h>
 #include <netdb.h>
 
-#ifdef HAVE_UUID_UUID_H
-#include <uuid/uuid.h>
-#endif
-
 #include <talloc.h>
 
 /*******************************************************************
 #include <talloc.h>
 
 /*******************************************************************
index 5a63c61f149cb1bd3ef27189f53dc1a47d936f6e..3eeb6ab9e21f7adf2b59899cb2c3274d6f77a9cd 100644 (file)
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "includes.h"
+#include "librpc/ndr/libndr.h"
+#include "librpc/gen_ndr/ndr_misc.h"
+
 #include "dns.h"
 #include <ctype.h>
 
 #include "dns.h"
 #include <ctype.h>
 
-#ifdef HAVE_SYS_UUID_H
-#include <sys/uuid.h>
-#endif
 
 static DNS_ERROR LabelList( TALLOC_CTX *mem_ctx,
                            const char *name,
 
 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)
 
        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
 
 
 #endif
 
index 99e9358a3db041245495df5b7c579bb09dce2940..83945bc1b48b4dcf2d94de8a619a81dbc84595d1 100644 (file)
@@ -3,4 +3,5 @@
 import Options
 
 def configure(conf):
 import Options
 
 def configure(conf):
-    conf.CHECK_HEADERS('sys/uuid.h')
+    pass
+    #conf.CHECK_HEADERS('sys/uuid.h')
index 513060d2f029be1d2bec069ed615d152093935f1..5fac61c50fea23137eafcfc96588e6fbaff135ee 100755 (executable)
@@ -2,6 +2,6 @@
 
 bld.SAMBA_LIBRARY('addns',
                    source='dnsquery.c dnsrecord.c dnsutils.c dnssock.c dnsgss.c dnsmarshall.c error.c',
 
 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())
                    private_library=True,
                    vars=locals())
index 0b36b22e61039ef4f05bcddf436daae4cc5a48cf..6aa4c97c49a1ea3b58292363f09ea818e45c7ba9 100755 (executable)
@@ -785,11 +785,7 @@ int i; i = PAM_RADIO_TYPE;
                                 mandatory=True,
                                 msg="Checking whether setuidx is available")
     if Options.options.with_dnsupdate:
                                 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)
             Logs.warn("--with-dnsupdate=yes but gssapi support not sufficient")
         else:
             conf.DEFINE('WITH_DNS_UPDATES', 1)