GNU bug report logs - #10489
24.0.92; dired-do-copy may create infinite directory hierarchy

Previous Next

Package: emacs;

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 #246 received at 10489 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: 10489 <at> debbugs.gnu.org, Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#10489: 24.0.92;
	dired-do-copy may create infinite directory hierarchy
Date: Wed, 22 Feb 2012 17:00:08 -0500
> Ok, that is true for the solutions you propose below, but what's wrong
> with the solution I have proposed:
> Just checking if the destination directory is a subdirectory of the
> directory we want to copy.

It's not a bad plan, but it's difficult to make it catch all cases
because it's difficult to figure out if "the destination directory is
a subdirectory of the directory we want to copy".
[ e.g. because of ignored cases differences, or use of different names
  to refer to the same directory, because of MICROS~1 mangling.  ]

Of course checking if two directories are one and the same isn't that
easy to do it reliably either (e.g. for lack of inodes on Windows
systems, and actually I'm not sure what happens if we refer to the same
dir via two different mount points, using GNU/Linux's "bind" mounts, or
mounting dirs multiple times).

I guess the two options aren't mutually exclusive, so it's probably
worth doing a first check before starting the whole operation (trying
to find out if the destination is a parent of the source based on
file-truename), and then adding another check in the recursive loop to
try and detect inf-loops.


        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.