bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: m4/openat.m4 robustness


From: Jim Meyering
Subject: Re: m4/openat.m4 robustness
Date: Sat, 13 Nov 2010 14:16:36 +0100

Bruno Haible wrote:
> Hi Jim,
>
> The macros in m4/openat.m4 could be made a little more reliable:
>   - Before running a test program that invokes fchownat(), make sure that
>     glibc will declare fchownat().
>   - Ensure that REPLACE_FCHOWNAT at is not set to 0 accidentally after it
>     has already been determined that its correct value should be 1.
>
> In my tests, I didn't see the wrong macro ordering occur actually,
> but the bugs could surface if macro invocations get rearranged, or
> if fchownat is moved to a module of its own, or similar.
>
> OK to apply?
>
>
> 2010-11-13  Bruno Haible  <address@hidden>
>
>       openat: Ensure autoconf macro ordering.
>       * m4/openat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Require
>       gl_USE_SYSTEM_EXTENSIONS.
>       (gl_FUNC_FCHOWNAT): Require gl_UNISTD_H_DEFAULTS.
>
> --- m4/openat.m4.orig Sat Nov 13 13:58:48 2010
> +++ m4/openat.m4      Sat Nov 13 13:56:13 2010
> @@ -63,6 +63,9 @@
>  # gl_FUNC_FCHOWNAT_DEREF_BUG([ACTION-IF-BUGGY[, ACTION-IF-NOT_BUGGY]])
>  AC_DEFUN([gl_FUNC_FCHOWNAT_DEREF_BUG],
>  [
> +  dnl Persuade glibc <unistd.h> to declare fchownat().

s/glibc/glibc's/

Sure.  That looks sensible.
Thanks.

> +  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
> +
>    AC_CACHE_CHECK([whether fchownat works with AT_SYMLINK_NOFOLLOW],
>      gl_cv_func_fchownat_nofollow_works,
>      [
> @@ -104,6 +107,7 @@
>  # Also use the replacement function if fchownat is simply not available.
>  AC_DEFUN([gl_FUNC_FCHOWNAT],
>  [
> +  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
>    AC_REQUIRE([gl_FUNC_CHOWN])
>    AC_CHECK_FUNC([fchownat],
>      [gl_FUNC_FCHOWNAT_DEREF_BUG(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]