[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-243-g2546da8

Michael Adam obnox at samba.org
Fri Mar 14 11:25:37 GMT 2008


The branch, v3-2-test has been updated
       via  2546da817f666914c1c220ec1fedc19aa41b25ad (commit)
       via  ddd564e8bf2b115aa5dbcbebd4be30b749ad8752 (commit)
       via  83baff78ce752a9129554a456cc24d043d419cd1 (commit)
      from  8dad80b4719691d66827ed46bebb963c0f8ba568 (commit)

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


- Log -----------------------------------------------------------------
commit 2546da817f666914c1c220ec1fedc19aa41b25ad
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
    (cherry picked from commit ff3af1703ddc9e5383f32156bc5be8351f795e76)

commit ddd564e8bf2b115aa5dbcbebd4be30b749ad8752
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
    (cherry picked from commit 297c3bece094ddb5f268b02e61e33f512ccfe6f5)

commit 83baff78ce752a9129554a456cc24d043d419cd1
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
    (cherry picked from commit bcb2f3a880f8da8f9bedb7a8e61d7d7b533f1919)

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

Summary of changes:
 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 +++++
 8 files changed, 26 insertions(+), 15 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/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 796df2d..e9e7702 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