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: Paul Eggert
Subject: Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems
Date: Fri, 14 Feb 2020 13:02:08 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/13/20 7:46 PM, Bruno Haible wrote:

Here is a proposed patch:

Thanks, looks good.

2) Also the discussion what is the "right" behaviour is specific to Linux.
The code in the '#else' case

   if (S_ISLNK (st.st_mode))
     {
       close (fd);
       errno = EOPNOTSUPP;
       return -1;
     }

will surely upset users on BSD systems, where symlinks are intended to have
permission bits.

Because of the Autoconf tests, that code should be executed only on platforms where lchmod fails (or does not exist), whould shouldn't occur on BSD systems. Still, I take your point that the code is confusing. Perhaps lchmod.m4 and fchmodat.m4 should define a symbol HAVE_LCHMOD_BUG_WITH_NON_SYMLINKS and the C code could refer to that. The resulting machine code would be the same as now, but the cause-and-effect would be clearer.



reply via email to

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