GNU bug report logs - #19731
24.4; /dev/null is deleted by tramp-sh.el

Previous Next

Package: emacs;

Reported by: crocket <crockabiscuit <at> gmail.com>

Date: Fri, 30 Jan 2015 05:20:02 UTC

Severity: normal

Merged with 21697, 23041

Found in versions 24.4, 24.5

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

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 19731 in the body.
You can then email your comments to 19731 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#19731; Package emacs. (Fri, 30 Jan 2015 05:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to crocket <crockabiscuit <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 30 Jan 2015 05:20:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; /dev/null is deleted by tramp-sh.el
Date: Fri, 30 Jan 2015 14:18:58 +0900
According to https://bbs.archlinux.org/viewtopic.php?pid=1397412#p1397412
, if HISTFILE=/dev/null is set as an environment variable, /dev/null
can be deleted and replaced by a regular file with permission 600.

If I fiddled with magit over tramp sudo method for a while and exited
emacs, I see /dev/null replaced with a regular file with permission
600.

After some inspections, I found HISTFILE=/dev/null in tramp-sh.el.

Could tramp-sh.el be the cause of /dev/null problem?

In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.7)
 of 2015-01-18 on bisson
Windowing system distributor `The X.Org Foundation', version 11.0.11603000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-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:
<help-echo> C-x C-f <backspace> C-g M-x r e p o r t
<tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message idna format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils info easymenu package epg-config
time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-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 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 make-network-process dbusbind gfilenotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

Memory information:
((conses 16 113852 6530)
 (symbols 48 20679 0)
 (miscs 40 87 124)
 (strings 32 22379 4312)
 (string-bytes 1 542144)
 (vectors 16 12069)
 (vector-slots 8 418986 5747)
 (floats 8 66 65)
 (intervals 56 224 19)
 (buffers 960 12)
 (heap 1024 50731 994))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Fri, 30 Jan 2015 09:39:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Fri, 30 Jan 2015 18:38:29 +0900
I confirmed that if $HISTFILE is /dev/null on bash and I execute more
commands than $HISTFILESIZE, when I exit bash, /dev/null is deleted.

Thus, if tramp executes more commands than $HISTFILESIZE and I quit
emacs, /dev/null is deleted.

On Fri, Jan 30, 2015 at 2:18 PM, crocket <crockabiscuit <at> gmail.com> wrote:
> According to https://bbs.archlinux.org/viewtopic.php?pid=1397412#p1397412
> , if HISTFILE=/dev/null is set as an environment variable, /dev/null
> can be deleted and replaced by a regular file with permission 600.
>
> If I fiddled with magit over tramp sudo method for a while and exited
> emacs, I see /dev/null replaced with a regular file with permission
> 600.
>
> After some inspections, I found HISTFILE=/dev/null in tramp-sh.el.
>
> Could tramp-sh.el be the cause of /dev/null problem?
>
> In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.7)
>  of 2015-01-18 on bisson
> Windowing system distributor `The X.Org Foundation', version 11.0.11603000
> Configured using:
>  `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
>  --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
>  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
>  --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
>  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
>
> Important settings:
>   value of $LANG: en_US.utf8
>   value of $XMODIFIERS: @im=ibus
>   locale-coding-system: utf-8-unix
>
> Major mode: Fundamental
>
> Minor modes in effect:
>   tooltip-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   blink-cursor-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:
> <help-echo> C-x C-f <backspace> C-g M-x r e p o r t
> <tab> <return>
>
> Recent messages:
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Quit
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort gnus-util mail-extr emacsbug message idna format-spec
> rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
> mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
> mm-util help-fns mail-prsvr mail-utils info easymenu package epg-config
> time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
> mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
> tabulated-list newcomment lisp-mode prog-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 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 make-network-process dbusbind gfilenotify dynamic-setting
> system-font-setting font-render-setting move-toolbar gtk x-toolkit x
> multi-tty emacs)
>
> Memory information:
> ((conses 16 113852 6530)
>  (symbols 48 20679 0)
>  (miscs 40 87 124)
>  (strings 32 22379 4312)
>  (string-bytes 1 542144)
>  (vectors 16 12069)
>  (vector-slots 8 418986 5747)
>  (floats 8 66 65)
>  (intervals 56 224 19)
>  (buffers 960 12)
>  (heap 1024 50731 994))
>
>
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Fri, 30 Jan 2015 09:42:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Fri, 30 Jan 2015 18:41:09 +0900
I think there are at least two solutions to tramp-sh.el problem.

1) Change the shell to zsh
2) unset $HISTFILE and set HISTFILESIZE to 0 instead of setting
HISTFILE to /dev/null
3) etc...

On Fri, Jan 30, 2015 at 2:18 PM, crocket <crockabiscuit <at> gmail.com> wrote:
> According to https://bbs.archlinux.org/viewtopic.php?pid=1397412#p1397412
> , if HISTFILE=/dev/null is set as an environment variable, /dev/null
> can be deleted and replaced by a regular file with permission 600.
>
> If I fiddled with magit over tramp sudo method for a while and exited
> emacs, I see /dev/null replaced with a regular file with permission
> 600.
>
> After some inspections, I found HISTFILE=/dev/null in tramp-sh.el.
>
> Could tramp-sh.el be the cause of /dev/null problem?
>
> In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.7)
>  of 2015-01-18 on bisson
> Windowing system distributor `The X.Org Foundation', version 11.0.11603000
> Configured using:
>  `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
>  --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
>  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
>  --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
>  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
>
> Important settings:
>   value of $LANG: en_US.utf8
>   value of $XMODIFIERS: @im=ibus
>   locale-coding-system: utf-8-unix
>
> Major mode: Fundamental
>
> Minor modes in effect:
>   tooltip-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   blink-cursor-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:
> <help-echo> C-x C-f <backspace> C-g M-x r e p o r t
> <tab> <return>
>
> Recent messages:
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Quit
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort gnus-util mail-extr emacsbug message idna format-spec
> rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
> mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
> mm-util help-fns mail-prsvr mail-utils info easymenu package epg-config
> time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
> mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
> tabulated-list newcomment lisp-mode prog-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 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 make-network-process dbusbind gfilenotify dynamic-setting
> system-font-setting font-render-setting move-toolbar gtk x-toolkit x
> multi-tty emacs)
>
> Memory information:
> ((conses 16 113852 6530)
>  (symbols 48 20679 0)
>  (miscs 40 87 124)
>  (strings 32 22379 4312)
>  (string-bytes 1 542144)
>  (vectors 16 12069)
>  (vector-slots 8 418986 5747)
>  (floats 8 66 65)
>  (intervals 56 224 19)
>  (buffers 960 12)
>  (heap 1024 50731 994))
>
>
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 11:45:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: crocket <crockabiscuit <at> gmail.com>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 12:44:34 +0100
crocket <crockabiscuit <at> gmail.com> writes:

Hi,

> I think there are at least two solutions to tramp-sh.el problem.
>
> 1) Change the shell to zsh
> 2) unset $HISTFILE and set HISTFILESIZE to 0 instead of setting
> HISTFILE to /dev/null
> 3) etc...

In Emacs 25 (the development version), there is a customer option
`tramp-histfile-override'. You could use it for setting HISTFILE to
another value but "/dev/null". If you use the symbol `unset' as value,
HISTFILE will be unset.

Do you have a chance to check it?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 12:23:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>, 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 2 Feb 2015 21:22:30 +0900
On bash, if you become root, and set HISTFILE to /dev/null and
HISTFILESIZE to a very small number, and execute more than
$HISTFILESIZE commands, and exit bash, then
you'll see /dev/null replaced with a regular file with permission 600.

If you can't reproduce it, then I'll test tramp on emacs 25 with
'tramp-histfile-override' set to 'unset'.

On Mon, Feb 2, 2015 at 9:15 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> crocket <crockabiscuit <at> gmail.com> writes:
>
>> I confirmed that bash deletes /bin/bash with HISTFILE=/dev/null after
>> executing more commands than HISTFILESIZE.
>> Thus, I can already imagine the outcome of unsetting HISTFILE.
>> You can test emacs 25 with various values of HISTFILE on systems that
>> have /bin/sh symlinked to /bin/bash.
>
> Well, I couldn't test whether Tramp behaves correctly because I have no
> test system where bash behaves like described by you. So I hope to get
> feedback, whether Tramp behaves correctly.
>
>> I think 'unset' is a reasonable default value for HISTFILE because
>> people are not interested in tramp history by default.
>
> Well, changing the default would need much more testing with other
> shells but bash. That's why it is offered as option only, and not as default.
>
> Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 12:46:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: crocket <crockabiscuit <at> gmail.com>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 13:45:01 +0100
crocket <crockabiscuit <at> gmail.com> writes:

> On bash, if you become root, and set HISTFILE to /dev/null and
> HISTFILESIZE to a very small number, and execute more than
> $HISTFILESIZE commands, and exit bash, then
> you'll see /dev/null replaced with a regular file with permission 600.

Tramp doesn't set HISTFILESIZE to any value. Maybe it should set it to a
reasonable large number, when HISTFILE is set to /dev/null?

> If you can't reproduce it, then I'll test tramp on emacs 25 with
> 'tramp-histfile-override' set to 'unset'.

Please do.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 12:47:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 2 Feb 2015 21:46:40 +0900
You shouldn't set HISTFILE to /dev/null in the first place.

On Mon, Feb 2, 2015 at 9:45 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> crocket <crockabiscuit <at> gmail.com> writes:
>
>> On bash, if you become root, and set HISTFILE to /dev/null and
>> HISTFILESIZE to a very small number, and execute more than
>> $HISTFILESIZE commands, and exit bash, then
>> you'll see /dev/null replaced with a regular file with permission 600.
>
> Tramp doesn't set HISTFILESIZE to any value. Maybe it should set it to a
> reasonable large number, when HISTFILE is set to /dev/null?
>
>> If you can't reproduce it, then I'll test tramp on emacs 25 with
>> 'tramp-histfile-override' set to 'unset'.
>
> Please do.
>
> Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 13:05:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: crocket <crockabiscuit <at> gmail.com>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 14:04:44 +0100
crocket <crockabiscuit <at> gmail.com> writes:

> You shouldn't set HISTFILE to /dev/null in the first place.

Well, I'm kind of conservative. Setting HISTFILE to /dev/null is the
default for years, and your report is the first one about this problem.

I wouldn't say that we shouldn't change it, but it needs more
compatibility tests for supported shells. This could be any bournish
shell, even very old ones. Also all flavors of busybox, etc pp.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 14:20:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 2 Feb 2015 23:18:55 +0900
Bash guys hate to see HISTFILE set to /dev/null, and they say it is
stupid to do so.
In their mind, setting HISTFILE to /dev/null or any other character
device leads to vulnerabilities for now.
However, they are willing to deal with the HISTFILE issue because bash
shouldn't delete /dev/null in any case.

If bash guys consider it as a vulnerability, I think it is wise for
emacs guys to avoid it on their side.

On Mon, Feb 2, 2015 at 10:04 PM, Michael Albinus <michael.albinus <at> gmx.de> wrote:
> crocket <crockabiscuit <at> gmail.com> writes:
>
>> You shouldn't set HISTFILE to /dev/null in the first place.
>
> Well, I'm kind of conservative. Setting HISTFILE to /dev/null is the
> default for years, and your report is the first one about this problem.
>
> I wouldn't say that we shouldn't change it, but it needs more
> compatibility tests for supported shells. This could be any bournish
> shell, even very old ones. Also all flavors of busybox, etc pp.
>
> Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 15:26:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: crocket <crockabiscuit <at> gmail.com>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 16:25:45 +0100
crocket <crockabiscuit <at> gmail.com> writes:

> If bash guys consider it as a vulnerability, I think it is wise for
> emacs guys to avoid it on their side.

Hmmm. Emacs 25 is still in development, so it might not be too
harmful. I'll set `unset' as default; let's wait for complaints ...

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 18:45:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19731 <at> debbugs.gnu.org, crocket <crockabiscuit <at> gmail.com>
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 13:44:00 -0500
> Well, I'm kind of conservative. Setting HISTFILE to /dev/null is the
> default for years, and your report is the first one about this problem.

It seems like a plain bug for bash to do what it does (does it also
turn a symlink into a plain file?  wouldn't that also be a bug?), but
I wonder: what could Tramp do instead of setting HISTFILE to /dev/null?
Could unsetting it result in the same behavior (i.e. not save Tramp's
commands to any file)?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 19:51:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19731 <at> debbugs.gnu.org, crocket <crockabiscuit <at> gmail.com>
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 20:50:41 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Well, I'm kind of conservative. Setting HISTFILE to /dev/null is the
>> default for years, and your report is the first one about this problem.
>
> It seems like a plain bug for bash to do what it does

Looks to me like this.

> (does it also
> turn a symlink into a plain file?  wouldn't that also be a bug?), but
> I wonder: what could Tramp do instead of setting HISTFILE to /dev/null?
> Could unsetting it result in the same behavior (i.e. not save Tramp's
> commands to any file)?

That's how I understood the doc. Hope somebody will test it.

>         Stefan

Best regards, Michael.

PS: I've changed the corresponding value of `tramp-histfile-override' to
t instead of `unset'. It looks more natural to Lisp.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Mon, 02 Feb 2015 20:09:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
 crocket <crockabiscuit <at> gmail.com>, 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Mon, 02 Feb 2015 15:08:10 -0500
Michael Albinus wrote:

>> It seems like a plain bug for bash to do what it does
>
> Looks to me like this.

I don't think the bash folks disagree, but as always the question is
what to do about it:

http://lists.gnu.org/archive/html/bug-bash/2015-01/msg00138.html

>> I wonder: what could Tramp do instead of setting HISTFILE to /dev/null?
>> Could unsetting it result in the same behavior (i.e. not save Tramp's
>> commands to any file)?
>
> That's how I understood the doc. Hope somebody will test it.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fc.html

says that

   If the HISTFILE variable is not set, the shell may attempt to access
   or create a file .sh_history in the directory referred to by the HOME
   environment variable.

and indeed by experiment with bash 4.2.45, that is exactly what happes
with HISTFILE unset and using "bash --posix".

So (probably) you can't win.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Tue, 03 Feb 2015 03:07:02 GMT) Full text and rfc822 format available.

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

From: crocket <crockabiscuit <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Tue, 3 Feb 2015 12:06:23 +0900
[Message part 1 (text/plain, inline)]
Unsetting HISTFILE and setting HISTFILESIZE to 0 disables history logging
altogether on bash.
On Feb 3, 2015 5:08 AM, "Glenn Morris" <rgm <at> gnu.org> wrote:

> Michael Albinus wrote:
>
> >> It seems like a plain bug for bash to do what it does
> >
> > Looks to me like this.
>
> I don't think the bash folks disagree, but as always the question is
> what to do about it:
>
> http://lists.gnu.org/archive/html/bug-bash/2015-01/msg00138.html
>
> >> I wonder: what could Tramp do instead of setting HISTFILE to /dev/null?
> >> Could unsetting it result in the same behavior (i.e. not save Tramp's
> >> commands to any file)?
> >
> > That's how I understood the doc. Hope somebody will test it.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fc.html
>
> says that
>
>    If the HISTFILE variable is not set, the shell may attempt to access
>    or create a file .sh_history in the directory referred to by the HOME
>    environment variable.
>
> and indeed by experiment with bash 4.2.45, that is exactly what happes
> with HISTFILE unset and using "bash --posix".
>
> So (probably) you can't win.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Tue, 03 Feb 2015 08:35:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: crocket <crockabiscuit <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Tue, 03 Feb 2015 09:34:18 +0100
crocket <crockabiscuit <at> gmail.com> writes:

> Unsetting HISTFILE and setting HISTFILESIZE to 0 disables history
> logging altogether on bash.

HISTFILESIZE is bashism. Other shells use HISTSIZE.

> On Feb 3, 2015 5:08 AM, "Glenn Morris" <rgm <at> gnu.org> wrote:
>     
>     http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fc.html
>     
>     says that
>     
>     If the HISTFILE variable is not set, the shell may attempt to
>     access
>     or create a file .sh_history in the directory referred to by the
>     HOME
>     environment variable.
>     
>     and indeed by experiment with bash 4.2.45, that is exactly what
>     happes
>     with HISTFILE unset and using "bash --posix".
>     
>     So (probably) you can't win.

Now, when I unset HISTFILE in Tramp, I also set HISTFILESIZE and
HISTSIZE to 0. And hope it works with most shells. Praying won't help.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Tue, 03 Feb 2015 09:11:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> suse.de>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19731 <at> debbugs.gnu.org, crocket <crockabiscuit <at> gmail.com>
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Tue, 03 Feb 2015 10:10:07 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

> HISTFILESIZE is bashism. Other shells use HISTSIZE.

bash uses both.

    HISTFILESIZE        The maximum number of lines this file can contain.
    HISTSIZE    The maximum number of history lines that a running
                shell can access.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Tue, 03 Feb 2015 09:24:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 19731 <at> debbugs.gnu.org, crocket <crockabiscuit <at> gmail.com>
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Tue, 03 Feb 2015 10:23:29 +0100
Andreas Schwab <schwab <at> suse.de> writes:

>     HISTFILESIZE        The maximum number of lines this file can contain.
>     HISTSIZE    The maximum number of history lines that a running
>                 shell can access.

Yes. But for the history file, only HISTFILESIZE seems to be
relevant. That's what counts for Tramp.

> Andreas.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Tue, 03 Feb 2015 16:55:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 19731 <at> debbugs.gnu.org, crocket <crockabiscuit <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Tue, 03 Feb 2015 11:54:14 -0500
Michael Albinus wrote:

> Now, when I unset HISTFILE in Tramp, I also set HISTFILESIZE and
> HISTSIZE to 0. 

I'd be concerned that that might mean "use the default history file, and
truncate it to zero size [even if it already existed]" to some shell,
but I haven't actually checked.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Fri, 06 Feb 2015 16:45:04 GMT) Full text and rfc822 format available.

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

From: Alad Wenter <alad <at> archlinux.info>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Fri, 06 Feb 2015 12:01:48 +0100
Could you provide some more detail on unsetting $HISTFILE? Symlinking 
/bin/sh to zsh seems a bit drastic..

Alad




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19731; Package emacs. (Sun, 08 Feb 2015 10:06:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Alad Wenter <alad <at> archlinux.info>
Cc: 19731 <at> debbugs.gnu.org
Subject: Re: bug#19731: 24.4; /dev/null is deleted by tramp-sh.el
Date: Sun, 08 Feb 2015 11:05:15 +0100
Alad Wenter <alad <at> archlinux.info> writes:

> Could you provide some more detail on unsetting $HISTFILE? Symlinking
> /bin/sh to zsh seems a bit drastic..

Tramp does it meanwhile in Emacs 25.0.50 (not symlinking sh to zsh :-)
When it opens a connection, it calls

exec env ENV='' HISTFILE='' HISTFILESIZE=0 HISTSIZE=0 PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

This seems to be sufficient.

> Alad

Best regards, Michael.




bug marked as fixed in version 24.5, send any further explanations to 19731 <at> debbugs.gnu.org and crocket <crockabiscuit <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 17 Feb 2015 19:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Mar 2015 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Apr 2015 00:19:01 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 25.1. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Apr 2015 00:19:01 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 24.5. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Apr 2015 00:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 26 May 2015 11:24:07 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 17 Oct 2015 18:32:01 GMT) Full text and rfc822 format available.

Forcibly Merged 19731 21697. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 17 Oct 2015 18:32:02 GMT) Full text and rfc822 format available.

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

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 17 Mar 2016 15:46:02 GMT) Full text and rfc822 format available.

Forcibly Merged 19731 21697 23041. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 17 Mar 2016 15:46:02 GMT) Full text and rfc822 format available.

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

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

Previous Next


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