[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-1296-gff3af17

Michael Adam obnox at samba.org
Fri Mar 14 09:33:02 GMT 2008


The branch, v4-0-test has been updated
       via  ff3af1703ddc9e5383f32156bc5be8351f795e76 (commit)
       via  297c3bece094ddb5f268b02e61e33f512ccfe6f5 (commit)
       via  3b2a3da2f73020b1d3b08a05a479de380b2aa5c4 (commit)
       via  bcb2f3a880f8da8f9bedb7a8e61d7d7b533f1919 (commit)
      from  db3b5f16ec8d9b83d8a82a535a4847dce5923663 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit ff3af1703ddc9e5383f32156bc5be8351f795e76
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 14 09:39:58 2008 +0100

    libreplace: fix samba4 build (by not setting global LIBS).
    
    This corrects the earlier fix of the standalone build, by setting
    LIBS to the desired value only in configure.ac but not in getifaddrs.m4.
    
    Not that this changes the standalone build in that it adds these libs
    undconditionally and not only if they are needed by the getifaddrs
    replacement functions.
    
    Michael

commit 297c3bece094ddb5f268b02e61e33f512ccfe6f5
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 14 08:52:16 2008 +0100

    libreplace: add -I$libreplacedir to CPPFLAGS for getifaddrs tests.
    
    This is needed, otherwise $libreplacedir/system/network.h does not
    find $libreplacedir/getaddrinfo.h on some systems (solaris, e.g.).
    
    Michael

commit 3b2a3da2f73020b1d3b08a05a479de380b2aa5c4
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 14 09:04:00 2008 +0100

    heimdal_build: fix linkage of asn1_compile and compile_et.
    
    Now inet_aton is available from libreplace.
    
    Michael

commit bcb2f3a880f8da8f9bedb7a8e61d7d7b533f1919
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 14 08:49:34 2008 +0100

    libreplace: add an inet_aton() function that calls inet_pton().
    
    inet_aton() is even needed inside libreplace, in the implementation
    of rep_getaddrinfo().
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/heimdal_build/config.mk               |    2 --
 source/lib/replace/README                    |    1 +
 source/lib/replace/configure.ac              |    3 +++
 source/lib/replace/getifaddrs.m4             |    7 ++++---
 source/lib/replace/{socket.c => inet_aton.c} |   18 ++++++------------
 source/lib/replace/inet_aton.m4              |    1 +
 source/lib/replace/libreplace.m4             |    1 +
 source/lib/replace/replace.h                 |    5 +++++
 source/lib/replace/system/network.h          |    5 +++++
 9 files changed, 26 insertions(+), 17 deletions(-)
 copy source/lib/replace/{socket.c => inet_aton.c} (76%)
 create mode 100644 source/lib/replace/inet_aton.m4


Changeset truncated at 500 lines:

diff --git a/source/heimdal_build/config.mk b/source/heimdal_build/config.mk
index 0235a97..45bfd8e 100644
--- a/source/heimdal_build/config.mk
+++ b/source/heimdal_build/config.mk
@@ -471,7 +471,6 @@ OBJ_FILES = \
 	../heimdal/lib/roken/get_window_size.ho \
 	../heimdal/lib/roken/estrdup.ho \
 	../heimdal/lib/roken/ecalloc.ho \
-	../heimdal/lib/roken/inet_aton.ho \
 	../heimdal/lib/asn1/symbol.ho \
 	../heimdal/lib/vers/print_version.ho \
 	../lib/socket_wrapper/socket_wrapper.ho \
@@ -501,7 +500,6 @@ OBJ_FILES = ../heimdal/lib/vers/print_version.ho \
 	../heimdal/lib/roken/get_window_size.ho \
 	../heimdal/lib/roken/strupr.ho \
 	../heimdal/lib/roken/setprogname.ho \
-	../heimdal/lib/roken/inet_aton.ho \
 	../lib/socket_wrapper/socket_wrapper.ho \
 	replace.ho
 PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H EXT_SOCKET EXT_NSL
diff --git a/source/lib/replace/README b/source/lib/replace/README
index 268a1b1..aae1ccb 100644
--- a/source/lib/replace/README
+++ b/source/lib/replace/README
@@ -52,6 +52,7 @@ readline (the library)
 inet_ntoa
 inet_ntop
 inet_pton
+inet_aton
 strtoll
 strtoull
 socketpair
diff --git a/source/lib/replace/configure.ac b/source/lib/replace/configure.ac
index f5e054f..298f5a6 100644
--- a/source/lib/replace/configure.ac
+++ b/source/lib/replace/configure.ac
@@ -21,6 +21,9 @@ if test "$ac_cv_prog_gcc" = yes; then
    CFLAGS="$CFLAGS -Wno-format-y2k"
 fi
 
+LIBS="$SOCKET_LIBS $NSL_LIBS"
+AC_SUBST(LIBS)
+
 AC_SUBST(LDFLAGS)
 
 AC_OUTPUT(Makefile)
diff --git a/source/lib/replace/getifaddrs.m4 b/source/lib/replace/getifaddrs.m4
index 6cca155..f4cf4e4 100644
--- a/source/lib/replace/getifaddrs.m4
+++ b/source/lib/replace/getifaddrs.m4
@@ -38,6 +38,8 @@ fi
 #
 old_LIBS=$LIBS
 LIBS="$NSL_LIBS $SOCKET_LIBS"
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$libreplacedir"
 iface=no;
 ##################
 # look for a method of finding the list of network interfaces
@@ -79,7 +81,6 @@ AC_TRY_RUN([
            libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then
     iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
@@ -100,7 +101,6 @@ AC_TRY_RUN([
            libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then
     iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
-	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
@@ -120,8 +120,9 @@ AC_TRY_RUN([
            libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)])
 if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then
     iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
-	old_LIBS="$old_LIBS $LIBS"
 fi
 fi
 
 LIBS=$old_LIBS
+CPPFLAGS="$SAVE_CPPFLAGS"
+
diff --git a/source/lib/replace/socket.c b/source/lib/replace/inet_aton.c
similarity index 76%
copy from source/lib/replace/socket.c
copy to source/lib/replace/inet_aton.c
index 35e975f..3eb58f0 100644
--- a/source/lib/replace/socket.c
+++ b/source/lib/replace/inet_aton.c
@@ -1,8 +1,6 @@
 /*
  * Unix SMB/CIFS implementation.
- *
- * Dummy replacements for socket functions.
- *
+ * replacement functions
  * Copyright (C) Michael Adam <obnox at samba.org> 2008
  *
  * This program is free software; you can redistribute it and/or modify
@@ -22,14 +20,10 @@
 #include "replace.h"
 #include "system/network.h"
 
-int rep_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-struct hostent *rep_gethostbyname(const char *name)
+/**
+ * We know that we have inet_pton from earlier libreplace checks.
+ */
+int rep_inet_aton(const char *src, struct in_addr *dst)
 {
-	errno = ENOSYS;
-	return NULL;
+	return (inet_pton(AF_INET, src, dst) > 0) ? 1 : 0;
 }
diff --git a/source/lib/replace/inet_aton.m4 b/source/lib/replace/inet_aton.m4
new file mode 100644
index 0000000..853688e
--- /dev/null
+++ b/source/lib/replace/inet_aton.m4
@@ -0,0 +1 @@
+AC_CHECK_FUNCS(inet_aton,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} inet_aton.o"])
diff --git a/source/lib/replace/libreplace.m4 b/source/lib/replace/libreplace.m4
index e0cc57f..e6e7198 100644
--- a/source/lib/replace/libreplace.m4
+++ b/source/lib/replace/libreplace.m4
@@ -347,6 +347,7 @@ m4_include(timegm.m4)
 m4_include(socket.m4)
 m4_include(inet_ntop.m4)
 m4_include(inet_pton.m4)
+m4_include(inet_aton.m4)
 m4_include(getaddrinfo.m4)
 m4_include(repdir.m4)
 m4_include(getifaddrs.m4)
diff --git a/source/lib/replace/replace.h b/source/lib/replace/replace.h
index 0d16f4f..00c8230 100644
--- a/source/lib/replace/replace.h
+++ b/source/lib/replace/replace.h
@@ -340,6 +340,11 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
 /* prototype is in "system/network.h" */
 #endif
 
+#ifndef HAVE_INET_ATON
+#define inet_aton rep_inet_aton
+/* prototype is in "system/network.h" */
+#endif
+
 #ifndef HAVE_CONNECT
 #define connect rep_connect
 /* prototype is in "system/network.h" */
diff --git a/source/lib/replace/system/network.h b/source/lib/replace/system/network.h
index 410c6d7..8c606c8 100644
--- a/source/lib/replace/system/network.h
+++ b/source/lib/replace/system/network.h
@@ -103,6 +103,11 @@ int rep_inet_pton(int af, const char *src, void *dst);
 const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #endif
 
+#ifndef HAVE_INET_ATON
+/* define is in "replace.h" */
+int rep_inet_aton(const char *src, struct in_addr *dst);
+#endif
+
 #ifndef HAVE_CONNECT
 /* define is in "replace.h" */
 int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list