]> granicus.if.org Git - sudo/commitdiff
Remove include/compat/timespec.h. Systems old enough to lack struct
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 17:13:22 +0000 (11:13 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 17:13:22 +0000 (11:13 -0600)
timespec are too old to build a modern sudo.

14 files changed:
MANIFEST
config.h.in
configure
configure.ac
include/compat/timespec.h [deleted file]
lib/util/Makefile.in
lib/util/gettime.c
lib/util/utimens.c
plugins/sudoers/Makefile.in
plugins/sudoers/sudoreplay.c
plugins/sudoers/timestamp.c
plugins/sudoers/visudo.c
src/Makefile.in
src/sudo_edit.c

index fc890a8a27ddc18ac90a3567bf026e6b3daa2ead..84fe484f2cd8b70d539d01c72f35f7b71aa7431f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -60,7 +60,6 @@ include/compat/glob.h
 include/compat/nss_dbdefs.h
 include/compat/sha2.h
 include/compat/stdbool.h
-include/compat/timespec.h
 include/sudo_compat.h
 include/sudo_conf.h
 include/sudo_debug.h
index 2635a0ffcf2cb48d1c57a706050da7792bfdb458..29e922eb8cb686121e07b8981630692581d2d333 100644 (file)
 /* Define if your struct sockaddr has an sa_len field. */
 #undef HAVE_STRUCT_SOCKADDR_SA_LEN
 
-/* 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 147df43173317598b7f72f32875dfd1bd86fadc4..b8213551812b33a7adb8587fd12c69ae5e7eca58 100755 (executable)
--- a/configure
+++ b/configure
@@ -17318,21 +17318,6 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-fi
-
-ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "#include <sys/types.h>
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-#endif
-#include <time.h>
-"
-if test "x$ac_cv_type_struct_timespec" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_TIMESPEC 1
-_ACEOF
-
-
 fi
 
 ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "#include <sys/types.h>
@@ -19728,12 +19713,11 @@ esac
 "
     done
 
-if test X"$ac_cv_type_struct_timespec" != X"no"; then
-    ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default"
+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default"
 if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then :
   $as_echo "#define HAVE_ST_MTIM 1" >>confdefs.h
 
-       ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.st__tim" "ac_cv_member_struct_stat_st_mtim_st__tim" "$ac_includes_default"
+    ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.st__tim" "ac_cv_member_struct_stat_st_mtim_st__tim" "$ac_includes_default"
 if test "x$ac_cv_member_struct_stat_st_mtim_st__tim" = xyes; then :
   $as_echo "#define HAVE_ST__TIM 1" >>confdefs.h
 
@@ -19748,7 +19732,6 @@ fi
 
 fi
 
-fi
 FOUND_SHA2=no
 ac_fn_c_check_header_mongrel "$LINENO" "sha2.h" "ac_cv_header_sha2_h" "$ac_includes_default"
 if test "x$ac_cv_header_sha2_h" = xyes; then :
index a287d948ab764492b77c75bb5eadc00e7f597813..39f615ff3070a9b5fccebde2007d0d338ce6ed17 100644 (file)
@@ -2314,11 +2314,6 @@ AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys
 #include <signal.h>])
 AC_CHECK_TYPES([sigaction_t], [], [], [#include <sys/types.h>
 #include <signal.h>])
-AC_CHECK_TYPES([struct timespec], [], [], [#include <sys/types.h>
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-#endif
-#include <time.h>])
 AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
 #include <netinet/in.h>])
 AC_TYPE_LONG_LONG_INT
@@ -2653,11 +2648,9 @@ fi
 AC_CHECK_FUNCS([strtonum])
 AC_LIBOBJ(strtonum)
 SUDO_APPEND_COMPAT_EXP(sudo_strtonum)
-if test X"$ac_cv_type_struct_timespec" != X"no"; then
-    AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
-       [AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
-       [AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
-fi
+AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
+    [AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
+    [AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
 FOUND_SHA2=no
 AC_CHECK_HEADER([sha2.h], [
     FOUND_SHA2=yes
diff --git a/include/compat/timespec.h b/include/compat/timespec.h
deleted file mode 100644 (file)
index e1378f7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2005, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef COMPAT_TIMESPEC_H
-#define COMPAT_TIMESPEC_H
-
-struct timespec {
-    time_t     tv_sec;
-    long       tv_nsec;
-};
-
-#endif /* COMPAT_TIMESPEC_H */
index 105eaa6656d1b75edd97f9fdf2b4e6d40d8e3c2e..ab8faf091bbf9a290f38fcb70dfb22000cb50744 100644 (file)
@@ -396,9 +396,9 @@ getopt_long.lo: $(srcdir)/getopt_long.c $(incdir)/compat/getopt.h \
                 $(incdir)/sudo_fatal.h $(top_builddir)/config.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/getopt_long.c
 gettime.lo: $(srcdir)/gettime.c $(incdir)/compat/stdbool.h \
-            $(incdir)/compat/timespec.h $(incdir)/sudo_compat.h \
-            $(incdir)/sudo_debug.h $(incdir)/sudo_queue.h \
-            $(incdir)/sudo_util.h $(top_builddir)/config.h
+            $(incdir)/sudo_compat.h $(incdir)/sudo_debug.h \
+            $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
+            $(top_builddir)/config.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/gettime.c
 gidlist.lo: $(srcdir)/gidlist.c $(incdir)/compat/stdbool.h \
             $(incdir)/sudo_compat.h $(incdir)/sudo_debug.h \
@@ -569,6 +569,6 @@ ttysize.lo: $(srcdir)/ttysize.c $(incdir)/compat/stdbool.h \
             $(top_builddir)/config.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/ttysize.c
 utimens.lo: $(srcdir)/utimens.c $(incdir)/compat/stdbool.h \
-            $(incdir)/compat/timespec.h $(incdir)/sudo_compat.h \
-            $(incdir)/sudo_util.h $(top_builddir)/config.h
+            $(incdir)/sudo_compat.h $(incdir)/sudo_util.h \
+            $(top_builddir)/config.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/utimens.c
index 22191d0dcd691e9e8afadf53d5c5f2fdb3b3072f..5fa4dac0cff18296c9766e81be146a34218311c2 100644 (file)
@@ -24,9 +24,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 #include <errno.h>
 
 #if defined(__MACH__) && !defined(HAVE_CLOCK_GETTIME)
index 165c82918a3aa690d13bba11319e532efb8957fc..34feeaec976f92c9e9851ce1f90464c649d89db6 100644 (file)
@@ -26,9 +26,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 #if !defined(HAVE_UTIMES) || defined(HAVE_FUTIME)
 # include <utime.h>
 #endif
index e70044519a3774f9759ee16800dcc404b04f32b9..04aba2e1d6d363ed1a300f318db0572db8329583 100644 (file)
@@ -1021,13 +1021,13 @@ sudoers_debug.lo: $(srcdir)/sudoers_debug.c $(devdir)/def_data.h \
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudoers_debug.c
 sudoers_debug.o: sudoers_debug.lo
 sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/compat/getopt.h \
-              $(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
-              $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
-              $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
-              $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
-              $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
-              $(incdir)/sudo_util.h $(srcdir)/iolog.h $(srcdir)/logging.h \
-              $(top_builddir)/config.h $(top_builddir)/pathnames.h
+              $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
+              $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+              $(incdir)/sudo_event.h $(incdir)/sudo_fatal.h \
+              $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
+              $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/iolog.h \
+              $(srcdir)/logging.h $(top_builddir)/config.h \
+              $(top_builddir)/pathnames.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudoreplay.c
 testsudoers.o: $(srcdir)/testsudoers.c $(devdir)/def_data.h $(devdir)/gram.h \
                $(incdir)/compat/fnmatch.h $(incdir)/compat/stdbool.h \
@@ -1041,14 +1041,14 @@ testsudoers.o: $(srcdir)/testsudoers.c $(devdir)/def_data.h $(devdir)/gram.h \
                $(top_builddir)/config.h $(top_builddir)/pathnames.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/testsudoers.c
 timestamp.lo: $(srcdir)/timestamp.c $(devdir)/def_data.h \
-              $(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
-              $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
-              $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
-              $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
-              $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/check.h \
-              $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
-              $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
-              $(top_builddir)/config.h $(top_builddir)/pathnames.h
+              $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
+              $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+              $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
+              $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
+              $(incdir)/sudo_util.h $(srcdir)/check.h $(srcdir)/defaults.h \
+              $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+              $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
+              $(top_builddir)/pathnames.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/timestamp.c
 timestr.lo: $(srcdir)/timestr.c $(incdir)/sudo_compat.h $(top_builddir)/config.h
        $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/timestr.c
@@ -1084,14 +1084,13 @@ tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(devdir)/def_data.h \
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/tsgetgrpw.c
 visudo.o: $(srcdir)/visudo.c $(devdir)/def_data.h $(devdir)/gram.h \
           $(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \
-          $(incdir)/compat/timespec.h $(incdir)/sudo_compat.h \
-          $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
-          $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
-          $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
-          $(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/redblack.h \
-          $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
-          $(srcdir)/sudoers_version.h $(top_builddir)/config.h \
-          $(top_builddir)/pathnames.h
+          $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+          $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
+          $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
+          $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
+          $(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+          $(srcdir)/sudoers_debug.h $(srcdir)/sudoers_version.h \
+          $(top_builddir)/config.h $(top_builddir)/pathnames.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/visudo.c
 visudo_json.o: $(srcdir)/visudo_json.c $(devdir)/def_data.h $(devdir)/gram.h \
                $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
index 3db09c2991d64e0c761aa0b717eb6b8f6b7630d0..d11f81606f3eb15bf1b0699542fa7847e9b9e9bf 100644 (file)
@@ -34,9 +34,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
index 5da3c3ab37819db7863eb4a3c45f785a51389750..c4cbb77dc93f5dae06790694bda2c880e7b41e29 100644 (file)
@@ -36,9 +36,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <pwd.h>
index b209fe00e1d3df9f4af691de2585ca731df246b9..5bde49aa2b8f5e0371b16b710ab29643301aa7db 100644 (file)
@@ -59,9 +59,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 
 #include "sudoers.h"
 #include "parse.h"
index 7acfb2dc076827424bdadd4c68fcbe3e8630e9d9..fcd501937de154c88cefd432ce27cc289ced35d7 100644 (file)
@@ -361,12 +361,11 @@ sudo.o: $(srcdir)/sudo.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
         $(top_builddir)/pathnames.h ./sudo_usage.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudo.c
 sudo_edit.o: $(srcdir)/sudo_edit.c $(incdir)/compat/stdbool.h \
-             $(incdir)/compat/timespec.h $(incdir)/sudo_compat.h \
-             $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
-             $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
-             $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
-             $(srcdir)/sudo_exec.h $(top_builddir)/config.h \
-             $(top_builddir)/pathnames.h
+             $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
+             $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
+             $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
+             $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
+             $(top_builddir)/config.h $(top_builddir)/pathnames.h
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudo_edit.c
 sudo_noexec.lo: $(srcdir)/sudo_noexec.c $(incdir)/sudo_compat.h \
                 $(top_builddir)/config.h
index 6be29c20d30e68cd51c8eb70e5e81066a0dedf15..95bf8aa0a1dfe58eb517b3c6547568427a37790f 100644 (file)
@@ -39,9 +39,6 @@
 #ifdef TIME_WITH_SYS_TIME
 # include <time.h>
 #endif
-#ifndef HAVE_STRUCT_TIMESPEC
-# include "compat/timespec.h"
-#endif
 #ifdef HAVE_SELINUX
 # include <selinux/selinux.h>
 #endif