]> granicus.if.org Git - sudo/commitdiff
Solaris 2.6 has the prototypes for inet_pton() and inet_ntop() in
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 9 Jul 2015 16:11:25 +0000 (10:11 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 9 Jul 2015 16:11:25 +0000 (10:11 -0600)
resolv.h.

config.h.in
configure
configure.ac
lib/util/getaddrinfo.c
plugins/sudoers/interfaces.c
plugins/sudoers/match_addr.c
src/net_ifs.c

index c9b6c64c1675aa6e18107d2f05d136ed09153e42..196cfa25448faf7058ce04547322f2f9ea51816b 100644 (file)
    */
 #undef MAX_UID_T_LEN
 
+/* Define to 1 if resolv.h must be included to get the `inet_ntop' or
+   `inet_pton' function prototypes. */
+#undef NEED_RESOLV_H
+
 /* Define to 1 if you don't want sudo to prompt for a password by default. */
 #undef NO_AUTHENTICATION
 
index 199a544fb88825a210a4e4959247a36af6351279..e1929fc198751cae9168eddd78e052a5aefe65f0 100755 (executable)
--- a/configure
+++ b/configure
@@ -20349,6 +20349,12 @@ $as_echo "yes" >&6; }
 
            NET_LIBS="${NET_LIBS} $libs"
            INET_PTON_LIBS="$libs"
+           case "$libs" in
+               *-lresolv*)
+                   $as_echo "#define NEED_RESOLV_H 1" >>confdefs.h
+
+                   ;;
+           esac
            break
 
     else
@@ -26790,5 +26796,6 @@ fi
 
 
 
+
 
 
index 062d73c2c6a7556bdf9a7e2646ffbdf6c2f2dd55..025df9cc1037dae04dbfaa70b5a3c4cfd762a7e8 100644 (file)
@@ -2790,6 +2790,11 @@ AC_CHECK_FUNC([inet_pton], [
            AC_DEFINE(HAVE_INET_PTON)
            NET_LIBS="${NET_LIBS} $libs"
            INET_PTON_LIBS="$libs"
+           case "$libs" in
+               *-lresolv*)
+                   AC_DEFINE(NEED_RESOLV_H)
+                   ;;
+           esac
            break
        ], [], [$extralibs])
     done
@@ -4336,6 +4341,7 @@ AH_TEMPLATE(HAVE__NSS_INITF_GROUP, [Define to 1 if you have the `_nss_initf_grou
 AH_TEMPLATE(HAVE___NSS_INITF_GROUP, [Define to 1 if you have the `__nss_initf_group' function.])
 AH_TEMPLATE(HAVE__NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `_nss_XbyY_buf_alloc' function.])
 AH_TEMPLATE(HAVE___NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `__nss_XbyY_buf_alloc' function.])
+AH_TEMPLATE(NEED_RESOLV_H, [Define to 1 if resolv.h must be included to get the `inet_ntop' or `inet_pton' function prototypes.])
 AH_TEMPLATE(HAVE_STRNLEN, [Define to 1 if you have the `strnlen' function.])
 
 dnl
index 1a24d9d8f14331fa54967db74cd8bb849d9f2518..b63640534fd965dc7d6d230f6b0e69598b90eb84 100644 (file)
 
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#ifdef NEED_RESOLV_H
+# include <arpa/nameser.h>
+# include <resolv.h>
+#endif /* NEED_RESOLV_H */
 
 #include "sudo_compat.h"
 #include "compat/getaddrinfo.h"
index 45019a4c894fbd6383e2bb9f73d4a6513b3f021a..8643e3146a191a848dd657b8dfbcf8129475c661 100644 (file)
 #include <unistd.h>
 #include <netinet/in.h>  
 #include <arpa/inet.h>
+#ifdef NEED_RESOLV_H
+# include <arpa/nameser.h>
+# include <resolv.h>
+#endif /* NEED_RESOLV_H */
 #include <netdb.h>
 #include <errno.h>
 
index 91ffa857f2fdf6ae7d1f037eeb380c3769b18a2f..671b39f732dcf751f64ac86cdf72e5614a6c7fb4 100644 (file)
 #include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#ifdef NEED_RESOLV_H
+# include <arpa/nameser.h>
+# include <resolv.h>
+#endif /* NEED_RESOLV_H */
 
 #include "sudoers.h"
 #include "interfaces.h"
index 12961adf9fcfea0d83d400bc51a8cd902c4b9b78..3f9fe6db2b26c8d9228ea624a1142acc14f6604f 100644 (file)
@@ -67,6 +67,10 @@ struct rtentry;
 #endif /* _MIPS */
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#ifdef NEED_RESOLV_H
+# include <arpa/nameser.h>
+# include <resolv.h>
+#endif /* NEED_RESOLV_H */
 #include <net/if.h>
 #ifdef HAVE_GETIFADDRS
 # include <ifaddrs.h>