]> granicus.if.org Git - sudo/commitdiff
Use HAVE_STRUCT_TIMESPEC and HAVE_STRUCT_IN6_ADDR instead of
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 1 Dec 2011 16:07:17 +0000 (11:07 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 1 Dec 2011 16:07:17 +0000 (11:07 -0500)
HAVE_TIMESPEC and HAVE_IN6_ADDR respectively.

common/fileops.c
compat/nanosleep.c
config.h.in
configure
configure.in
plugins/sudoers/interfaces.c
plugins/sudoers/interfaces.h
plugins/sudoers/match_addr.c
plugins/sudoers/sudoreplay.c
src/net_ifs.c

index a4e69867cd2b2b5b0acfa7354786259620c0b4be..7e48a66a815369bbaba1b27e1c97fb64cd5aa12a 100644 (file)
@@ -43,7 +43,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "compat/timespec.h"
 #endif
 
index 9490d7217256f4b2115852f3778b617ecb5c97cf..23e3b9e16011cebe316c850a0f1632d3559a002d 100644 (file)
@@ -24,7 +24,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "compat/timespec.h"
 #endif
 #include <errno.h>
index 8f428591b7e64c35b3566141b7f7f6ec544fea71..e111c141ac0a69b90e9da35df01e9fa292f3d753 100644 (file)
 /* Define to 1 if your Kerberos is Heimdal. */
 #undef HAVE_HEIMDAL
 
-/* Define to 1 if <netinet/in.h> contains struct in6_addr. */
-#undef HAVE_IN6_ADDR
-
 /* Define to 1 if you have the `initprivs' function. */
 #undef HAVE_INITPRIVS
 
 /* Define to 1 if you have the `sia_ses_init' function. */
 #undef HAVE_SIA_SES_INIT
 
-/* Define to 1 if <signal.h> has the sigaction_t typedef. */
+/* Define to 1 if the system has the type `sigaction_t'. */
 #undef HAVE_SIGACTION_T
 
 /* Define to 1 if you use S/Key. */
 /* Define to 1 if the system has the type `struct in6_addr'. */
 #undef HAVE_STRUCT_IN6_ADDR
 
+/* Define to 1 if the system has the type `struct timespec'. */
+#undef HAVE_STRUCT_TIMESPEC
+
 /* Define to 1 if `ut_exit' is a member of `struct utmpx'. */
 #undef HAVE_STRUCT_UTMPX_UT_EXIT
 
index f587502174b6079514fed9f1f05a9e147b12f381..ad413cfaec35a3aee29676c8a9c82d2459b66507 100755 (executable)
--- a/configure
+++ b/configure
@@ -15579,7 +15579,6 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_SIGACTION_T 1
 _ACEOF
 
-$as_echo "#define HAVE_SIGACTION_T 1" >>confdefs.h
 
 fi
 
@@ -15590,7 +15589,11 @@ ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "#in
 #include <time.h>
 "
 if test "x$ac_cv_type_struct_timespec" = xyes; then :
-  $as_echo "#define HAVE_TIMESPEC 1" >>confdefs.h
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TIMESPEC 1
+_ACEOF
+
 
 fi
 
@@ -15603,7 +15606,6 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IN6_ADDR 1
 _ACEOF
 
-$as_echo "#define HAVE_IN6_ADDR 1" >>confdefs.h
 
 fi
 
@@ -22162,8 +22164,6 @@ fi
 
 
 
-
-
 
 
 
index 10d65adf71b9164e177a7e448c3b47fcd7451509..f359ad3b63d35592085d9dd61d4ebcd80d4bdf18 100644 (file)
@@ -2008,14 +2008,14 @@ AC_TYPE_UID_T
 AC_CHECK_TYPE([__signed char], [], [AC_CHECK_TYPE([signed char], [AC_DEFINE(__signed, signed)], [AC_DEFINE(__signed, [])])])
 AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
 #include <signal.h>])
-AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], [], [#include <sys/types.h>
+AC_CHECK_TYPES([sigaction_t], [], [], [#include <sys/types.h>
 #include <signal.h>])
-AC_CHECK_TYPE([struct timespec], [AC_DEFINE(HAVE_TIMESPEC)], [], [#include <sys/types.h>
+AC_CHECK_TYPES([struct timespec], [], [], [#include <sys/types.h>
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 #endif
 #include <time.h>])
-AC_CHECK_TYPES([struct in6_addr], [AC_DEFINE(HAVE_IN6_ADDR)], [], [#include <sys/types.h>
+AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
 #include <netinet/in.h>])
 AC_TYPE_LONG_LONG_INT
 AC_CHECK_SIZEOF([long int])
@@ -3093,7 +3093,6 @@ AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR
 AH_TEMPLATE(HAVE_GETSPWUID, [Define to 1 if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
 AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
 AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
-AH_TEMPLATE(HAVE_IN6_ADDR, [Define to 1 if <netinet/in.h> contains struct in6_addr.])
 AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])
 AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
 AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.])
@@ -3113,7 +3112,6 @@ AH_TEMPLATE(HAVE_SECURID, [Define to 1 if you use SecurID for authentication.])
 AH_TEMPLATE(HAVE_SELINUX, [Define to 1 to enable SELinux RBAC support.])
 AH_TEMPLATE(HAVE_SETKEYCREATECON, [Define to 1 if you have the `setkeycreatecon' function.])
 AH_TEMPLATE(HAVE_SHL_LOAD, [Define to 1 if you have the `shl_load' function.])
-AH_TEMPLATE(HAVE_SIGACTION_T, [Define to 1 if <signal.h> has the sigaction_t typedef.])
 AH_TEMPLATE(HAVE_SKEY, [Define to 1 if you use S/Key.])
 AH_TEMPLATE(HAVE_SKEYACCESS, [Define to 1 if your S/Key library has skeyaccess().])
 AH_TEMPLATE(HAVE_RFC1938_SKEYCHALLENGE, [Define to 1 if the skeychallenge() function is RFC1938-compliant and takes 4 arguments])
index a4c5b505c8623cc619d2ec86bb488018a5760501..04d5b6704fb8cda7e8ba976313ca47844bb1d80e 100644 (file)
@@ -74,7 +74,7 @@ set_interfaces(const char *ai)
        ifp = emalloc(sizeof(*ifp));
        if (strchr(addr, ':')) {
            /* IPv6 */
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            ifp->family = AF_INET6;
            if (inet_pton(AF_INET6, addr, &ifp->addr.ip6) != 1 ||
                inet_pton(AF_INET6, mask, &ifp->netmask.ip6) != 1)
index 234d31df9399a3a5faa3616187bca9109cb4cab8..e3a13bfd6bc2ab656f90b2dfd7bf38b25ba59350 100644 (file)
@@ -27,7 +27,7 @@
  */
 union sudo_in_addr_un {
     struct in_addr ip4;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     struct in6_addr ip6;
 #endif
 };
index df983d8ba80f54c110deed34112bbbdf6c2e9235..fa8a23a5dbbb2666ff411edd577e22435670b030 100644 (file)
@@ -55,17 +55,17 @@ addr_matches_if(char *n)
 {
     union sudo_in_addr_un addr;
     struct interface *ifp;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     int j;
 #endif
     int family;
     debug_decl(addr_matches_if, SUDO_DEBUG_MATCH)
 
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     if (inet_pton(AF_INET6, n, &addr.ip6) > 0) {
        family = AF_INET6;
     } else
-#endif
+#endif /* HAVE_STRUCT_IN6_ADDR */
     {
        family = AF_INET;
        addr.ip4.s_addr = inet_addr(n);
@@ -81,7 +81,7 @@ addr_matches_if(char *n)
                    == addr.ip4.s_addr)
                    debug_return_bool(TRUE);
                break;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
                if (memcmp(ifp->addr.ip6.s6_addr, addr.ip6.s6_addr,
                    sizeof(addr.ip6.s6_addr)) == 0)
@@ -92,7 +92,7 @@ addr_matches_if(char *n)
                }
                if (j == sizeof(addr.ip6.s6_addr))
                    debug_return_bool(TRUE);
-#endif
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }
 
@@ -105,17 +105,17 @@ addr_matches_if_netmask(char *n, char *m)
     int i;
     union sudo_in_addr_un addr, mask;
     struct interface *ifp;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     int j;
 #endif
     int family;
     debug_decl(addr_matches_if, SUDO_DEBUG_MATCH)
 
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     if (inet_pton(AF_INET6, n, &addr.ip6) > 0)
        family = AF_INET6;
     else
-#endif
+#endif /* HAVE_STRUCT_IN6_ADDR */
     {
        family = AF_INET;
        addr.ip4.s_addr = inet_addr(n);
@@ -136,7 +136,7 @@ addr_matches_if_netmask(char *n, char *m)
        }
        addr.ip4.s_addr &= mask.ip4.s_addr;
     }
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     else {
        if (inet_pton(AF_INET6, m, &mask.ip6) <= 0) {
            j = atoi(m);
@@ -151,7 +151,7 @@ addr_matches_if_netmask(char *n, char *m)
            }
        }
     }
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
 
     for (ifp = interfaces; ifp != NULL; ifp = ifp->next) {
        if (ifp->family != family)
@@ -160,7 +160,7 @@ addr_matches_if_netmask(char *n, char *m)
            case AF_INET:
                if ((ifp->addr.ip4.s_addr & mask.ip4.s_addr) == addr.ip4.s_addr)
                    debug_return_bool(TRUE);
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
                for (j = 0; j < sizeof(addr.ip6.s6_addr); j++) {
                    if ((ifp->addr.ip6.s6_addr[j] & mask.ip6.s6_addr[j]) != addr.ip6.s6_addr[j])
@@ -168,7 +168,7 @@ addr_matches_if_netmask(char *n, char *m)
                }
                if (j == sizeof(addr.ip6.s6_addr))
                    debug_return_bool(TRUE);
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }
 
index 0e011391cc924c1c41c212e65c2cada0382b5b85..da7dfdb682ba0a0199fec6f647ce54a0bfc48f89 100644 (file)
@@ -52,7 +52,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "compat/timespec.h"
 #endif
 #include <ctype.h>
index cd2867954c7cb4521cf50f8268e0f89f0047364f..460d54fff13b3b2c9d1ba69505ad05e0dd46b852 100644 (file)
@@ -108,7 +108,7 @@ get_net_ifs(char **addrinfo)
 {
     struct ifaddrs *ifa, *ifaddrs;
     struct sockaddr_in *sin;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     struct sockaddr_in6 *sin6;
     char addrbuf[INET6_ADDRSTRLEN];
 #endif
@@ -128,7 +128,7 @@ get_net_ifs(char **addrinfo)
 
        switch (ifa->ifa_addr->sa_family) {
            case AF_INET:
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
 #endif
                num_interfaces++;
@@ -168,7 +168,7 @@ get_net_ifs(char **addrinfo)
                }
                cp += len;
                break;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
                sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
                inet_ntop(AF_INET6, &sin6->sin6_addr, addrbuf, sizeof(addrbuf));
@@ -189,7 +189,7 @@ get_net_ifs(char **addrinfo)
                }
                cp += len;
                break;
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }