GNU bug report logs -
#10489
24.0.92; dired-do-copy may create infinite directory hierarchy
Previous Next
Reported by: michael_heerdegen <at> web.de
Date: Thu, 12 Jan 2012 19:36:01 UTC
Severity: important
Tags: patch
Merged with 11130
Found in version 24.0.92
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #225 received at 10489 <at> debbugs.gnu.org (full text, mbox):
> so what is the state of this bug and what do you plan for this?
> As a reminder, we needed:
> 1) A function to compare filenames locally.
> 2) A tramp handler for this function.
> 3) A function to check if file1 is subdir of file2, locally also.
> 4) A tramp handler for this one also?
> We have more or less 1 and 3, need tramp handlers for them.
> What else is needed?
Just before we try and solve this problem the hard way:
I just tried:
% ln -s erlang-otp erl
% cp -r erl/lib erlang-otp/lib/inviso/
on my Debian system, and it told me "cp: impossible de créer un
répertoire (« erl/lib ») dans lui-même (« erlang-otp/lib/inviso/lib »)",
but note that it only told me so *after* performing the copy.
I.e. it only detected the problem when trying to make
erlang-otp/lib/inviso/lib/inviso/lib
So it seems that the coreutils guys have found it sufficient to detect
the inf-loop after the fact and interrupt the operation at that point
rather than to try and predict that the cp will loop and don't perform
it at all.
It might be easier to get a solution that catches all cases that way:
remember the name and identity (inode/file-attributes/younameit) of
the top directory we create, and whenever we're about to copy
a directory of the same name, check whether it happens to have the
same identity, in which case we've hit an inf-loop.
Stefan
This bug report was last modified 13 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.