From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dana Pieluszczak Newsgroups: gmane.emacs.bugs Subject: bug#17238: 24.3; TRAMP Can't open remote file with '$' in the filename Date: Thu, 10 Apr 2014 23:01:03 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11337d4a54a91804f6bb8b45 X-Trace: ger.gmane.org 1397187750 28784 80.91.229.3 (11 Apr 2014 03:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2014 03:42:30 +0000 (UTC) To: 17238@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 11 05:42:22 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 1WYSM7-0002PN-Pm for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Apr 2014 05:42:20 +0200 Original-Received: from localhost ([::1]:55635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYSM7-0002sS-82 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Apr 2014 23:42:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYSLy-0002rm-NS for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:42:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYSLr-0007zy-CQ for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:42:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYSLr-0007zr-8z for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WYSLq-0004IY-KI for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dana Pieluszczak Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Apr 2014 03:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17238 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139718766816419 (code B ref -1); Fri, 11 Apr 2014 03:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Apr 2014 03:41:08 +0000 Original-Received: from localhost ([127.0.0.1]:45065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WYSKu-0004Gd-7e for submit@debbugs.gnu.org; Thu, 10 Apr 2014 23:41:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53016) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WYRiU-000331-2m for submit@debbugs.gnu.org; Thu, 10 Apr 2014 23:01:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYRiN-0005Z8-7J for submit@debbugs.gnu.org; Thu, 10 Apr 2014 23:01:16 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYRiN-0005Z4-3j for submit@debbugs.gnu.org; Thu, 10 Apr 2014 23:01:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYRiI-0007tP-6a for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:01:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYRiD-0005YB-Aa for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:01:10 -0400 Original-Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:33676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYRiD-0005Y0-34 for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2014 23:01:05 -0400 Original-Received: by mail-qg0-f43.google.com with SMTP id f51so4805932qge.2 for ; Thu, 10 Apr 2014 20:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=5HCD+cB2ECRYffKm26InQOFAy8cOXuq0T9N40nUglKY=; b=VcXf9ENTpMEXe4YxZ046jfVJOeANqTEfC4cgVKBSnjvA1mH07uyYn6szSYBoJ5/kLF W7JbUFWY0mjWatiVm44PYinuHGgwRVPpnxL7UAn1565B0Tu7cIX/0G2Lq47crV3C7vUD RzMcj8mSn/o7xnFpprrDd/PnwKeB0xJcLw/KuCJEqhm0K3cMOMcm5oOzfTsLtJM4ONs1 QP7fJUdyyLTOOJhevCfgH4BBSizcZoKFmkUYVY7msEGQ591RJVRRoOLHe5Znn8ViXABo ivg0w69kDNVg+MyWpBO3JWljk8u/5BwyeLRTTGhB+Y9YQ44lCExeHUr9Tk2Xv87Xi1g1 6wNA== X-Received: by 10.229.192.7 with SMTP id do7mr25271517qcb.1.1397185263716; Thu, 10 Apr 2014 20:01:03 -0700 (PDT) Original-Received: by 10.140.44.8 with HTTP; Thu, 10 Apr 2014 20:01:03 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Thu, 10 Apr 2014 23:41:02 -0400 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:87936 Archived-At: --001a11337d4a54a91804f6bb8b45 Content-Type: multipart/alternative; boundary=001a11337d4a54a91504f6bb8b43 --001a11337d4a54a91504f6bb8b43 Content-Type: text/plain; charset=ISO-8859-1 Preconditions - A linux host which you have ssh access to (192.168.1.105 in the example below) - An account on said host - SHELL on the remote host is /bin/bash (GNU bash, version 4.2.25(1)-release (i686-pc-linux-gnu) Reproduction steps $ ssh dana@192.168.1.105 'echo "some content" > /home/dana/t\$test.txt' # verify there's some content in the file $ ssh dana@192.168.1.105 'cat /home/dana/t\$test.txt' $ emacs -Q -nw # now we're in emacs C-x C-f DEL DEL /dana@192.168.1.105:/home/dana/t$test.txt RET Expected result - a new buffer called t$test.txt is opened visiting the remote file 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 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. I've done my best to follow the guidelines for reporting a bug and submitting a patch. I'll be happy to fix up whatever is necessary to get this accepted. Dana P If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /Applications/Emacs.app/Contents/Resources/etc/DEBUG. In GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org Windowing system distributor `Apple', version 10.3.1265 Configured using: `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin' '--with-ns' 'build_alias=i686-apple-darwin' 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.7 -isystem /Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/ -F/Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Text Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: ESC [ ? 1 ; 2 c C-x C-f DEL DEL / d a n a @ 1 9 2 . 1 6 8 . 1 . 1 0 1 DEL 5 : t DEL / h o m e / d a n a / t $ t e s t . t x t RET ESC x r e p o r t TAB RE T Recent messages: Tramp: Opening connection for dana@192.168.1.105 using scpc...done Tramp: Inserting `/scpc:dana@192.168.1.105:/home/dana/t$test.txt'...done File exists, but cannot be read Tramp: Checking `vc-registered' for /scpc:dana@192.168.1.105: /home/dana/t$test.txt...done File exists, but cannot be read Tramp: Checking `vc-registered' for /scpc:dana@192.168.1.105: /home/dana/t.txt...done File exists, but cannot be read current-kill: Kill ring is empty Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache tramp-loaddefs shell pcomplete comint ansi-color ring format-spec advice help-fns cl-lib advice-preload time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) --001a11337d4a54a91504f6bb8b43 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Preconditions
- A linux host which you have ssh access to (192.168.1.105 in the exam= ple below)
- An account on said host
- SHELL on the remote host is /b= in/bash (GNU bash, version 4.2.25(1)-release (i686-pc-linux-gnu)

Reproduction steps

$ ssh d= ana@192.168.1.105 'echo "some content" > /home/dana/t\= $test.txt'
# verify there's some content in the file
$ ssh dana@192.168.1.105 'cat /home/d= ana/t\$test.txt'
$ emacs -Q -nw
# now we're in emacs
C-x C-f DEL DEL /dana@192.168= .1.105:/home/dana/t$test.txt RET

Expected result

- a new buff= er called t$test.txt is opened visiting the remote file

Actual resul= t

- a new buffer called t$test.txt is opened
- the buffer is empty
= - The following is written to *Messages* buffer:
=A0 File exists, but ca= nnot be read

This is a bug in tramp-sh-handle-file-truename. I'v= e attached a
patch. The current version of tramp-sh-handle-file-truename uses
backtic= ks inside a quoted string. Shell arguments used inside the
backticks sho= uld be shell escaped twice, but they're not.

I've changed th= e shell command to use a subshell ( $(...) )
Instead of backticks which removes the need for th= e double escaping.


I've done my best to follow= the guidelines for reporting a bug and

submitting a patch. I'll be happy to fix up= whatever is necessary to get

this accepted.


Dana P


If Emacs crashed, and y= ou have the Emacs process in the gdb debugger,

please include the outp= ut from the following gdb commands:

=A0 =A0 `bt full' a= nd `xbacktrace'.

For information about d= ebugging Emacs, please read the file

/Applications/Emacs.app= /Contents/Resources/etc/DEBUG.



In GNU Emacs 24.3.1 (x8= 6_64-apple-darwin, NS apple-appkit-1038.36)

=A0of 2013-03-13 on bob.porkrind.org

Windowing system distri= butor `Apple', version 10.3.1265

Configured using:

=A0`configure '--ho= st=3Dx86_64-apple-darwin' '--build=3Di686-apple-darwin'<= /p>

=A0'--with-ns' = 'build_alias=3Di686-apple-darwin'

=A0'host_alias=3Dx8= 6_64-apple-darwin' 'CC=3Dgcc -mmacosx-version-min=3D10.7

=A0-isystem

=A0/Users/david/Xcode-1= 0.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/= SDKs/MacOSX10.7.sdk/usr/include/

=A0-F/Users/david/Xcode= -10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Develope= r/SDKs/MacOSX10.7.sdk/System/Library/Frameworks''


Important settings:

=A0 value of $LANG: en_= US.UTF-8

=A0 locale-coding-syste= m: utf-8-unix

=A0 default enable-mult= ibyte-characters: t


Major mode: Text=

Minor modes in effect:<= /font>

=A0 shell-dir= track-mode: t

=A0 tooltip-mode: t

=A0 mouse-wheel-mode: t=

=A0 tool-bar= -mode: t

=A0 = menu-bar-mode: t

=A0 file-name-shadow-mo= de: t

=A0 glo= bal-font-lock-mode: t

=A0 font-lock-mode: t

=A0 auto-composition-mo= de: t

=A0 aut= o-encryption-mode: t

=A0 auto-compression-mode: t

=A0 buffer-read-only: t=

=A0 line-num= ber-mode: t

= =A0 transient-mark-mode: t


Recent input:

ESC [ ? 1 ; 2 c C-x C-f DEL DE= L / d a n a @ 1 9 2 .

1 6 8 . 1 . 1 0 1 DEL 5= : t DEL / h o m e / d a n a

/ t $ t e s t . t x t RET ESC x r e p o r t TAB RE

T


Recent messages:

Tramp: Opening connection for dana@192.168.1.105 using scpc...done

Tramp: Inserting `/scpc= :dana@192.168.1.105:/home/dana/t$test.txt'...done

File exists, but cannot be read


Tramp: Checking `vc-registered&= #39; for /scpc:dana@192.168.1.105:/home/dana/t$test.txt...done

File exists, but cannot be read


Tramp: Checking `vc-regist= ered' for /scpc:dana@192.168.1.105:/home/dana/t.txt...done

File exists, but cannot= be read

curr= ent-kill: Kill ring is empty


Load-path sh= adows:

None f= ound.

Features:

(shadow sort mail-extr= emacsbug message rfc822 mml easymenu mml-sec

mm-decode mm-bodies mm-encode mail-parse r= fc2231 mailabbrev gmm-utils

mailheader sendmail rfc= 2047 rfc2045 ietf-drums mail-utils tramp-cache

tramp-sh tramp tramp-compat auth-source e= ieio byte-opt bytecomp

byte-compile cconv gnus= -util mm-util mail-prsvr password-cache

tramp-loaddefs shell pcomplete comint ansi-colo= r ring format-spec advice

help-fns cl-lib advice-= preload time-date tooltip ediff-hook vc-hooks

lisp-float-type mwheel ns-win tool-bar dnd= fontset image regexp-opt

fringe tabulated-list n= ewcomment lisp-mode register page menu-bar

rfn-eshadow timer select scroll-bar mouse jit= -lock font-lock syntax

facemenu font-core fram= e cham georgian utf-8-lang misc-lang vietnamese

tibetan thai tai-viet lao korean japanes= e hebrew greek romanian slovak

czech european ethiopic= indian cyrillic chinese case-table epa-hook

jka-cmpr-hook help simple abbrev minibuffer= loaddefs button faces

cus-face macroexp files= text-properties overlay sha1 md5 base64 format

env code-pages mule custom widget hashta= ble-print-readable backquote

make-network-proces= s ns multi-tty emacs)

--001a11337d4a54a91504f6bb8b43-- --001a11337d4a54a91804f6bb8b45 Content-Type: application/octet-stream; name="fix-tramp-dollar-filename.patch" Content-Disposition: attachment; filename="fix-tramp-dollar-filename.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htuw0dzn0 ZGlmZiAtLWdpdCBhL2xpc3AvbmV0L3RyYW1wLXNoLmVsIGIvbGlzcC9uZXQvdHJhbXAtc2guZWwK aW5kZXggMjJlYTc3MS4uY2ExYWY4OCAxMDA2NDQKLS0tIGEvbGlzcC9uZXQvdHJhbXAtc2guZWwK KysrIGIvbGlzcC9uZXQvdHJhbXAtc2guZWwKQEAgLTk1NCw3ICs5NTQsNyBAQCB0YXJnZXQgb2Yg dGhlIHN5bWxpbmsgZGlmZmVyLiIKIAkgICAgKHNldHEgcmVzdWx0CiAJCSAgKHRyYW1wLXNlbmQt Y29tbWFuZC1hbmQtcmVhZAogCQkgICB2Ci0JCSAgIChmb3JtYXQgImVjaG8gXCJcXFwiYCVzIC0t Y2Fub25pY2FsaXplLW1pc3NpbmcgJXNgXFxcIlwiIgorCQkgICAoZm9ybWF0ICJlY2hvIFwiXFxc IiQoJXMgLS1jYW5vbmljYWxpemUtbWlzc2luZyAlcylcXFwiXCIiCiAJCQkgICAodHJhbXAtZ2V0 LXJlbW90ZS1yZWFkbGluayB2KQogCQkJICAgKHRyYW1wLXNoZWxsLXF1b3RlLWFyZ3VtZW50IGxv Y2FsbmFtZSkpKSkpCiAK --001a11337d4a54a91804f6bb8b45--