Package: coreutils
Version: 8.20-3
Severity: normal
Tags: upstream

Under some circumstances, combining the --recursive and --changes arguments
to chmod can cause it to report errors checking the new permissions of
subdirectories.  Test case:
$ cd /tmp
$ mkdir -p a/b
$ chmod -R g+s a
$ chmod -Rc o-rwx a
mode of `a' changed from 2755 (rwxr-sr-x) to 2750 (rwxr-s---)
chmod: getting new attributes of `b': No such file or directory

The problem lies in src/chmod.c, function mode_changed, line ~123, the call
to stat.  The file path passed is just the filename, not the recursive path,
and so the stat call fails.  A more subtle error happens if the filename is
valid in the current directory from which chmod is invoked, since it will
then be comparing the mode bits of two unrelated items.

All other calls to stat and chmod related functions use the *at variants
that take a directory fd for path resolution.  This call needs to be updated
to do the same.

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8.5 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages coreutils depends on:
ii  dpkg          1.16.10
ii  install-info  4.13a.dfsg.1-10
ii  libacl1       2.2.51-8
ii  libattr1      1:2.4.46-8
ii  libc6         2.13-38
ii  libselinux1   2.1.9-5

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to