]> 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, 12 Jan 2012 18:27:37 +0000 (13:27 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 12 Jan 2012 18:27:37 +0000 (13:27 -0500)
HAVE_TIMESPEC and HAVE_IN6_ADDR respectively.

--HG--
branch : 1.7

config.h.in
configure
configure.in
fileops.c
interfaces.c
interfaces.h
match.c
nanosleep.c
sudo_noexec.c
sudoreplay.c

index 8d1e22e53d09a3ded385fa9c0aa17dc66d28e372..f6882e50f95ae95d132a0446e1e0d1b2e96def4a 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 `initgroups' function. */
 #undef HAVE_INITGROUPS
 
 /* Define to 1 if you have the `sigaction' function. */
 #undef HAVE_SIGACTION
 
-/* 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 your struct stat has an st_mtim member */
 #undef HAVE_ST_MTIM
 
 /* Define to 1 if you have the <termio.h> header file. */
 #undef HAVE_TERMIO_H
 
-/* Define to 1 if you have struct timespec in sys/time.h */
-#undef HAVE_TIMESPEC
-
 /* Define to 1 if you have the `tzset' function. */
 #undef HAVE_TZSET
 
index 16e8f3c5572f53df1837d2f1b31c624d4f966993..1e8c8ae6026438844f47d87eba17eb4e4d1b7bf7 100755 (executable)
--- a/configure
+++ b/configure
@@ -15564,7 +15564,6 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_SIGACTION_T 1
 _ACEOF
 
-$as_echo "#define HAVE_SIGACTION_T 1" >>confdefs.h
 
 fi
 
@@ -15575,7 +15574,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
 
@@ -15588,7 +15591,6 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IN6_ADDR 1
 _ACEOF
 
-$as_echo "#define HAVE_IN6_ADDR 1" >>confdefs.h
 
 fi
 
@@ -22286,9 +22288,6 @@ fi
 
 
 
-
-
-
 
 
 
index 36dafc06761031463dd50fc8ffcb1ed70c44d43b..f37d4a44de7d5ae69a30962605f836138a88be42 100644 (file)
@@ -1981,14 +1981,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])
@@ -3017,7 +3017,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_KERB4, [Define to 1 if you use Kerberos IV.])
@@ -3036,7 +3035,6 @@ AH_TEMPLATE(HAVE_PROJECT_H, [Define to 1 if you have the <project.h> header file
 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_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])
@@ -3044,7 +3042,6 @@ AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union
 AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
 AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
 AH_TEMPLATE(HAVE_TERMIOS_H, [Define to 1 if you have the <termios.h> header file and the `tcgetattr' function.])
-AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
 AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
 AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
 AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements])
index ae9a7df135c6d48da8b0ebc0b96722f425f57466..e20f99f5bfaa80ea0279e0d287f9a0bdeaeeae60 100644 (file)
--- a/fileops.c
+++ b/fileops.c
@@ -43,7 +43,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "emul/timespec.h"
 #endif
 
index 502cb94ae5e4afb39b399d1056fd2a6edfd6844a..dd66af3e5665266a63632d35862ae8980bd45e8b 100644 (file)
@@ -99,7 +99,7 @@ load_interfaces()
 {
     struct ifaddrs *ifa, *ifaddrs;
     struct sockaddr_in *sin;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     struct sockaddr_in6 *sin6;
 #endif
     int i;
@@ -116,7 +116,7 @@ load_interfaces()
 
        switch(ifa->ifa_addr->sa_family) {
            case AF_INET:
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
 #endif
                num_interfaces++;
@@ -150,7 +150,7 @@ load_interfaces()
                interfaces[i].family = AF_INET;
                i++;
                break;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
                sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
                if (sin6 == NULL)
@@ -165,7 +165,7 @@ load_interfaces()
                interfaces[i].family = AF_INET6;
                i++;
                break;
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }
 #ifdef HAVE_FREEIFADDRS
@@ -328,7 +328,7 @@ void
 dump_interfaces()
 {
     int i;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     char addrbuf[INET6_ADDRSTRLEN], maskbuf[INET6_ADDRSTRLEN];
 #endif
 
@@ -339,7 +339,7 @@ dump_interfaces()
                printf("\t%s / ", inet_ntoa(interfaces[i].addr.ip4));
                puts(inet_ntoa(interfaces[i].netmask.ip4));
                break;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
            case AF_INET6:
                inet_ntop(AF_INET6, &interfaces[i].addr.ip6,
                    addrbuf, sizeof(addrbuf));
@@ -347,7 +347,7 @@ dump_interfaces()
                    maskbuf, sizeof(maskbuf));
                printf("\t%s / %s\n", addrbuf, maskbuf);
                break;
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }
 }
index 06b0b8571db0a753d02796d741c8e46e4bcde19a..dc22f4f6301becfe87a16e7361e504e1f072ef45 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
 };
diff --git a/match.c b/match.c
index 184616e2ba83afe7c124416ab3558f7d36ed55a6..7568c83fb5f6ce7930b78a76bc65a4f73947143f 100644 (file)
--- a/match.c
+++ b/match.c
@@ -630,12 +630,12 @@ addr_matches_if(n)
     int i;
     union sudo_in_addr_un addr;
     struct interface *ifp;
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     int j;
 #endif
     int family;
 
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     if (inet_pton(AF_INET6, n, &addr.ip6) > 0) {
        family = AF_INET6;
     } else
@@ -656,7 +656,7 @@ addr_matches_if(n)
                    == addr.ip4.s_addr)
                    return 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)
@@ -682,12 +682,12 @@ addr_matches_if_netmask(n, 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;
 
-#ifdef HAVE_IN6_ADDR
+#ifdef HAVE_STRUCT_IN6_ADDR
     if (inet_pton(AF_INET6, n, &addr.ip6) > 0)
        family = AF_INET6;
     else
@@ -712,7 +712,7 @@ addr_matches_if_netmask(n, 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);
@@ -727,7 +727,7 @@ addr_matches_if_netmask(n, m)
            }
        }
     }
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
 
     for (i = 0; i < num_interfaces; i++) {
        ifp = &interfaces[i];
@@ -737,7 +737,7 @@ addr_matches_if_netmask(n, m)
            case AF_INET:
                if ((ifp->addr.ip4.s_addr & mask.ip4.s_addr) == addr.ip4.s_addr)
                    return 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])
@@ -745,7 +745,7 @@ addr_matches_if_netmask(n, m)
                }
                if (j == sizeof(addr.ip6.s6_addr))
                    return TRUE;
-#endif /* HAVE_IN6_ADDR */
+#endif /* HAVE_STRUCT_IN6_ADDR */
        }
     }
 
index 1849eb2cd9b633c0d6e96c1d9b2dd91286870196..ca0463a79cabb8c1611a9f129ca09d2f8d47590f 100644 (file)
@@ -24,7 +24,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "emul/timespec.h"
 #endif
 #include <errno.h>
index 127fcbed40154232c5281d3d4157ebc9db56a49c..1e5cad79f5d4f2ae16273b9f9236388acc720353 100644 (file)
@@ -19,7 +19,7 @@
 #include <sys/types.h>
 
 #include <errno.h>
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include <time.h>
 #endif
 #ifdef __STDC__
index 9fdb5bbc5ae2c000e2dfbc919f3796ec4ce5bc8b..191a672b969c14086ff40c5470bb2123c6b0c505 100644 (file)
@@ -52,7 +52,7 @@
 #if TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_STRUCT_TIMESPEC
 # include "emul/timespec.h"
 #endif
 #include <ctype.h>