From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#17238: 24.3; TRAMP Can't open remote file with '$' in the filename Date: Fri, 11 Apr 2014 08:36:04 +0200 Message-ID: <87k3awe5kb.fsf@gmx.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397198261 24672 80.91.229.3 (11 Apr 2014 06:37:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2014 06:37:41 +0000 (UTC) Cc: 17238@debbugs.gnu.org To: Dana Pieluszczak Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 11 08:37:34 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WYV5i-0004JK-D4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Apr 2014 08:37:34 +0200 Original-Received: from localhost ([::1]:56157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYV5h-0007Mr-MP for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Apr 2014 02:37:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYV5K-000797-QW for bug-gnu-emacs@gnu.org; Fri, 11 Apr 2014 02:37:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYV5D-0000R0-97 for bug-gnu-emacs@gnu.org; Fri, 11 Apr 2014 02:37:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYV5D-0000Qw-5K for bug-gnu-emacs@gnu.org; Fri, 11 Apr 2014 02:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WYV5C-0001uG-FK for bug-gnu-emacs@gnu.org; Fri, 11 Apr 2014 02:37: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: Fri, 11 Apr 2014 06:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17238 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17238-submit@debbugs.gnu.org id=B17238.13971981807229 (code B ref 17238); Fri, 11 Apr 2014 06:37:02 +0000 Original-Received: (at 17238) by debbugs.gnu.org; 11 Apr 2014 06:36:20 +0000 Original-Received: from localhost ([127.0.0.1]:45107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WYV4V-0001sW-0Y for submit@debbugs.gnu.org; Fri, 11 Apr 2014 02:36:19 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:49775) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WYV4R-0001sF-SB for 17238@debbugs.gnu.org; Fri, 11 Apr 2014 02:36:17 -0400 Original-Received: from detlef.gmx.de ([93.202.54.99]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MAyZg-1WgEJQ23LI-009vOE; Fri, 11 Apr 2014 08:36:08 +0200 In-Reply-To: (Dana Pieluszczak's message of "Thu, 10 Apr 2014 23:01:03 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:5viS2rvHzOhX+tA5e2fg6f0XrZrjQqfMAUVtYy8pRywOYZZsQ+Y slGDoRBP5dBizHuu9d0FQYNSdIVXhnCAVQtzWS9ojAq/FrgLqfobAGBRgrdM5E8BQkWUZtk lp0R1LN29AbDoWMPL2VUwQ9jYpV3mg7WMq6i+D1Dyfs41GflKMApfm1z6ZhmohZpP1LtZmC 8IGIM6cwGpaBwWc3tKkwg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:87938 Archived-At: Dana Pieluszczak writes: Hi Dana, > # now we're in emacs > C-x C-f DEL DEL /dana@192.168.1.105:/home/dana/t$test.txt RET For the records, it should be "/dana@192.168.1.105:/home/dana/t$$test.txt". It works for you because "$test" is not an environment variable; otherwise it would be replaced. > Actual result > > - a new buffer called t$test.txt is opened > - the buffer is empty > - The following is written to *Messages* buffer: > File exists, but cannot be read Confirmed, I could reproduce it. > This is a bug in tramp-sh-handle-file-truename. I've attached a > patch. The current version of tramp-sh-handle-file-truename uses > backticks inside a quoted string. Shell arguments used inside the > backticks should be shell escaped twice, but they're not. > > I've changed the shell command to use a subshell ( $(...) ) > Instead of backticks which removes the need for the double escaping. We cannot use the $(...) syntax, because we don't know whether the remote shell does support it. Instead, we shall quote the file name twice. Does the following patch work for you? (The line numbers might differ) --8<---------------cut here---------------start------------->8--- *** /usr/share/emacs/24.3/lisp/net/tramp-sh.el.~1~ 2014-04-11 08:19:48.434437606 +0200 --- /usr/share/emacs/24.3/lisp/net/tramp-sh.el 2014-04-11 08:19:48.594440377 +0200 *************** *** 1066,1072 **** v (format "echo \"\\\"`%s --canonicalize-missing %s`\\\"\"" (tramp-get-remote-readlink v) ! (tramp-shell-quote-argument localname))))) ;; Use Perl implementation. ((and (tramp-get-remote-perl v) --- 1066,1073 ---- v (format "echo \"\\\"`%s --canonicalize-missing %s`\\\"\"" (tramp-get-remote-readlink v) ! (tramp-shell-quote-argument ! (tramp-shell-quote-argument localname)))))) ;; Use Perl implementation. ((and (tramp-get-remote-perl v) --8<---------------cut here---------------end--------------->8--- > Dana P Best regards, Michael.