From: Todd C. Miller Date: Mon, 19 Jun 1995 19:19:02 +0000 (+0000) Subject: added SUDO_FUNC_UTIME_NULL and SUDO_FUNC_UTIME_POSIX X-Git-Tag: SUDO_1_4_0~333 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a6f9ff555ef8c6a5edb7701603bb2f6b3ac3bfa;p=sudo added SUDO_FUNC_UTIME_NULL and SUDO_FUNC_UTIME_POSIX --- diff --git a/aclocal.m4 b/aclocal.m4 index 0624b57e3..6a31b5674 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ dnl Local m4 macors for autoconf (used by sudo) dnl dnl checks for programs -dnl + dnl dnl check for sendmail dnl @@ -28,6 +28,7 @@ else AC_MSG_RESULT(not found) fi ])dnl + dnl dnl check for vi dnl @@ -48,6 +49,7 @@ else AC_MSG_RESULT(not found) fi ])dnl + dnl dnl check for pwd dnl @@ -68,6 +70,7 @@ else AC_MSG_RESULT(not found) fi ])dnl + dnl dnl check for mv dnl @@ -88,6 +91,7 @@ else AC_MSG_RESULT(not found) fi ])dnl + dnl dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm dnl @@ -105,6 +109,7 @@ else AC_MSG_RESULT(unknown, you will have to set _PATH_SUDO_LOGFILE by hand) fi ])dnl + dnl dnl check for fullly working void dnl @@ -133,16 +138,67 @@ if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2) fi ]) + dnl dnl Check for size_t declation dnl AC_DEFUN(SUDO_TYPE_SIZE_T, [SUDO_CHECK_TYPE(size_t, int)]) + dnl dnl Check for ssize_t declation dnl AC_DEFUN(SUDO_TYPE_SSIZE_T, [SUDO_CHECK_TYPE(ssize_t, int)]) + +dnl +dnl Check to see if POSIX utime() takes a null arg +dnl (only change from AC_FUNC_UTIME_NULL is an added sleep(1) +dnl +AC_DEFUN(SUDO_FUNC_UTIME_NULL, +[AC_MSG_CHECKING(whether utime accepts a null argument) +AC_CACHE_VAL(ac_cv_func_utime_null, +[rm -f conftestdata; > conftestdata +# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. +AC_TRY_RUN([#include +#include +main() { +struct stat s, t; +exit(!(stat ("conftestdata", &s) == 0 && !sleep(1) && utime("conftestdata", (long *)0) == 0 +&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime +&& t.st_mtime - s.st_mtime < 120)); +}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no, + ac_cv_func_utime_null=no) +rm -f core core.* *.core])dnl +AC_MSG_RESULT($ac_cv_func_utime_null) +if test $ac_cv_func_utime_null = yes; then + AC_DEFINE(HAVE_UTIME_NULL) +fi +]) + +dnl check for POSIX utime() using struct utimbuf +dnl +AC_DEFUN(SUDO_FUNC_UTIME_POSIX, +[AC_MSG_CHECKING(for POSIX utime) +AC_CACHE_VAL(sudo_cv_func_utime_posix, +[rm -f conftestdata; > conftestdata +AC_TRY_RUN([#include +#include +#include +main() { +struct utimbuf ut; +ut.actime = ut.modtime = time(0); +utime("conftestdata", &ut); +exit(0); +}], sudo_cv_func_utime_posix=yes, sudo_cv_func_utime_posix=no, + sudo_cv_func_utime_posix=no) +rm -f core core.* *.core])dnl +AC_MSG_RESULT($sudo_cv_func_utime_posix) +if test $sudo_cv_func_utime_posix = yes; then + AC_DEFINE(HAVE_UTIME_POSIX) +fi +]) + dnl dnl check for known UNIX variants dnl XXX - check to see that uname was checked first @@ -192,8 +248,11 @@ else fi fi ])dnl + dnl dnl checks for UNIX variants that lack uname +dnl + dnl dnl SUDO_CONVEX dnl @@ -206,6 +265,7 @@ $0], [AC_EGREP_HEADER])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes, #endif ], [$1], [$2]) ])dnl + dnl dnl SUDO_MTXINU dnl @@ -219,6 +279,7 @@ $0], [AC_EGREP_HEADER])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes, #endif ], [$1], [$2]) ])dnl + dnl dnl SUDO_NEXT dnl @@ -229,6 +290,7 @@ if test -r /usr/lib/NextStep/software_version; then OSREV=`$SEDPROG -e 's/^[[ \.0A-z]]*//' -e 's/\..*//' -e 1q < /usr/lib/NextStep/software_version` fi ])dnl + dnl dnl SUDO_BSD dnl