From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy Date: Fri, 13 Jan 2012 12:19:23 +0100 Message-ID: <878vlbsvd0.fsf@gmail.com> References: <87mx9su32g.fsf@web.de> <87sjjkfvwt.fsf@gmail.com> <8362ggkquq.fsf@gnu.org> <87pqeoro8p.fsf@gmail.com> <83wr8vki5t.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326453644 26088 80.91.229.12 (13 Jan 2012 11:20:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2012 11:20:44 +0000 (UTC) Cc: 10489@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 13 12:20:36 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RlfBU-0000QP-27 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2012 12:20:36 +0100 Original-Received: from localhost ([::1]:32844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlfBT-0008Di-AZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2012 06:20:35 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlfBM-0008D6-HZ for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 06:20:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlfBL-0005C1-5s for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 06:20:28 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlfBL-0005Bv-1l for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 06:20:27 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RlfBu-0006Xn-2x for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2012 06:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jan 2012 11:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10489-submit@debbugs.gnu.org id=B10489.132645361125090 (code B ref 10489); Fri, 13 Jan 2012 11:21:02 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 13 Jan 2012 11:20:11 +0000 Original-Received: from localhost ([127.0.0.1]:55894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RlfB5-0006Wc-CY for submit@debbugs.gnu.org; Fri, 13 Jan 2012 06:20:11 -0500 Original-Received: from mail-we0-f172.google.com ([74.125.82.172]:43151) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RlfAz-0006WQ-4x for 10489@debbugs.gnu.org; Fri, 13 Jan 2012 06:20:09 -0500 Original-Received: by werl4 with SMTP id l4so318494wer.3 for <10489@debbugs.gnu.org>; Fri, 13 Jan 2012 03:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ALDymuTBxz3wnzLnyPnUtgcQEMA19c4eH9FyxeWDfZs=; b=l5Bx9aOm7bzXpVFwAz2cW5PePqeF6cJ8TqizAE6snRxtjbsEWvn2zYUQAqzKfeoGuY vI9KCm/JgjXcCntEZ+9a3FAUlLIHhgLeUjXHHXuKsmCkk4GP5eCIcPVl5viuaZkVo87Y lm4Az9zr4MX3pBfJjaZbsFMdlGWomLrus7qU8= Original-Received: by 10.216.137.195 with SMTP id y45mr1992794wei.45.1326453567856; Fri, 13 Jan 2012 03:19:27 -0800 (PST) Original-Received: from thierry-MM061 (121.77.197.77.rev.sfr.net. [77.197.77.121]) by mx.google.com with ESMTPS id q5sm10660539wbo.8.2012.01.13.03.19.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jan 2012 03:19:26 -0800 (PST) In-Reply-To: <83wr8vki5t.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Jan 2012 12:31:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55679 Archived-At: Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: 10489@debbugs.gnu.org >> Date: Fri, 13 Jan 2012 09:38:30 +0100 >> >> > I don't think this will solves all the use cases. File names are not >> > strings, you cannot compare them as literal strings and hope to plumb >> > all the leaks. >> A test with `equal' is already used in `dired-create-files', >> (equal from to) >> Is it the correct way to compare two filenames? > > I don't see how `equal' could help, unless someone teaches it to treat > strings that are file names specially. I don't see such treatment in > the current sources. > >> > Some situations which I think this patch will not handle correctly: >> > >> > . file names with different letter-case on a case-insensitive file >> > system >> Can you provide example or better a recipe. > > emacs -Q > C-x d ~ RET > > C ~/test RET > yes RET > >> > . relative vs absolute file names >> Same. > > M-: (dired-copy-file-recursive "foo/../Test" "./Test" t) RET > >> > . file names that are hard links to the same directory (this includes >> > the infamous 8+3 short aliases on Windows) >> Don't know on Windows, (My knowledge of links in windows is very >> limited) >> here it is difficult (impossible as User) to Hardlink a directory: >> >> --8<---------------cut here---------------start------------->8--- >> man ln: >> -d, -F, --directory >> allow the superuser to attempt to hard link directories >> (note: will probably fail due to system restrictions, >> even for the superuser) >> --8<---------------cut here---------------end--------------->8--- > > We don't disallow superusers from using Emacs, nor restrict Emacs > usage only to filesystems where links to directories are impossible, > do we? ;-) I just want to be able to test: cp "a_hardlink_of_/foo" "/foo" > And what about symlinks? > > On Windows, you can have "C:/PROGRA~1" be the alias of > "C:/Program Files", for example. > > Bottom line, I think you need: > > . make both file names absolute by calling expand-file-name on each Ok > . resolve links by calling file-truename on each (this will handle > the 8+3 alias issue, as well as, AFAIK, the issue with links) Ok > . compare case-insensitively on MS-Windows and MS-DOS let binding case-fold-search should be ok. Thanks, I will add these modifications to the patch handling remote files. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997