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

Re: Bug#487317: perl-modules: File::Path::rmtree sets symlink target permissions to 0777

Drake Wilson <drake@begriffli.ch> writes:

> The rmtree implementation actually tries to avoid this, but does it
> wrong: it _reads_ the permissions from the symbolic link, then
> _applies_ changed permissions through chmod, which affects the target
> instead.

There's an lchmod function that avoids this behavior, but I'm not sure
that Perl provides an interface to it without a new XS module.  (It's not
portable to all systems, but it is available on Linux.)

Failing switching to lchmod, File::Path should check with -l whether the
file is a link before chmoding it.

Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>

Reply to: