Tramp cannot access files via sudo
Bug #181399 reported by
Phil Sung
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
emacs-snapshot (Ubuntu) |
Opinion
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: emacs-snapshot
Steps to reproduce:
1. $ emacs -Q
2. C-x C-f /sudo::
What happens: Emacs hangs with the message "Tramp: Found remote shell prompt on `phil.mit.edu'"
What was expected: Emacs opens the file /etc/apt/
To post a comment you must log in.
After setting debug-on-quit, I got a backtrace, printed below (sorry, I had trouble copying the special characters in the line which starts with "byte-code").
I've attached the contents of the Tramp debug buffer with `tramp-verbose' set to 6.
Workaround: everything works if I set `tramp-methods' (net/tramp.el) so that sudo uses "/bin/bash --norc" rather than "/bin/sh". It appears that Tramp is doing things that work in bash but not in dash.
----
Backtrace:
Debugger entered--Lisp error: (quit) process- output( #<process *tramp/sudo <email address hidden>*> 1 nil) handler accept- process- output with-timeout-value] 6) accept- process- output( #<process *tramp/sudo <email address hidden>*> 1) wait-for- regexp( #<process *tramp/sudo <email address hidden>*> nil "^[^$\n] *///c73bab56353 04c1f929c0ec3ee 7e6764 wait-for- output( #<process *tramp/sudo <email address hidden>*>) send-command( ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"] "PROMPT_COMMAND=''; PS1='\n/ //c73bab5635304 c1f929c0ec3ee7e 6764\n' ; PS2=''; PS3=''" t) open-connection -setup- interactive- shell(# <process *tramp/sudo <email address hidden>*> ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"]) maybe-open- connection( ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"]) send-command( ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"] "test 0 2>/dev/null; echo tramp_exit_status $? ") send-command- and-check( ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"] "test 0") get-test- command( ["sudo" "root" "phil.mit.edu" "/etc/apt/ sources. list"]) run-test( "-d" "/sudo:<email address hidden> :/etc/apt/ sources. list") handle- file-directory- p("/sudo: <email address hidden> :/etc/apt/ sources. list") tramp-handle- file-directory- p "/sudo:<email address hidden> :/etc/apt/ sources. list") sh-file- name-handler( file-directory- p "/sudo:<email address hidden> :/etc/apt/ sources. list") tramp-sh- file-name- handler file-directory-p "/sudo:<email address hidden> :/etc/apt/ sources. list") file-name- handler( file-directory- p "/sudo:<email address hidden> :/etc/apt/ sources. list") directory- p("/sudo: <email address hidden> :/etc/apt/ sources. list") file-noselect( "/sudo: :/etc/apt/ sources. list" nil nil t) file("/ sudo::/ etc/apt/ sources. list" t) interactively( find-file)
accept-
byte-code("..." [timeout with-timeout-tag with-timeout-timer with-timeout-timers proc timeout-msecs run-with-timer 1 nil with-timeout-
tramp-
tramp-
?$")
tramp-
tramp-
tramp-
tramp-
tramp-
tramp-
tramp-
tramp-
tramp-
apply(
tramp-
apply(
tramp-
file-
find-
find-
call-