Re: [dev] [sbase] chmod -R and symbolic links

From: Michael Forney <mforney_AT_mforney.org>
Date: Sat, 28 Dec 2019 16:24:57 -0800

On 2019-12-23, Laslo Hunhold <dev_AT_frign.de> wrote:
> On Sat, 21 Dec 2019 19:05:45 -0800
> Michael Forney <mforney_AT_mforney.org> wrote:
>
> Dear Michael,
>
>> I can think of two possibilities here:
>>
>> 1. Remove the -H, -L, and -P options from chmod, always set r.follow =
>> 'H', and call chmod(3) conditional on !S_ISLINK(st->st_mode).
>> 2. Keep the -H, -L, and -P options, but use fchmodat(3) instead of
>> chmod(3) with AT_SYMLINK_NOFOLLOW depending on r->follow and r->depth.
>> If fchmodat fails with EOPNOTSUPP, ignore that and continue.
>>
>> Does anyone have a strong preference for 2? I'm leaning towards 1
>> since it doesn't seem like those options are used commonly.
>
> I have a strong preference for 2 tbh, but it's your discretion as the
> maintainer. Only because the other tools "suck" doesn't mean we should
> lower our standards. Especially with the H, L and P options we found
> many bugs in GNU coreutils, and keeping them in is essential if we
> want to claim that we are more or less POSIX compliant.

I'm only proposing removing -H, -L, and -P from chmod, not the other
tools. The only POSIX option is -R, and the only use I can think of
for chmod -L is if you wanted to modify the permissions of files
outside the directory tree, which are pointed to by symlinks inside
the tree.
Received on Sun Dec 29 2019 - 01:24:57 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 29 2019 - 06:36:06 CET