GNU bug report logs - #28618
Emacs respects $HOME, even when user is root

Previous Next

Package: emacs;

Reported by: Dor Azouri <dor.azouri <at> safebreach.com>

Date: Wed, 27 Sep 2017 15:31:01 UTC

Severity: normal

Tags: notabug, security, wontfix

Merged with 30912

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Dor Azouri <dor.azouri <at> safebreach.com>
Cc: 28618 <at> debbugs.gnu.org
Subject: bug#28618: Emacs Security Issue
Date: Fri, 29 Sep 2017 09:24:40 -0400
Dor Azouri <dor.azouri <at> safebreach.com> writes:

> This is the output in my env that demonstrates how it works (forgive
> the hebrew chars):
> ~/.emacs.d$ ls -all
> total 20
> drwx------   2 duke duke  4096 ספט 28 20:24 .
> drwxr----- 105 duke duke 16384 ספט 28 14:36 ..
> ~/.emacs.d$ echo '(let ((default-directory "/opt/")) (shell-command
> "touch stub.file"))' > init.el
> ~/.emacs.d$ ls -all /opt/ | grep stub.file
> ~/.emacs.d$ sudo emacs
> ~/.emacs.d$ ls -all /opt/ | grep stub.file
> -rw-r--r--  1 root   root      0 ספט 28 20:25 stub.file

Hmm, it doesn't happen for me.

    ~/.emacs.d$ ls -all
    total 12
    drwx------  3 npostavs npostavs 4096 Sep 29 09:19 .
    drwxr-xr-x 37 npostavs npostavs 4096 Sep 29 09:19 ..
    drwx------  2 npostavs npostavs 4096 Sep 29 09:19 auto-save-list
    ~/.emacs.d$ echo '(let ((default-directory "/opt/")) (shell-command "touch stub.file"))' > init.el
    ~/.emacs.d$ ls -all /opt/ | grep stub.file
    ~/.emacs.d$ sudo emacs
    [sudo] password for npostavs: 
    ~/.emacs.d$ ls -all /opt/ | grep stub.file

Can you do

    echo '(debug)' > ~/.emacs.d/init.el
    sudo emacs

and show the result backtrace please?




This bug report was last modified 7 years and 58 days ago.

Previous Next


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