[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17238: 24.3; TRAMP Can't open remote file with '$' in the filename

From: Dana Pieluszczak
Subject: bug#17238: 24.3; TRAMP Can't open remote file with '$' in the filename
Date: Thu, 10 Apr 2014 23:01:03 -0400


- A linux host which you have ssh access to ( 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 address@hidden 'echo "some content" > /home/dana/t\$test.txt'
# verify there's some content in the file
$ ssh address@hidden 'cat /home/dana/t\$test.txt'
$ emacs -Q -nw
# now we're in emacs
C-x C-f DEL DEL /address@hidden:/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


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




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


Recent messages:

Tramp: Opening connection for address@hidden using scpc...done

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

File exists, but cannot be read

Tramp: Checking `vc-registered' for /scpc:address@hidden:/home/dana/t$test.txt...done

File exists, but cannot be read

Tramp: Checking `vc-registered' for /scpc:address@hidden:/home/dana/t.txt...done

File exists, but cannot be read

current-kill: Kill ring is empty

Load-path shadows:

None found.


(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)

Attachment: fix-tramp-dollar-filename.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]