GNU bug report logs - #24478
25.1; Regression in 25.1: .tramp_history files are littered in non-$HOME working directories

Previous Next

Package: emacs;

Reported by: Ævar Arnfjörð Bjarmason <avar <at> booking.com>

Date: Tue, 20 Sep 2016 15:27:01 UTC

Severity: normal

Tags: patch

Found in version 25.1

Fixed in version 25.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24478 in the body.
You can then email your comments to 24478 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Tue, 20 Sep 2016 15:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ævar Arnfjörð Bjarmason <avar <at> booking.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 20 Sep 2016 15:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avar <at> booking.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Subject: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Tue, 20 Sep 2016 12:21:14 +0200
There's a regression in 25.1 introduced by 1e04ea9 (although that seems
to also have fixed an issue): Now tramp-histfile-override is set to
".tramp_history", which is good, but I would expect it to be created in
$HOME on remote hosts.

Instead when I e.g.:

 1. C-x C-f //ssh:<hostname>:/usr/local/git_tree/sysadmin/
 2. Run e.g. magit to make a commit
 3. I end up with:

    $ echo $PWD/.tramp_history
    /usr/local/git_tree/sysadmin/.tramp_history
    $ wc -l !$
    wc -l $PWD/.tramp_history
    34 /usr/local/git_tree/sysadmin/.tramp_history

From reading https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 and
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731#56 this seems like
an unintended bug.

Just setting:

    (setq tramp-histfile-override "~/.tramp_history")

Works for me. Now it's always created in ~.

In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
 of 2016-09-18 built on snth
Repository revision: a0d50eb64bf0a469fd010a3f6133276eb1511ec9 (a revert of a761fbf262b6898036a537a36476da7767c0daca on top of emacs-25.1, for an unrelated bug...)
System Description:	Debian GNU/Linux 8.5 (jessie)

Configured using:
 'configure --prefix=/home/avar/local --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8

Major mode: CPerl

Minor modes in effect:
  flyspell-mode: t
  global-edit-server-edit-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  which-function-mode: t
  icomplete-mode: t
  show-paren-mode: t
  global-eldoc-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Checking spelling of PREPERATION...
Saving file /ssh:pc101eventlog-04:/usr/local/git_tree/sysadmin/.git/COMMIT_EDITMSG...
Tramp: Encoding local file ‘/tmp/tramp.4026djU’ using ‘base64-encode-region’...done
Tramp: Decoding remote file ‘/ssh:pc101eventlog-04:/usr/local/git_tree/sysadmin/.git/COMMIT_EDITMSG’ using ‘base64 -d -i >%s’...done
Wrote /ssh:pc101eventlog-04:/usr/local/git_tree/sysadmin/.git/COMMIT_EDITMSG
Git finished [2 times]
Quit [2 times]
occur-find-match: No more matches
Quit
occur-find-match: No more matches
Quit

Load-path shadows:
/home/avar/g/elisp/magit/lisp/git-commit hides /home/avar/g/elisp/git-commit-mode/git-commit
/home/avar/g/elisp/nopaste/nopaste hides /home/avar/g/elisp/_local/nopaste
/home/avar/g/elisp/go-mode.el/go-mode hides /home/avar/g/elisp/go-mode
/home/avar/g/elisp/mu/mu4e/mu4e-contrib hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-contrib
/home/avar/g/elisp/mu/mu4e/mu4e-mark hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-mark
/home/avar/g/elisp/mu/mu4e/mu4e-context hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-context
/home/avar/g/elisp/mu/mu4e/org-old-mu4e hides /home/avar/local/share/emacs/site-lisp/mu4e/org-old-mu4e
/home/avar/g/elisp/mu/mu4e/mu4e hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e
/home/avar/g/elisp/mu/mu4e/mu4e-view hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-view
/home/avar/g/elisp/mu/mu4e/mu4e-compose hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-compose
/home/avar/g/elisp/mu/mu4e/mu4e-main hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-main
/home/avar/g/elisp/mu/mu4e/mu4e-proc hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-proc
/home/avar/g/elisp/mu/mu4e/mu4e-headers hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-headers
/home/avar/g/elisp/mu/mu4e/mu4e-message hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-message
/home/avar/g/elisp/mu/mu4e/mu4e-utils hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-utils
/home/avar/g/elisp/mu/mu4e/mu4e-vars hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-vars
/home/avar/g/elisp/mu/mu4e/org-mu4e hides /home/avar/local/share/emacs/site-lisp/mu4e/org-mu4e
/home/avar/g/elisp/mu/mu4e/mu4e-speedbar hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-speedbar
/home/avar/g/elisp/mu/mu4e/mu4e-draft hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-draft
/home/avar/g/elisp/mu/mu4e/mu4e-meta hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-meta
/home/avar/g/elisp/mu/mu4e/mu4e-actions hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-actions
/home/avar/g/elisp/mu/mu4e/mu4e-lists hides /home/avar/local/share/emacs/site-lisp/mu4e/mu4e-lists
/home/avar/g/elisp/shellarchive/find-cmd hides /home/avar/local/share/emacs/25.1/lisp/find-cmd
/home/avar/g/elisp/css-mode hides /home/avar/local/share/emacs/25.1/lisp/textmodes/css-mode
/home/avar/g/elisp/cperl-mode/cperl-mode hides /home/avar/local/share/emacs/25.1/lisp/progmodes/cperl-mode
/home/avar/g/elisp/org-mode/lisp/org-id hides /home/avar/local/share/emacs/25.1/lisp/org/org-id
/home/avar/g/elisp/org-mode/lisp/ob-css hides /home/avar/local/share/emacs/25.1/lisp/org/ob-css
/home/avar/g/elisp/org-mode/lisp/org-src hides /home/avar/local/share/emacs/25.1/lisp/org/org-src
/home/avar/g/elisp/org-mode/lisp/ob-keys hides /home/avar/local/share/emacs/25.1/lisp/org/ob-keys
/home/avar/g/elisp/org-mode/lisp/ox hides /home/avar/local/share/emacs/25.1/lisp/org/ox
/home/avar/g/elisp/org-mode/lisp/org-archive hides /home/avar/local/share/emacs/25.1/lisp/org/org-archive
/home/avar/g/elisp/org-mode/lisp/org-timer hides /home/avar/local/share/emacs/25.1/lisp/org/org-timer
/home/avar/g/elisp/org-mode/lisp/org-table hides /home/avar/local/share/emacs/25.1/lisp/org/org-table
/home/avar/g/elisp/org-mode/lisp/ob-org hides /home/avar/local/share/emacs/25.1/lisp/org/ob-org
/home/avar/g/elisp/org-mode/lisp/ob-ledger hides /home/avar/local/share/emacs/25.1/lisp/org/ob-ledger
/home/avar/g/elisp/org-mode/lisp/org-w3m hides /home/avar/local/share/emacs/25.1/lisp/org/org-w3m
/home/avar/g/elisp/org-mode/lisp/org-element hides /home/avar/local/share/emacs/25.1/lisp/org/org-element
/home/avar/g/elisp/org-mode/lisp/org-feed hides /home/avar/local/share/emacs/25.1/lisp/org/org-feed
/home/avar/g/elisp/org-mode/lisp/ob-calc hides /home/avar/local/share/emacs/25.1/lisp/org/ob-calc
/home/avar/g/elisp/org-mode/lisp/org-mhe hides /home/avar/local/share/emacs/25.1/lisp/org/org-mhe
/home/avar/g/elisp/org-mode/lisp/org-inlinetask hides /home/avar/local/share/emacs/25.1/lisp/org/org-inlinetask
/home/avar/g/elisp/org-mode/lisp/ob-C hides /home/avar/local/share/emacs/25.1/lisp/org/ob-C
/home/avar/g/elisp/org-mode/lisp/org-agenda hides /home/avar/local/share/emacs/25.1/lisp/org/org-agenda
/home/avar/g/elisp/org-mode/lisp/ob-eval hides /home/avar/local/share/emacs/25.1/lisp/org/ob-eval
/home/avar/g/elisp/org-mode/lisp/ox-publish hides /home/avar/local/share/emacs/25.1/lisp/org/ox-publish
/home/avar/g/elisp/org-mode/lisp/ob-fortran hides /home/avar/local/share/emacs/25.1/lisp/org/ob-fortran
/home/avar/g/elisp/org-mode/lisp/ob-ocaml hides /home/avar/local/share/emacs/25.1/lisp/org/ob-ocaml
/home/avar/g/elisp/org-mode/lisp/ox-beamer hides /home/avar/local/share/emacs/25.1/lisp/org/ox-beamer
/home/avar/g/elisp/org-mode/lisp/org hides /home/avar/local/share/emacs/25.1/lisp/org/org
/home/avar/g/elisp/org-mode/lisp/ob-R hides /home/avar/local/share/emacs/25.1/lisp/org/ob-R
/home/avar/g/elisp/org-mode/lisp/ob-screen hides /home/avar/local/share/emacs/25.1/lisp/org/ob-screen
/home/avar/g/elisp/org-mode/lisp/org-protocol hides /home/avar/local/share/emacs/25.1/lisp/org/org-protocol
/home/avar/g/elisp/org-mode/lisp/ob-awk hides /home/avar/local/share/emacs/25.1/lisp/org/ob-awk
/home/avar/g/elisp/org-mode/lisp/ox-md hides /home/avar/local/share/emacs/25.1/lisp/org/ox-md
/home/avar/g/elisp/org-mode/lisp/ob-core hides /home/avar/local/share/emacs/25.1/lisp/org/ob-core
/home/avar/g/elisp/org-mode/lisp/ox-org hides /home/avar/local/share/emacs/25.1/lisp/org/ox-org
/home/avar/g/elisp/org-mode/lisp/ob-js hides /home/avar/local/share/emacs/25.1/lisp/org/ob-js
/home/avar/g/elisp/org-mode/lisp/ox-icalendar hides /home/avar/local/share/emacs/25.1/lisp/org/ox-icalendar
/home/avar/g/elisp/org-mode/lisp/ob-emacs-lisp hides /home/avar/local/share/emacs/25.1/lisp/org/ob-emacs-lisp
/home/avar/g/elisp/org-mode/lisp/org-ctags hides /home/avar/local/share/emacs/25.1/lisp/org/org-ctags
/home/avar/g/elisp/org-mode/lisp/ob-sql hides /home/avar/local/share/emacs/25.1/lisp/org/ob-sql
/home/avar/g/elisp/org-mode/lisp/org-version hides /home/avar/local/share/emacs/25.1/lisp/org/org-version
/home/avar/g/elisp/org-mode/lisp/org-compat hides /home/avar/local/share/emacs/25.1/lisp/org/org-compat
/home/avar/g/elisp/org-mode/lisp/ob hides /home/avar/local/share/emacs/25.1/lisp/org/ob
/home/avar/g/elisp/org-mode/lisp/org-footnote hides /home/avar/local/share/emacs/25.1/lisp/org/org-footnote
/home/avar/g/elisp/org-mode/lisp/ob-io hides /home/avar/local/share/emacs/25.1/lisp/org/ob-io
/home/avar/g/elisp/org-mode/lisp/org-pcomplete hides /home/avar/local/share/emacs/25.1/lisp/org/org-pcomplete
/home/avar/g/elisp/org-mode/lisp/org-faces hides /home/avar/local/share/emacs/25.1/lisp/org/org-faces
/home/avar/g/elisp/org-mode/lisp/org-plot hides /home/avar/local/share/emacs/25.1/lisp/org/org-plot
/home/avar/g/elisp/org-mode/lisp/ob-maxima hides /home/avar/local/share/emacs/25.1/lisp/org/ob-maxima
/home/avar/g/elisp/org-mode/lisp/ox-latex hides /home/avar/local/share/emacs/25.1/lisp/org/ox-latex
/home/avar/g/elisp/org-mode/lisp/org-macro hides /home/avar/local/share/emacs/25.1/lisp/org/org-macro
/home/avar/g/elisp/org-mode/lisp/ob-python hides /home/avar/local/share/emacs/25.1/lisp/org/ob-python
/home/avar/g/elisp/org-mode/lisp/org-mouse hides /home/avar/local/share/emacs/25.1/lisp/org/org-mouse
/home/avar/g/elisp/org-mode/lisp/ob-gnuplot hides /home/avar/local/share/emacs/25.1/lisp/org/ob-gnuplot
/home/avar/g/elisp/org-mode/lisp/ob-exp hides /home/avar/local/share/emacs/25.1/lisp/org/ob-exp
/home/avar/g/elisp/org-mode/lisp/ox-html hides /home/avar/local/share/emacs/25.1/lisp/org/ox-html
/home/avar/g/elisp/org-mode/lisp/ob-ref hides /home/avar/local/share/emacs/25.1/lisp/org/ob-ref
/home/avar/g/elisp/org-mode/lisp/ob-lob hides /home/avar/local/share/emacs/25.1/lisp/org/ob-lob
/home/avar/g/elisp/org-mode/lisp/org-docview hides /home/avar/local/share/emacs/25.1/lisp/org/org-docview
/home/avar/g/elisp/org-mode/lisp/ob-table hides /home/avar/local/share/emacs/25.1/lisp/org/ob-table
/home/avar/g/elisp/org-mode/lisp/ob-dot hides /home/avar/local/share/emacs/25.1/lisp/org/ob-dot
/home/avar/g/elisp/org-mode/lisp/ox-texinfo hides /home/avar/local/share/emacs/25.1/lisp/org/ox-texinfo
/home/avar/g/elisp/org-mode/lisp/org-eshell hides /home/avar/local/share/emacs/25.1/lisp/org/org-eshell
/home/avar/g/elisp/org-mode/lisp/ob-ruby hides /home/avar/local/share/emacs/25.1/lisp/org/ob-ruby
/home/avar/g/elisp/org-mode/lisp/org-bibtex hides /home/avar/local/share/emacs/25.1/lisp/org/org-bibtex
/home/avar/g/elisp/org-mode/lisp/ob-scala hides /home/avar/local/share/emacs/25.1/lisp/org/ob-scala
/home/avar/g/elisp/org-mode/lisp/ob-octave hides /home/avar/local/share/emacs/25.1/lisp/org/ob-octave
/home/avar/g/elisp/org-mode/lisp/ob-java hides /home/avar/local/share/emacs/25.1/lisp/org/ob-java
/home/avar/g/elisp/org-mode/lisp/ob-clojure hides /home/avar/local/share/emacs/25.1/lisp/org/ob-clojure
/home/avar/g/elisp/org-mode/lisp/ob-sass hides /home/avar/local/share/emacs/25.1/lisp/org/ob-sass
/home/avar/g/elisp/org-mode/lisp/org-rmail hides /home/avar/local/share/emacs/25.1/lisp/org/org-rmail
/home/avar/g/elisp/org-mode/lisp/org-irc hides /home/avar/local/share/emacs/25.1/lisp/org/org-irc
/home/avar/g/elisp/org-mode/lisp/org-crypt hides /home/avar/local/share/emacs/25.1/lisp/org/org-crypt
/home/avar/g/elisp/org-mode/lisp/ob-lisp hides /home/avar/local/share/emacs/25.1/lisp/org/ob-lisp
/home/avar/g/elisp/org-mode/lisp/ob-scheme hides /home/avar/local/share/emacs/25.1/lisp/org/ob-scheme
/home/avar/g/elisp/org-mode/lisp/ox-odt hides /home/avar/local/share/emacs/25.1/lisp/org/ox-odt
/home/avar/g/elisp/org-mode/lisp/ob-mscgen hides /home/avar/local/share/emacs/25.1/lisp/org/ob-mscgen
/home/avar/g/elisp/org-mode/lisp/ob-lilypond hides /home/avar/local/share/emacs/25.1/lisp/org/ob-lilypond
/home/avar/g/elisp/org-mode/lisp/org-gnus hides /home/avar/local/share/emacs/25.1/lisp/org/org-gnus
/home/avar/g/elisp/org-mode/lisp/org-indent hides /home/avar/local/share/emacs/25.1/lisp/org/org-indent
/home/avar/g/elisp/org-mode/lisp/ob-ditaa hides /home/avar/local/share/emacs/25.1/lisp/org/ob-ditaa
/home/avar/g/elisp/org-mode/lisp/ox-man hides /home/avar/local/share/emacs/25.1/lisp/org/ox-man
/home/avar/g/elisp/org-mode/lisp/ob-comint hides /home/avar/local/share/emacs/25.1/lisp/org/ob-comint
/home/avar/g/elisp/org-mode/lisp/org-info hides /home/avar/local/share/emacs/25.1/lisp/org/org-info
/home/avar/g/elisp/org-mode/lisp/org-attach hides /home/avar/local/share/emacs/25.1/lisp/org/org-attach
/home/avar/g/elisp/org-mode/lisp/ob-picolisp hides /home/avar/local/share/emacs/25.1/lisp/org/ob-picolisp
/home/avar/g/elisp/org-mode/lisp/ob-latex hides /home/avar/local/share/emacs/25.1/lisp/org/ob-latex
/home/avar/g/elisp/org-mode/lisp/org-capture hides /home/avar/local/share/emacs/25.1/lisp/org/org-capture
/home/avar/g/elisp/org-mode/lisp/org-entities hides /home/avar/local/share/emacs/25.1/lisp/org/org-entities
/home/avar/g/elisp/org-mode/lisp/org-loaddefs hides /home/avar/local/share/emacs/25.1/lisp/org/org-loaddefs
/home/avar/g/elisp/org-mode/lisp/ob-sqlite hides /home/avar/local/share/emacs/25.1/lisp/org/ob-sqlite
/home/avar/g/elisp/org-mode/lisp/ob-shen hides /home/avar/local/share/emacs/25.1/lisp/org/ob-shen
/home/avar/g/elisp/org-mode/lisp/ob-matlab hides /home/avar/local/share/emacs/25.1/lisp/org/ob-matlab
/home/avar/g/elisp/org-mode/lisp/org-bbdb hides /home/avar/local/share/emacs/25.1/lisp/org/org-bbdb
/home/avar/g/elisp/org-mode/lisp/ox-ascii hides /home/avar/local/share/emacs/25.1/lisp/org/ox-ascii
/home/avar/g/elisp/org-mode/lisp/org-datetree hides /home/avar/local/share/emacs/25.1/lisp/org/org-datetree
/home/avar/g/elisp/org-mode/lisp/ob-perl hides /home/avar/local/share/emacs/25.1/lisp/org/ob-perl
/home/avar/g/elisp/org-mode/lisp/org-macs hides /home/avar/local/share/emacs/25.1/lisp/org/org-macs
/home/avar/g/elisp/org-mode/lisp/org-mobile hides /home/avar/local/share/emacs/25.1/lisp/org/org-mobile
/home/avar/g/elisp/org-mode/lisp/org-colview hides /home/avar/local/share/emacs/25.1/lisp/org/org-colview
/home/avar/g/elisp/org-mode/lisp/org-list hides /home/avar/local/share/emacs/25.1/lisp/org/org-list
/home/avar/g/elisp/org-mode/lisp/org-habit hides /home/avar/local/share/emacs/25.1/lisp/org/org-habit
/home/avar/g/elisp/org-mode/lisp/ob-plantuml hides /home/avar/local/share/emacs/25.1/lisp/org/ob-plantuml
/home/avar/g/elisp/org-mode/lisp/ob-makefile hides /home/avar/local/share/emacs/25.1/lisp/org/ob-makefile
/home/avar/g/elisp/org-mode/lisp/ob-asymptote hides /home/avar/local/share/emacs/25.1/lisp/org/ob-asymptote
/home/avar/g/elisp/org-mode/lisp/ob-haskell hides /home/avar/local/share/emacs/25.1/lisp/org/ob-haskell
/home/avar/g/elisp/org-mode/lisp/org-clock hides /home/avar/local/share/emacs/25.1/lisp/org/org-clock
/home/avar/g/elisp/org-mode/lisp/org-install hides /home/avar/local/share/emacs/25.1/lisp/org/org-install
/home/avar/g/elisp/org-mode/lisp/ob-tangle hides /home/avar/local/share/emacs/25.1/lisp/org/ob-tangle

Features:
(shadow face-remap emacsbug dabbrev cperl-mode man linum sh-script
executable pp misearch multi-isearch vc-git term/xterm xterm flyspell
ispell edit-server puppet-mode git-rebase magit-extras magit-ediff
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init
ediff-util ediff magit-subtree magit-submodule magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit dired-x
package magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode
magit-core magit-autorevert autorevert filenotify magit-process
magit-popup magit-mode magit-git crm magit-section magit-utils yaml-mode
xs-mode nopaste browse-kill-ring prove ack grep info perl6-mode
perl6-indent smie perl6-font-lock perl6-detect twittering-mode tls
gnutls url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap xml remember org-clock org-agenda
org-present org-element avl-tree org org-macro org-footnote
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint
ob-core ob-eval org-compat org-macs org-loaddefs find-func undo-tree
diff mu4e desktop frameset mu4e-speedbar mu4e-main mu4e-context
mu4e-view cal-menu calendar cal-loaddefs epa browse-url mu4e-headers
mu4e-compose mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark
mu4e-message html2text mu4e-proc mu4e-utils doc-view subr-x jka-compr
image-mode mu4e-lists mu4e-vars hl-line mu4e-meta go-mode-autoloads
markdown-mode url-parse url-vars noutline outline ibuffer-git ibuf-macs
ibuffer php-mode etags xref project cc-langs cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs speedbar
sb-image ezimage dframe pir-mode lua-mode compile po-mode gitignore-mode
gitconfig-mode derived conf-mode rx git-commit with-editor warnings term
ehelp esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups
eshell esh-module esh-mode esh-util server log-edit easy-mmode message
dired rfc822 mml mml-sec epg epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log dash pod-mode cl tap-mode perlmod
perldoc thingatpt saveplace edmacro kmacro tramp-cache tramp-sh tramp
tramp-compat auth-source cl-seq eieio eieio-core cl-macs gnus-util
mm-util help-fns mail-prsvr password-cache tramp-loaddefs trampver
ucs-normalize shell pcomplete comint ansi-color ring format-spec advice
recentf tree-widget wid-edit which-func imenu icomplete ido seq byte-opt
gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs
pcase cl-lib time-date paren disp-table mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 1070463 61868)
 (symbols 48 48706 0)
 (miscs 40 2471 2039)
 (strings 32 165751 19691)
 (string-bytes 1 6864776)
 (vectors 16 60604)
 (vector-slots 8 1059692 20226)
 (floats 8 572 876)
 (intervals 56 35874 241)
 (buffers 976 39)
 (heap 1024 60160 5537))




Added indication that bug 24478 blocks21966 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 21 Sep 2016 16:00:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Thu, 22 Sep 2016 18:04:01 GMT) Full text and rfc822 format available.

Message #10 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avar <at> booking.com>
Cc: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>,
 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Thu, 22 Sep 2016 20:02:59 +0200
Ævar Arnfjörð Bjarmason <avar <at> booking.com> writes:

Hi,

> There's a regression in 25.1 introduced by 1e04ea9 (although that seems
> to also have fixed an issue): Now tramp-histfile-override is set to
> ".tramp_history", which is good, but I would expect it to be created in
> $HOME on remote hosts.
>
> Instead when I e.g.:
>
>  1. C-x C-f //ssh:<hostname>:/usr/local/git_tree/sysadmin/
>  2. Run e.g. magit to make a commit
>  3. I end up with:
>
>     $ echo $PWD/.tramp_history
>     /usr/local/git_tree/sysadmin/.tramp_history
>     $ wc -l !$
>     wc -l $PWD/.tramp_history
>     34 /usr/local/git_tree/sysadmin/.tramp_history

Most of the shells I know off use the home directory, when you specify
just the relative file name ".tramp_history".

> From reading https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 and
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731#56 this seems like
> an unintended bug.
>
> Just setting:
>
>     (setq tramp-histfile-override "~/.tramp_history")
>
> Works for me. Now it's always created in ~.

I have thought about this, when I was fixing bug#19731. Unfortunately,
there exist shells which cannot expand "~/". Other shells cannot expand
"$HOME/". So I really don't know a robust default we could offer.

Maybe one should give this problem more emphasis in the Tramp
manual. But who reads manuals?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Mon, 10 Oct 2016 10:39:02 GMT) Full text and rfc822 format available.

Message #13 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 24478 <at> debbugs.gnu.org, avarab <at> gmail.com, avar <at> booking.com
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Mon, 10 Oct 2016 13:38:08 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Date: Thu, 22 Sep 2016 20:02:59 +0200
> Cc: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>,
>  24478 <at> debbugs.gnu.org
> 
> Ævar Arnfjörð Bjarmason <avar <at> booking.com> writes:
> 
> Hi,
> 
> > There's a regression in 25.1 introduced by 1e04ea9 (although that seems
> > to also have fixed an issue): Now tramp-histfile-override is set to
> > ".tramp_history", which is good, but I would expect it to be created in
> > $HOME on remote hosts.
> >
> > Instead when I e.g.:
> >
> >  1. C-x C-f //ssh:<hostname>:/usr/local/git_tree/sysadmin/
> >  2. Run e.g. magit to make a commit
> >  3. I end up with:
> >
> >     $ echo $PWD/.tramp_history
> >     /usr/local/git_tree/sysadmin/.tramp_history
> >     $ wc -l !$
> >     wc -l $PWD/.tramp_history
> >     34 /usr/local/git_tree/sysadmin/.tramp_history
> 
> Most of the shells I know off use the home directory, when you specify
> just the relative file name ".tramp_history".
> 
> > From reading https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 and
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731#56 this seems like
> > an unintended bug.
> >
> > Just setting:
> >
> >     (setq tramp-histfile-override "~/.tramp_history")
> >
> > Works for me. Now it's always created in ~.
> 
> I have thought about this, when I was fixing bug#19731. Unfortunately,
> there exist shells which cannot expand "~/". Other shells cannot expand
> "$HOME/". So I really don't know a robust default we could offer.
> 
> Maybe one should give this problem more emphasis in the Tramp
> manual. But who reads manuals?

Michael, does the above mean this bug should be closed as wontfix?  It
currently blocks a release, so I'd like to resolve this some way soon.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Mon, 10 Oct 2016 11:16:02 GMT) Full text and rfc822 format available.

Message #16 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24478 <at> debbugs.gnu.org, Ted Zlatanov <tzz <at> lifelogs.com>,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#24478: 25.1; Regression in 25.1: .tramp_history files are
 littered in non-$HOME working directories
Date: Mon, 10 Oct 2016 13:14:57 +0200
On Mon, Oct 10, 2016 at 12:38 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Michael Albinus <michael.albinus <at> gmx.de>
>> Date: Thu, 22 Sep 2016 20:02:59 +0200
>> Cc: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>,
>>  24478 <at> debbugs.gnu.org
>>
>> Ævar Arnfjörð Bjarmason <avar <at> booking.com> writes:
>>
>> Hi,
>>
>> > There's a regression in 25.1 introduced by 1e04ea9 (although that seems
>> > to also have fixed an issue): Now tramp-histfile-override is set to
>> > ".tramp_history", which is good, but I would expect it to be created in
>> > $HOME on remote hosts.
>> >
>> > Instead when I e.g.:
>> >
>> >  1. C-x C-f //ssh:<hostname>:/usr/local/git_tree/sysadmin/
>> >  2. Run e.g. magit to make a commit
>> >  3. I end up with:
>> >
>> >     $ echo $PWD/.tramp_history
>> >     /usr/local/git_tree/sysadmin/.tramp_history
>> >     $ wc -l !$
>> >     wc -l $PWD/.tramp_history
>> >     34 /usr/local/git_tree/sysadmin/.tramp_history
>>
>> Most of the shells I know off use the home directory, when you specify
>> just the relative file name ".tramp_history".
>>
>> > From reading https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 and
>> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731#56 this seems like
>> > an unintended bug.
>> >
>> > Just setting:
>> >
>> >     (setq tramp-histfile-override "~/.tramp_history")
>> >
>> > Works for me. Now it's always created in ~.
>>
>> I have thought about this, when I was fixing bug#19731. Unfortunately,
>> there exist shells which cannot expand "~/". Other shells cannot expand
>> "$HOME/". So I really don't know a robust default we could offer.
>>
>> Maybe one should give this problem more emphasis in the Tramp
>> manual. But who reads manuals?
>
> Michael, does the above mean this bug should be closed as wontfix?  It
> currently blocks a release, so I'd like to resolve this some way soon.

I'm the reporter, so I obviously have a dog in this fight, but I don't
think that makes sense. This whole facility introduced in the emacs-25
series still seems really broken since its introduction, and the
various regressions reported have just resulted in other regressions
taking their place, the latest one being discussed in this ticket.

Here's a Git history showing the back & forth this has gone through:

    git log --reverse -p -Gtramp-histfile-override -- 'lisp/net/*tramp*.el'

I might have read those commits incorrectly, but it seems to me that:

 * In emacs-24 there was no way to have a Tramp history file, we'd
just specify a HISTFILE=/dev/null environment variable.

 * 9be1538 added an option to change that, so you could have a history
file as a file, defaulting to /dev/null, but they way it was
implemented caused it to unlink /dev/null, as reported in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731

 * So Michael patched it to make 'unset an option, which was
implemented in 6f8372d, as far as I can tell at this point the
facility worked the way it did in emacs-24 again. I.e. no history by
default, but no regression with unlinking /dev/null

 * 'unset was made the default by Michael in 954ca0f, but just a few
hours later this was set to t instead in c10828b, which does the same
thing as 'unset according to the commit message. I.e. just an internal
refactoring. This was followed-up by 24fa4ff to refactor it some more.

* It was then changed from t to ".tramp_history" in 1e04ea9. The
commit message says to fix
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 but I don't see
how it could eat the bash history if it's set to not have any history
file by default.

* Now because it's ".tramp_history" and not "~/.tramp_history" it gets
created in random non-~ directories you open with tramp, but more
importantly, and I didn't realize this in my initial report, the shell
history *might be shared between multiple users*, which seems like a
bad security issue.

It seems to me that the best solution to this whole problem is to set
it to "t" again which would return to the non-history days of
emacs-24, since apparently using ~ can't be counted on.

In addition, depending on the bug with history potentially being
shared between users now that it's being dumped in random potentially
shared FS directories they open with tramp, changing this to
".tramp_history" might have caused a security issue worth of a CVE,
but I haven't investigated that, but we *certainly* went from no
history by default in emacs-24 to history littered in potentially
world readable directories in emacs-25.

The permissions on the file itself might have mitigated data leakage
in some cases, but in those cases it would have blocked other Emacs
users from recording their shell history. In addition not all remote
FSs tramp supports working with can be relied upon to obey HISTFILE
permissions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Tue, 11 Oct 2016 13:55:02 GMT) Full text and rfc822 format available.

Message #19 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Tue, 11 Oct 2016 15:54:36 +0200
Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:

Hi Ævar,

> I'm the reporter, so I obviously have a dog in this fight, but I don't
> think that makes sense. This whole facility introduced in the emacs-25
> series still seems really broken since its introduction, and the
> various regressions reported have just resulted in other regressions
> taking their place, the latest one being discussed in this ticket.

I'm also unhappy about this story. I really would like to use a proper
and robust default value for this. But there isn't one so far.

>  * In emacs-24 there was no way to have a Tramp history file, we'd
> just specify a HISTFILE=/dev/null environment variable.

This was introduced back in 2014. Before this change, HISFILE was unset
somewhere else in the initialization hand-shake, but at a later
point. It didn't work properly then.

>  * 9be1538 added an option to change that, so you could have a history
> file as a file, defaulting to /dev/null, but they way it was
> implemented caused it to unlink /dev/null, as reported in
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731

Bug#19371 has reported, that there is a bash bug
<https://bbs.archlinux.org/viewtopic.php?pid=1397412#p1397412> which has
this effect. It is no Tramp error, and I would regard this setting still
be the best one if possible. But due to this bash bug, this setting
would damage the remote system. So we cannot use "/dev/null" as default,
even if the bash bug has been fixed. There will still be system in the
wild with this bug.

>  * So Michael patched it to make 'unset an option, which was
> implemented in 6f8372d, as far as I can tell at this point the
> facility worked the way it did in emacs-24 again. I.e. no history by
> default, but no regression with unlinking /dev/null
>
>  * 'unset was made the default by Michael in 954ca0f, but just a few
> hours later this was set to t instead in c10828b, which does the same
> thing as 'unset according to the commit message. I.e. just an internal
> refactoring. This was followed-up by 24fa4ff to refactor it some more.

Yes.

> * It was then changed from t to ".tramp_history" in 1e04ea9. The
> commit message says to fix
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 but I don't see
> how it could eat the bash history if it's set to not have any history
> file by default.

Glenn did report, that in his use case unsetting HISTFILE has changed
his ~/.bash_history to a zero size. Not acceptable, and again a special
behaviour of bash :-(

So the only solution I could thing about is setting this variable to a
Tramp specific value.

> * Now because it's ".tramp_history" and not "~/.tramp_history" it gets
> created in random non-~ directories you open with tramp, but more
> importantly, and I didn't realize this in my initial report, the shell
> history *might be shared between multiple users*, which seems like a
> bad security issue.

"~/.tramp_history" would be the obvious choice, but "~/" is not
guaranteed to exist. An example is hydra, were the tests failed with
this setting.

> It seems to me that the best solution to this whole problem is to set
> it to "t" again which would return to the non-history days of
> emacs-24, since apparently using ~ can't be counted on.

How do you want explain it to bash users like Glenn? Their history file
will get lost, again.

> In addition, depending on the bug with history potentially being
> shared between users now that it's being dumped in random potentially
> shared FS directories they open with tramp, changing this to
> ".tramp_history" might have caused a security issue worth of a CVE,
> but I haven't investigated that, but we *certainly* went from no
> history by default in emacs-24 to history littered in potentially
> world readable directories in emacs-25.

I still don't understand why the ".tramp_history" file is spread over
the file system. This setting is apllied immediately after connecting to
the remote host. I would assume that one lands in the home directory
there; ".tramp_history" should be expanded relatively to that directory.

Could you show hot it happens to you that it is expanded to another
place? Pls run Tramp from scratch, after increasing the debug level by

(setq tramp-verbose 6)

There will be a Tramp debug buffer, which might tell us what happens.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Tue, 11 Oct 2016 14:36:01 GMT) Full text and rfc822 format available.

Message #22 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1; Regression in 25.1: .tramp_history files are
 littered in non-$HOME working directories
Date: Tue, 11 Oct 2016 16:34:31 +0200
On Tue, Oct 11, 2016 at 3:54 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:
>
> Hi Ævar,
>
>> I'm the reporter, so I obviously have a dog in this fight, but I don't
>> think that makes sense. This whole facility introduced in the emacs-25
>> series still seems really broken since its introduction, and the
>> various regressions reported have just resulted in other regressions
>> taking their place, the latest one being discussed in this ticket.
>
> I'm also unhappy about this story. I really would like to use a proper
> and robust default value for this. But there isn't one so far.
>
>>  * In emacs-24 there was no way to have a Tramp history file, we'd
>> just specify a HISTFILE=/dev/null environment variable.
>
> This was introduced back in 2014. Before this change, HISFILE was unset
> somewhere else in the initialization hand-shake, but at a later
> point. It didn't work properly then.
>
>>  * 9be1538 added an option to change that, so you could have a history
>> file as a file, defaulting to /dev/null, but they way it was
>> implemented caused it to unlink /dev/null, as reported in
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19731
>
> Bug#19371 has reported, that there is a bash bug
> <https://bbs.archlinux.org/viewtopic.php?pid=1397412#p1397412> which has
> this effect. It is no Tramp error, and I would regard this setting still
> be the best one if possible. But due to this bash bug, this setting
> would damage the remote system. So we cannot use "/dev/null" as default,
> even if the bash bug has been fixed. There will still be system in the
> wild with this bug.
>
>>  * So Michael patched it to make 'unset an option, which was
>> implemented in 6f8372d, as far as I can tell at this point the
>> facility worked the way it did in emacs-24 again. I.e. no history by
>> default, but no regression with unlinking /dev/null
>>
>>  * 'unset was made the default by Michael in 954ca0f, but just a few
>> hours later this was set to t instead in c10828b, which does the same
>> thing as 'unset according to the commit message. I.e. just an internal
>> refactoring. This was followed-up by 24fa4ff to refactor it some more.
>
> Yes.
>
>> * It was then changed from t to ".tramp_history" in 1e04ea9. The
>> commit message says to fix
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20446 but I don't see
>> how it could eat the bash history if it's set to not have any history
>> file by default.
>
> Glenn did report, that in his use case unsetting HISTFILE has changed
> his ~/.bash_history to a zero size. Not acceptable, and again a special
> behaviour of bash :-(
>
> So the only solution I could thing about is setting this variable to a
> Tramp specific value.
>
>> * Now because it's ".tramp_history" and not "~/.tramp_history" it gets
>> created in random non-~ directories you open with tramp, but more
>> importantly, and I didn't realize this in my initial report, the shell
>> history *might be shared between multiple users*, which seems like a
>> bad security issue.
>
> "~/.tramp_history" would be the obvious choice, but "~/" is not
> guaranteed to exist. An example is hydra, were the tests failed with
> this setting.
>
>> It seems to me that the best solution to this whole problem is to set
>> it to "t" again which would return to the non-history days of
>> emacs-24, since apparently using ~ can't be counted on.
>
> How do you want explain it to bash users like Glenn? Their history file
> will get lost, again.

Thanks for all the follow-up details. I mainly included all of that to
get all this straight in my head, but I was apparently wrong about it
being viable to revert to the old behavior vis-a-vis unlinking
/dev/null on those old systems.

>> In addition, depending on the bug with history potentially being
>> shared between users now that it's being dumped in random potentially
>> shared FS directories they open with tramp, changing this to
>> ".tramp_history" might have caused a security issue worth of a CVE,
>> but I haven't investigated that, but we *certainly* went from no
>> history by default in emacs-24 to history littered in potentially
>> world readable directories in emacs-25.
>
> I still don't understand why the ".tramp_history" file is spread over
> the file system. This setting is apllied immediately after connecting to
> the remote host. I would assume that one lands in the home directory
> there; ".tramp_history" should be expanded relatively to that directory.
>
> Could you show hot it happens to you that it is expanded to another
> place? Pls run Tramp from scratch, after increasing the debug level by
>
> (setq tramp-verbose 6)
>
> There will be a Tramp debug buffer, which might tell us what happens.
>
> Best regards, Michael.

All I'm doing is e.g.:

1. C-x C-f //ssh:puppet-staging:/etc/puppet/environment/aearnfjord/puppet RET
2. Run some command e.g. M-x grep <hi>
3. This results in:
    $ wc -l $PWD/.tramp_history
    39 /etc/puppet/environments/aearnfjord/puppet/.tramp_history

I've snipped away the parts I think are irrelevant because it's very
verbose, but this hopefully the relevant tramp-verbose=6 output:

[I don't have an existing tramp connection at this point, so it connects]
16:24:08.497153 tramp-process-one-action (5) # Looking for regexp "\(^[^#$%>
]*[#$%>] *\)\'" from remote shell
16:24:08.497248 tramp-process-one-action (5) # Call ‘tramp-action-succeed’
16:24:08.497369 tramp-process-actions (6) #
nohup: redirecting stderr to stdout
Last login: Tue Oct 11 16:03:15 2016 from <host>^M
[...]
^[[1;31mPROD^[[m puppet-staging ~ (DUMMY) $
16:24:08.497762 tramp-process-actions (3) # Waiting for prompts from
remote shell...done
16:24:08.498117 tramp-maybe-open-connection (3) # Found remote shell
prompt on ‘puppet-staging’
16:24:08.498251 tramp-open-shell (5) # Opening remote shell ‘/bin/sh’...
16:24:08.498387 tramp-send-command (6) # exec env ENV=''
HISTFILE=.tramp_history PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3=''
/bin/sh
16:24:08.522855 tramp-wait-for-regexp (6) #
#$
16:24:08.522995 tramp-open-shell (5) # Opening remote shell ‘/bin/sh’...done
16:24:08.523075 tramp-open-connection-setup-interactive-shell (5) #
Setting up remote shell environment
16:24:08.523157 tramp-send-command (6) # stty tab0 -inlcr -onlcr -echo
kill '^U' erase '^H'
16:24:08.543347 tramp-wait-for-regexp (6) #
[...]

Then this and all subsequent commands end up in my non-~ .tramp_history:

$ head -n 2 /etc/puppet/environments/aearnfjord/puppet/.tramp_history
#1476195869
stty tab0 -inlcr -onlcr -echo kill '^U' erase '^H'

If this isn't the relevant output or you'd like to me to try something
else I'd be happy to provide more details.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Tue, 11 Oct 2016 14:46:02 GMT) Full text and rfc822 format available.

Message #25 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Tue, 11 Oct 2016 16:44:57 +0200
Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:

Hi Ævar,

> All I'm doing is e.g.:
>
> 1. C-x C-f //ssh:puppet-staging:/etc/puppet/environment/aearnfjord/puppet RET
> 2. Run some command e.g. M-x grep <hi>
> 3. This results in:
>     $ wc -l $PWD/.tramp_history
>     39 /etc/puppet/environments/aearnfjord/puppet/.tramp_history

OK, so this is about running an asynchronous process on the remote
host. This shall help me to reproduce it locally, thanks for the recipe.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Tue, 11 Oct 2016 14:49:02 GMT) Full text and rfc822 format available.

Message #28 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1; Regression in 25.1: .tramp_history files are
 littered in non-$HOME working directories
Date: Tue, 11 Oct 2016 16:47:38 +0200
On Tue, Oct 11, 2016 at 4:44 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:
>
> Hi Ævar,
>
>> All I'm doing is e.g.:
>>
>> 1. C-x C-f //ssh:puppet-staging:/etc/puppet/environment/aearnfjord/puppet RET
>> 2. Run some command e.g. M-x grep <hi>
>> 3. This results in:
>>     $ wc -l $PWD/.tramp_history
>>     39 /etc/puppet/environments/aearnfjord/puppet/.tramp_history
>
> OK, so this is about running an asynchronous process on the remote
> host. This shall help me to reproduce it locally, thanks for the recipe.

If you mean the M-x grep from the .tramp_history (in that
/etc/puppet/... directory) it starts much earlier than that, i.e.
Tramp's own post-connection commands go to that file, and then the
last command is my M-x grep:

$ cat .tramp_history
#1476195869
stty tab0 -inlcr -onlcr -echo kill '^U' erase '^H'
#1476195869
echo foo
#1476195869
PS1=///dfb559542f43800587d648842ba11aba\#\$ PS2='' PS3='' PROMPT_COMMAND=''
#1476195869
echo \"`uname -sr`\" 2>/dev/null; echo tramp_exit_status $?
#1476195869
echo foo ; echo bar
#1476195869
set +o vi +o emacs
#1476195869
PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export PATH
#1476195869
mesg n 2>/dev/null; biff n 2>/dev/null
#1476195869
stty iutf8 2>/dev/null
#1476195869
echo \"`tty`\" 2>/dev/null; echo tramp_exit_status $?
#1476195869
while read var val; do export $var=$val; done
<<'73f386707e9600ff260fa9d80e5e5557'
PAGER cat
INSIDE_EMACS '25.1.1,tramp:2.2.13.25.1'
TERM dumb
LC_CTYPE ''
TMOUT 0
LC_ALL en_US.utf8
73f386707e9600ff260fa9d80e5e5557

#1476195869
unset correct autocorrect MAILPATH MAILCHECK MAIL HISTORY CDPATH
#1476195869
cd /etc/puppet/environments/aearnfjord/puppet/ &&  exec
<<'73f386707e9600ff260fa9d80e5e5557' env
PS1\=/ssh\:puppet-staging\:/etc/puppet/environments/aearnfjord/puppet/\
\#\$\  TERMCAP\= COLUMNS\=106 INSIDE_EMACS\=25.1.1\,compile /bin/sh
(
git --no-pager grep -E -i -n -- hi
) </dev/tty
73f386707e9600ff260fa9d80e5e5557




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Wed, 12 Oct 2016 14:06:02 GMT) Full text and rfc822 format available.

Message #31 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Wed, 12 Oct 2016 16:05:44 +0200
Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:

Hi Ævar,

>>> All I'm doing is e.g.:
>>>
>>> 1. C-x C-f //ssh:puppet-staging:/etc/puppet/environment/aearnfjord/puppet RET
>>> 2. Run some command e.g. M-x grep <hi>
>>> 3. This results in:
>>>     $ wc -l $PWD/.tramp_history
>>>     39 /etc/puppet/environments/aearnfjord/puppet/.tramp_history
>>
>> OK, so this is about running an asynchronous process on the remote
>> host. This shall help me to reproduce it locally, thanks for the recipe.
>
> If you mean the M-x grep from the .tramp_history (in that
> /etc/puppet/... directory) it starts much earlier than that, i.e.
> Tramp's own post-connection commands go to that file, and then the
> last command is my M-x grep:

Thanks. So it is related to `tramp-open-shell', which comes just prior
these commands.

I've tried it with several configurations, but I could not reproduce the
problem locally. I suppose this behaviour is related to the used shell
on the remote host. What is /bin/sh on your remote machine?

So again, could you pls start a new Emacs, set tramp-verbose to 6, and
connect to the remote host where it happens?. And I need the full debug
buffer then, because there are a lot of other information which could
tell us what's up. If you have privacy concerns showing this publicly,
pls send it to me directly.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Thu, 13 Oct 2016 14:52:02 GMT) Full text and rfc822 format available.

Message #34 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Thu, 13 Oct 2016 16:51:41 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Ævar,

> I've tried it with several configurations, but I could not reproduce the
> problem locally. I suppose this behaviour is related to the used shell
> on the remote host. What is /bin/sh on your remote machine?

For the records, today I could reproduce the problem. I had to set
/bin/bash explicitely as remote shell.

Let's see, whether I could find a proper solution, compliant to all
bug#24478, bug#20446, bug#19731, bug#17295. And it is always bash, which
causes problems!

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Thu, 13 Oct 2016 15:19:01 GMT) Full text and rfc822 format available.

Message #37 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1; Regression in 25.1: .tramp_history files are
 littered in non-$HOME working directories
Date: Thu, 13 Oct 2016 17:18:13 +0200
On Thu, Oct 13, 2016 at 4:51 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi Ævar,
>
>> I've tried it with several configurations, but I could not reproduce the
>> problem locally. I suppose this behaviour is related to the used shell
>> on the remote host. What is /bin/sh on your remote machine?
>
> For the records, today I could reproduce the problem. I had to set
> /bin/bash explicitely as remote shell.
>
> Let's see, whether I could find a proper solution, compliant to all
> bug#24478, bug#20446, bug#19731, bug#17295. And it is always bash, which
> causes problems!

Hi, sorry about not getting back to you earlier on this bug, so just
to confirm you don't need to be to reproduce this anymore?

The system I'm ssh-ing into is a CentOS (a RedHat derivative) machine,
on RHEL/CentOS/Fedora:

    $ file /bin/sh
    /bin/sh: symbolic link to `bash'
    $ rpm -qf /bin/sh
    bash-4.2.46-20.el7_2.x86_64

I.e. their /bin/sh is always bash, as opposed to say the more minimal
dash shell on Debian.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Thu, 13 Oct 2016 16:31:02 GMT) Full text and rfc822 format available.

Message #40 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org,
 Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Thu, 13 Oct 2016 18:30:32 +0200
Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:

Hi Ævar,

> Hi, sorry about not getting back to you earlier on this bug, so just
> to confirm you don't need to be to reproduce this anymore?

No, I shall be able to work on this with the information I could
retrieve locally.

> I.e. their /bin/sh is always bash, as opposed to say the more minimal
> dash shell on Debian.

Indeed. All the bugs I've quoted were related to bash.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Sat, 15 Oct 2016 10:39:01 GMT) Full text and rfc822 format available.

Message #43 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>,
 24478 <at> debbugs.gnu.org, Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Sat, 15 Oct 2016 12:38:15 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Ævar,

>> I.e. their /bin/sh is always bash, as opposed to say the more minimal
>> dash shell on Debian.
>
> Indeed. All the bugs I've quoted were related to bash.

Well, I've partly reverted the fix for bug#20446. This shall fix the
problem for you. See appended patch.

Glenn, you have reported bug#20446. I believe that I haven't
reintroduced your problem, but I would appreciate pretty much if you
could cross-check this. The point is NOT to set $HISTFILESIZE.

Best regards, Michael.

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs-25/lisp/net/tramp-sh.el.~4f406e9813e073b675bb45613bf1dd111eec2368~	2016-10-15 12:34:57.847998549 +0200
--- /home/albinus/src/emacs-25/lisp/net/tramp-sh.el	2016-10-15 12:28:04.562663524 +0200
***************
*** 67,85 ****
    :type 'string)
  
  ;;;###tramp-autoload
! (defcustom tramp-histfile-override ".tramp_history"
    "When invoking a shell, override the HISTFILE with this value.
  When setting to a string, it redirects the shell history to that
  file.  Be careful when setting to \"/dev/null\"; this might
  result in undesired results when using \"bash\" as shell.
  
  The value t, the default value, unsets any setting of HISTFILE,
! and sets both HISTFILESIZE and HISTSIZE to 0.  If you set this
! variable to nil, however, the *override* is disabled, so the
! history will go to the default storage location,
! e.g. \"$HOME/.sh_history\"."
    :group 'tramp
!   :version "25.1"
    :type '(choice (const :tag "Do not override HISTFILE" nil)
                   (const :tag "Unset HISTFILE" t)
                   (string :tag "Redirect to a file")))
--- 67,84 ----
    :type 'string)
  
  ;;;###tramp-autoload
! (defcustom tramp-histfile-override t
    "When invoking a shell, override the HISTFILE with this value.
  When setting to a string, it redirects the shell history to that
  file.  Be careful when setting to \"/dev/null\"; this might
  result in undesired results when using \"bash\" as shell.
  
  The value t, the default value, unsets any setting of HISTFILE,
! and sets HISTSIZE to 0.  If you set this variable to nil,
! however, the *override* is disabled, so the history will go to
! the default storage location, e.g. \"$HOME/.sh_history\"."
    :group 'tramp
!   :version "25.2"
    :type '(choice (const :tag "Do not override HISTFILE" nil)
                   (const :tag "Unset HISTFILE" t)
                   (string :tag "Redirect to a file")))
***************
*** 4113,4119 ****
  		(format "HISTFILE=%s"
  			(tramp-shell-quote-argument tramp-histfile-override))
  	      (if tramp-histfile-override
! 		  "HISTFILE='' HISTFILESIZE=0 HISTSIZE=0"
  		""))
  	    (tramp-shell-quote-argument tramp-end-of-output)
  	    shell (or extra-args ""))
--- 4112,4118 ----
  		(format "HISTFILE=%s"
  			(tramp-shell-quote-argument tramp-histfile-override))
  	      (if tramp-histfile-override
! 		  "HISTFILE='' HISTSIZE=0"
  		""))
  	    (tramp-shell-quote-argument tramp-end-of-output)
  	    shell (or extra-args ""))
***************
*** 4885,4891 ****
  		(if tramp-histfile-override
  		    (progn
  		      (setenv "HISTFILE")
- 		      (setenv "HISTFILESIZE" "0")
  		      (setenv "HISTSIZE" "0"))))
  	      (setenv "PROMPT_COMMAND")
  	      (setenv "PS1" tramp-initial-end-of-output)
--- 4884,4889 ----
--8<---------------cut here---------------end--------------->8---




Added tag(s) patch. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Mon, 17 Oct 2016 11:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Sat, 22 Oct 2016 16:56:02 GMT) Full text and rfc822 format available.

Message #48 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Sat, 22 Oct 2016 18:55:08 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Glenn,

> Glenn, you have reported bug#20446. I believe that I haven't
> reintroduced your problem, but I would appreciate pretty much if you
> could cross-check this. The point is NOT to set $HISTFILESIZE.

Ping. I would really like to get your feedback, before I push the patch
to the emacs-25 branch.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Sun, 23 Oct 2016 23:30:02 GMT) Full text and rfc822 format available.

Message #51 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Sun, 23 Oct 2016 19:29:41 -0400
Applying the patch causes bug 20446 to recur.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Mon, 24 Oct 2016 07:10:01 GMT) Full text and rfc822 format available.

Message #54 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Mon, 24 Oct 2016 09:09:48 +0200
Glenn Morris <rgm <at> gnu.org> writes:

Hi Glenn,

> Applying the patch causes bug 20446 to recur.

Thanks for the feedback. So I need to find another, more complicated,
solution.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Mon, 24 Oct 2016 13:11:02 GMT) Full text and rfc822 format available.

Message #57 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Mon, 24 Oct 2016 15:10:38 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Ævar,

> No, I shall be able to work on this with the information I could
> retrieve locally.

Since I couldn't apply the other change, setting
`tramp-histfile-override' to t, I've changed it now to
"~/.tramp_history". Plus a short test whether this (or something else
the user decides) is a proper setting.

Hope this fixes the problem finally. Could you, pls, crosscheck in the
emacs-25 branch?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24478; Package emacs. (Mon, 24 Oct 2016 13:56:01 GMT) Full text and rfc822 format available.

Message #60 received at 24478 <at> debbugs.gnu.org (full text, mbox):

From: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478 <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1; Regression in 25.1: .tramp_history files are
 littered in non-$HOME working directories
Date: Mon, 24 Oct 2016 15:54:38 +0200
On Mon, Oct 24, 2016 at 3:10 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi Ævar,
>
>> No, I shall be able to work on this with the information I could
>> retrieve locally.
>
> Since I couldn't apply the other change, setting
> `tramp-histfile-override' to t, I've changed it now to
> "~/.tramp_history". Plus a short test whether this (or something else
> the user decides) is a proper setting.
>
> Hope this fixes the problem finally. Could you, pls, crosscheck in the
> emacs-25 branch?

Looks good to me. The ~/.tramp_history value you changed it to has
been what I've been setting this to locally to work around the issue.
Thanks!




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Mon, 24 Oct 2016 14:33:02 GMT) Full text and rfc822 format available.

Notification sent to Ævar Arnfjörð Bjarmason <avar <at> booking.com>:
bug acknowledged by developer. (Mon, 24 Oct 2016 14:33:02 GMT) Full text and rfc822 format available.

Message #65 received at 24478-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ævar Arnfjörð Bjarmason <avarab <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 24478-done <at> debbugs.gnu.org
Subject: Re: bug#24478: 25.1;
 Regression in 25.1: .tramp_history files are littered in non-$HOME
 working directories
Date: Mon, 24 Oct 2016 16:32:34 +0200
Version: 25.2

Ævar Arnfjörð Bjarmason <avarab <at> gmail.com> writes:

Hi Ævar,

>> Hope this fixes the problem finally. Could you, pls, crosscheck in the
>> emacs-25 branch?
>
> Looks good to me. The ~/.tramp_history value you changed it to has
> been what I've been setting this to locally to work around the issue.

I know. But I also want to ensure, that the additional code does not
break anything.

Hmm, so what. I mark this bug as closed, hoping the problem does not
appear, again. And I'll watch hydra next days; being curious whether it
breaks there.

> Thanks!

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Nov 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.