GNU bug report logs - #39236
[musl] coreutils cp mishandles error return from lchmod

Previous Next

Package: coreutils;

Reported by: Florian Weimer <fweimer <at> redhat.com>

Date: Wed, 22 Jan 2020 14:36:02 UTC

Severity: normal

Full log


Message #56 received at 39236 <at> debbugs.gnu.org (full text, mbox):

From: Florian Weimer <fw <at> deneb.enyo.de>
To: Rich Felker <dalias <at> libc.org>
Cc: musl <at> lists.openwall.com, Paul Eggert <eggert <at> cs.ucla.edu>,
 Gnulib bugs <bug-gnulib <at> gnu.org>, 39236 <at> debbugs.gnu.org
Subject: Re: bug#39236: [musl] coreutils cp mishandles error return from lchmod
Date: Wed, 12 Feb 2020 20:13:38 +0100
* Rich Felker:

> Note that in any case, musl's lchmod/fchmodat is not affected since it
> always refuses to change symlink modes; I did this because I was
> worried that chmod on the magic symlink in /proc might pass through
> not just to the symlink it refers to, but to the symlink target if one
> exists. With current kernel versions it seems that does not happen; is
> it safe to assume it doesn't?

I saw it happen with sshfs over FUSE. 8-/

Yet another reason to put in a check before performing the chmod.

> Further, I've found some inconsistent behavior with ext4: chmod on the
> magic symlink fails with EOPNOTSUPP as in Florian's test, but fchmod
> on the O_PATH fd succeeds and changes the symlink mode. This is with
> 5.4. Cany anyone else confirm this? Is it a problem?

Interesting. Let me update the other thread.




This bug report was last modified 5 years and 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.