From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#16984: dired-do-rename susceptible to .../~/... hijack Date: Sat, 29 Oct 2016 18:22:01 +0200 Message-ID: <874m3vazx2.fsf@gmx.de> References: <87eh2aq60w.fsf@jidanni.org> <87pomrst3z.fsf@users.sourceforge.net> <837f8zpnih.fsf@gnu.org> <87pomjrita.fsf@users.sourceforge.net> <83pomjr63z.fsf@gnu.org> <87eg2zb860.fsf@gmx.de> <87h97vqhf3.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477758215 9222 195.159.176.226 (29 Oct 2016 16:23:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2016 16:23:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 16984@debbugs.gnu.org, jidanni@jidanni.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 29 18:23:30 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0WPW-0007qd-4f for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Oct 2016 18:23:10 +0200 Original-Received: from localhost ([::1]:55259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0WPY-0005Xv-PF for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Oct 2016 12:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0WPR-0005Xp-V1 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2016 12:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0WPO-0005gd-H7 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2016 12:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0WPO-0005gZ-DE for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2016 12:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c0WPO-0003i6-7v for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2016 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2016 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed Original-Received: via spool by 16984-submit@debbugs.gnu.org id=B16984.147775814814206 (code B ref 16984); Sat, 29 Oct 2016 16:23:02 +0000 Original-Received: (at 16984) by debbugs.gnu.org; 29 Oct 2016 16:22:28 +0000 Original-Received: from localhost ([127.0.0.1]:36759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0WOq-0003h4-AY for submit@debbugs.gnu.org; Sat, 29 Oct 2016 12:22:28 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0WOo-0003gs-TY for 16984@debbugs.gnu.org; Sat, 29 Oct 2016 12:22:27 -0400 Original-Received: from detlef.gmx.de ([87.146.50.156]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LkCU2-1ccKBN2V8k-00cBaO; Sat, 29 Oct 2016 18:22:03 +0200 In-Reply-To: <87h97vqhf3.fsf@users.sourceforge.net> (npostavs's message of "Sat, 29 Oct 2016 11:54:56 -0400") X-Provags-ID: V03:K0:ZdP1kTFnZKl6IVeiubmuprKVFZNAKnWbJVCM+jWwhgOEvUF0Pmr WrOEw5rWy7lczX92Q99smgCWFXyB1VQNePAk5qtTWXsCHjFbmAqPvgz6++aqocsZExScAmy ybM4X0AIysFVbYPxcG7AD37D4j5ct/0EWTPSkQXMiIdHF2wbNI2TWtDTE9BxhEbV/wuVwN4 so6tabKfNBCK0Sac4w52Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:Eja3Xbmvj3E=:DE1YEcGJ0XBWj/ScXpgOLJ mb/DviNYgKyjohRbCNbEtm/00/IKcBnfLp180ondpYKZsD2gjJrnpgswvMG9ADSML0hx3B2ba i9aeTEvGs6PtYfh51WZ/Nd8EEPYt/rwyG3rcMZR2MsCiRA0ttldKBgL3q0sf1E7q6YHQ/8o3Z 86MN0jMDlfL39J8nfzoTEajaheK4u67IYgFqofGaXPXLy+BxKxCWxLX0I0ejvL3Odj3FomIZR 9+SSgrCpmNSix2dLUkUexGCjniPtxiGJu76h6UbSkQmQAsO2Y2aCprViSD6CtVYeRqOpcIxNS 8sC+/uj0l29tb1GdzbJPeJiepIVhvGzHNjUW5X24qs9Z03DETY28x/dt/PNougmjQYofsaStD JoOyLUlAJi7eMgR6KpDmPQjRTHn3XmK7JjPd5OKIu/TxZD/4+UUr9Hftmr5yJ8/XiIYMnNSvS 0lgBaDcKppP4MBuXVYX4uc4y2Rp/L50fAQxIP3pVqUy6WcMbqJtFY/ur8lXdLjy0ibO2M5u5i Ia59omUsHKzojbV5Ghi4CrUg6LNXXauQ0J9GzqwCDLGXq2maRh37QXZtrwH0+QtHbvON2AGZ6 ti8cxPjUSNe/pL1MdwyTzlyqkMUJSBoV5WU1FAGTN+yuKNsDuRmj+FscYbfvUc5JAilxpSNVI hIxIInFG86xSe28hTbkXpuoB4/Ipi06UBHfcPCquONPwi5r+1JEkmwwCjD6m4Fx3IENmlZQXn 8G4dreL4sLLZmSwRbNwbALOMx9uxB8nUcE5nBkhVGiAASc3DH9Wz72obhBaWRIeC/j6R/EgU X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:125118 Archived-At: npostavs@users.sourceforge.net writes: >> Prefixing with "/:" would also deactivate all file name handlers. The >> file name "/ssh:user@host:/path/~/file" would be handled literally, >> which is wrong. > > Ah, good point. How about checking (find-file-name-handler filename > 'substitute-in-file-name): > > + (not (let ((handler (find-file-name-handler > + filename 'substitute-in-file-name))) > + (and handler > + (funcall handler 'substitute-in-file-name filename))))) I would rather use (not (file-remote-p file-name)) This fixes the problem for local file names, but not for remote ones. "/ssh:user@host:/path/~/file" would still be expanded to something like "/ssh:user@host:/home/user/file". Well, better than nothing. What do people think to use the "/:" prefix also for the local part of remote file names? Then one could use "/ssh:user@host:/:/path/~/file", making substitute-in-file-name a noop. Best regards, Michael.