bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"cannot dereference" error from "chown -RH"


From: enh
Subject: "cannot dereference" error from "chown -RH"
Date: Thu, 25 Jun 2009 14:01:41 -0700

if i create a dangling symbolic link within a tree, "chown -RH
top-of-tree" gets me a "cannot dereference" error.

STEPS TO REPRODUCE:

  cd /tmp
  mkdir chown-test
  cd chown-test
  ln -s poop parp
  cd ..
  chown -RH :nogroup chown-test

ACTUAL OUTPUT:

  chown: cannot dereference `chown-test/parp': No such file or directory
  chown: changing group of `chown-test': Operation not permitted

EXPECTED BEHAVIOR:

i don't think chown should try to dereference the dangling symbolic
link. looking at the source, i think affect_symlink_referent should be
false. i think the code in chown.c's main() should be more like the
code in chcon.c's main(), but that both should be changed to test
(bit_flags & FTS_PHYSICAL) rather than (bit_flags == FTS_PHYSICAL),
because -H sets bit_flags to FTS_COMFOLLOW | FTS_PHYSICAL.

alternatively, i could have completely misunderstood the intended
behavior of -RH. but it seems to me like -H should cause only symbolic
links explicitly named on the command-line to be dereferenced.

-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/




reply via email to

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