From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Georgiy Tugai Newsgroups: gmane.emacs.bugs Subject: bug#21697: 24.5; TRAMP to superuser overwrites remote /dev/null eventually Date: Sun, 18 Oct 2015 01:42:06 +1030 Message-ID: <20151017151206.GD26648@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pE2VAHO2njSJCslu" X-Trace: ger.gmane.org 1445106516 25697 80.91.229.3 (17 Oct 2015 18:28:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Oct 2015 18:28:36 +0000 (UTC) To: 21697@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 17 20:28:25 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZnWDO-0002Rc-QW for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Oct 2015 20:28:23 +0200 Original-Received: from localhost ([::1]:59422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnWDO-0007YE-55 for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Oct 2015 14:28:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnWDI-0007XJ-5z for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 14:28:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnWD4-0000r5-8R for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 14:28:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnWD4-0000r1-4s for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 14:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZnWD4-0007Wx-1Z for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 14:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Georgiy Tugai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Oct 2015 18:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21697 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144510647828933 (code B ref -1); Sat, 17 Oct 2015 18:28:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Oct 2015 18:27:58 +0000 Original-Received: from localhost ([127.0.0.1]:54601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnWCz-0007Wa-64 for submit@debbugs.gnu.org; Sat, 17 Oct 2015 14:27:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53384) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnT9f-0001V2-GU for submit@debbugs.gnu.org; Sat, 17 Oct 2015 11:12:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnT9e-0005U9-73 for submit@debbugs.gnu.org; Sat, 17 Oct 2015 11:12:19 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnT9e-0005U5-4E for submit@debbugs.gnu.org; Sat, 17 Oct 2015 11:12:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnT9c-00012n-Ho for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 11:12:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnT9Z-0005T4-As for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 11:12:16 -0400 Original-Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:35378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnT9Z-0005Su-39 for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2015 11:12:13 -0400 Original-Received: by padfb7 with SMTP id fb7so4762567pad.2 for ; Sat, 17 Oct 2015 08:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=xIHV/90a8j+OvAaMheFN+9w1YoLViJZESlMqm6607ZM=; b=x5u0+PvgTdKyVq6GOPRn01VDlc3I5g+zSGEnp7LH7LqqIWZTprsu/a7ZVy9C/cligC 8/glZI21y7OoHm0pFEbdW9FOzGeKbcV1930lUoJPL/V2m7VerUj/vIG5rGRy+QozbI3+ NDCWxZ9hFLFawc+faJB//vDry7QhMUJeiPYmk+CubceD8bQPRPG8nDmPUXK4plnWxFPm GgL44xL9wuuRbMg70zQm+emmISX6NEEWwxOBJGKaSWn27A8BYTCvjJFZOYrld6iBSe5D U738bLp+UR9Y//lIXkrMNAMVp+AGFKsjsxXub020hsmRGB5JospSWqUCfpQ3nLiRZrf0 xY/A== X-Received: by 10.66.228.233 with SMTP id sl9mr23857841pac.139.1445094731862; Sat, 17 Oct 2015 08:12:11 -0700 (PDT) Original-Received: from gmail.com ([58.174.176.94]) by smtp.googlemail.com with ESMTPSA id pq4sm27127272pbc.53.2015.10.17.08.12.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 08:12:11 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Sat, 17 Oct 2015 14:27:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107698 Archived-At: --pE2VAHO2njSJCslu Content-Type: multipart/mixed; boundary="JcvBIhDvR6w3jUPA" Content-Disposition: inline --JcvBIhDvR6w3jUPA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This bug is quite tricky to reproduce as it requires a significant amount of TRAMP operations to occur during the same connection to a machine (or localhost) as superuser. Here are the commands to reproduce the issue from inside emacs -Q; I have also attached a dribblefile. WARNING! These commands will exercise your disk (and CPU) quite a bit by saving a file via TRAMP 500 times. C-x C-f /sudo:localhost:/root/temp.txt RET F3 test F3 RET C-x C-s F4 C-u 500 F4 C-x C-c I have tracked the issue down to the remote shell (sh) "atomically overwriting" the HISTFILE (i.e. write to temporary name, copy over original), thus replacing /dev/null with an ordinary file. I have reproduced this outside of Emacs, by using the same set of environment variables TRAMP sets on it's shells $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Oct 18 01:21 /dev/null $ su # HISTSIZE=2 HISTFILE=/dev/null sh # echo 1 1 # echo 2 2 # echo 3 3 # exit # ls -l /dev/null -rw------- 1 root root 14 Oct 18 01:15 /dev/null -------------------------------------------------------------------------------- In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.10) of 2015-04-13 on andromeda.sabayon.org Windowing system distributor `The X.Org Foundation', version 11.0.11604000 Configured using: `configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --program-suffix=-emacs-24 --infodir=/usr/share/info/emacs-24 --localstatedir=/var --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp --with-gameuser=:gamestat --without-compress-install --with-file-notification=inotify --enable-acl --with-dbus --with-gnutls --with-gpm --without-hesiod --with-kerberos --with-kerberos5 --without-xml2 --without-selinux --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf --without-gsettings --without-toolkit-scroll-bars --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm --without-imagemagick --with-xft --without-libotf --without-m17n-flt --with-x-toolkit=gtk3 GENTOO_PACKAGE=app-editors/emacs-24.5 'CFLAGS=-O2 -march=x86-64 -pipe -nopie' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'' Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: shell-dirtrack-mode: t 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 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 messages: Mark set delete-forward-char: Text is read-only Tramp: Opening connection for root@localhost using sudo... Tramp: Sending command `exec env SHELL=/bin/sh sudo -u root -s -H -p Password:' Tramp: Waiting for prompts from remote shell... Tramp: Sending Password Tramp: Waiting for prompts from remote shell...done Tramp: Found remote shell prompt on `localhost' Tramp: Opening connection for root@localhost using sudo...done C-x C-g is undefined Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils apropos help-mode em-unix em-term term disp-table easymenu ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util epa-file epa derived epg epg-config tramp-cache dired tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cl-extra cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util mail-prsvr password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color ring format-spec advice help-fns 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 inotify dynamic-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 127965 10209) (symbols 48 22961 0) (miscs 40 54 165) (strings 32 28721 4697) (string-bytes 1 833507) (vectors 16 16789) (vector-slots 8 476975 5504) (floats 8 169 251) (intervals 56 2159 1090) (buffers 960 16) (heap 1024 50763 714)) --JcvBIhDvR6w3jUPA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=dribble Content-Transfer-Encoding: quoted-printable =18=06/sudo:localhost:/root/temp.txttest =18=13= =15500=18=03 --JcvBIhDvR6w3jUPA-- --pE2VAHO2njSJCslu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWImVGAAoJEFTCINVvWbOZ06wH/A+Oio4lcZPTfjn1VOZn7m2h chJCW7RwR9V0N2tvwKqL83ueWS30qeFRYHPmyvVIndOpuJeOPIaw1WxZN8vXz2ED 0iyRUZUiBbXdMcIXyNbYm4N7waCA1B7srEgiFZqazJCgFRcnar1mTcuXDqwGQ/IP mheDG+8wlZMNE+rslyVZz8Hb7zZLrDV09x3KY+QuVvR4a73eXyq/7tnrOlE8EWeF whL6K7XBfeGj1nlIDdDPUWiRyEfKUwopk/ye4sqDa49WkLNrGRXinlLHN0BdXrO+ QgLwJ43DFwbg3Ehjos3RSnCCTXZ3RD9c0UXW+Qw/9PHTEFfaBi9gzNTw7yHTyLY= =qZWl -----END PGP SIGNATURE----- --pE2VAHO2njSJCslu--