GNU bug report logs - #17035
[PATCH] chmod -c -R produces errors with special permissions

Previous Next

Package: coreutils;

Reported by: Dylan Alex Simon <dylan <at> dylex.net>

Date: Tue, 18 Mar 2014 16:54:02 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: dylan <at> dylex.net, 17035 <at> debbugs.gnu.org
Subject: bug#17035: [PATCH] chmod -c -R produces errors with special permissions
Date: Wed, 19 Mar 2014 08:57:09 +0100
On 03/19/2014 12:41 AM, Pádraig Brady wrote:
> On 03/18/2014 10:18 PM, Bernhard Voelker wrote:
>> One question: I did not dig into this deeper yet, but what exactly
>> is the connection between "directory with special permissions"
>> vs. "stat()ing the wrong file"?
>> I'm asking because incidentally yesterday I saw the same warning
>> from "chmod -R -c" when playing with recursive bind-mounts, i.e.,
>> there were no files or directories with special bits set.
>
> Interesting. Looking at the code seems that message
> is restricted to the above condition where those bits are set.
> Can you reproduce?

Yes, fortunately - and now I see that my case implicitly was
using +t mode because of the TMPFS file system type:

  $ mount -t tmpfs /mnt /mnt

  $ mkdir -p /mnt/dir/mnt

  $ mount --bind /mnt /mnt/dir/mnt

  $ cd /mnt

  $ ln -s dir/mnt/dir d

  $ ls -ldogi . d dir dir/mnt
  186326 drwxrwxrwt 3 80 Mar 19 08:31 .
  188029 lrwxrwxrwx 1 11 Mar 19 08:31 d -> dir/mnt/dir
  188511 drwxr-xrwx 3 60 Mar 19 08:31 dir
  186326 drwxrwxrwt 3 80 Mar 19 08:31 dir/mnt

  $ chmod -Rc o+w dir
  mode of ‘dir’ changed from 0755 (rwxr-xr-x) to 0757 (rwxr-xrwx)
  chmod: getting new attributes of ‘mnt’: No such file or directory
  mode of ‘dir/mnt/dir/mnt’ changed from 0755 (rwxr-xr-x) to 0757 (rwxr-xrwx)

As a final side note to this case, I want to mention that the issue
also happens with the -v option, of course:

  $ mkdir -p a/b
  $ chmod +t a/b
  $ chmod -Rv o+w a
  mode of ‘a’ changed from 0755 (rwxr-xr-x) to 0757 (rwxr-xrwx)
  chmod: getting new attributes of ‘b’: No such file or directory
  mode of ‘a/b’ retained as 1757 (rwxr-xrwt)

Thanks & have a nice day,
Berny




This bug report was last modified 11 years and 71 days ago.

Previous Next


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