bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems


From: Bruno Haible
Subject: Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems
Date: Sun, 16 Feb 2020 23:28:57 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; )

> > Perhaps lchmod.m4 and fchmodat.m4 should define a symbol 
> > HAVE_LCHMOD_BUG_WITH_NON_SYMLINKS and the C code could refer to that. 

> 2020-02-16  Bruno Haible  <address@hidden>
> 
>       lchmod: Make more future-proof.
>       * m4/lchmod.m4 (gl_FUNC_LCHMOD): Define NEED_LCHMOD_NONSYMLINK_FIX.
>       (gl_PREREQ_LCHMOD): New macro.
>       * lib/lchmod.c (orig_lchmod): New function.
>       (lchmod): Test NEED_LCHMOD_NONSYMLINK_FIX. Access /proc only on Linux.
>       Return EOPNOTSUPP only on Linux and on platforms without lchmod
>       function.
>       * modules/lchmod (configure.ac): Invoke gl_PREREQ_LCHMOD.

And here's a similar change for 'fchmodat'. It has one or two code branches
that currently are dead code, but this is on purpose: this is code that
will becomes active when either the NEED_FCHMODAT_NONSYMLINK_FIX test
will trigger on more platforms, or some more autoconf tests will be added
to fchmodat.m4.


2020-02-16  Bruno Haible  <address@hidden>

        fchmodat: Make more future-proof.
        * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): Define
        NEED_FCHMODAT_NONSYMLINK_FIX.
        (gl_PREREQ_FCHMODAT): New macro.
        * lib/fchmodat.c (fchmodat): Test NEED_FCHMODAT_NONSYMLINK_FIX. Access
        /proc only on Linux. Return EOPNOTSUPP only on Linux and on platforms
        without lchmod function.
        * modules/fchmodat (configure.ac): Invoke gl_PREREQ_FCHMODAT.

Attachment: 0001-fchmodat-Make-more-future-proof.patch
Description: Text Data


reply via email to

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