all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: Files created with emacs are owned by system
Date: Sat, 02 Aug 2008 11:54:31 +1000	[thread overview]
Message-ID: <87d4kstc4o.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: 626685cb-27d2-4a29-93a9-71079e51d715@m44g2000hsc.googlegroups.com

iainb.forms@googlemail.com writes:

> On Aug 1, 3:33 pm, Joost Kremers <joostkrem...@yahoo.com> wrote:
>> iainb.fo...@googlemail.com wrote:
>> > 3. GNU Emacs 21.2.1
>> [...]
>> > 8. emacs -Q: unknown option; I also can't find it in the man page.
>>
>> -Q is a fairly new option. perhaps it was only introduced with emacs 22.
>>
>> > Most importantly, (probably) it does seem that emacs is running as
>> > root
>> > ps -aux | grep emacs:
>> > root      1805   0.0 -0.2    48104   4548  p2  S+    7:38PM   0:00.36
>> > emacs
>>
>> > I have no idea why it's doing this or how to change it. If I quit
>> > emacs and while in the same terminal run "whoami", I'm still iainb.
>>
>> do:
>>
>> ls -l $(which emacs)
>>
>> i'm suspecting that your permissions will be set to 'rws' for the owner,
>> meaning that the binary is suid (i.e. it runs as the owner of the file, in
>> this case root, not as the user that's actually started the process.)
>>
>> --
>> Joost Kremers                                      joostkrem...@yahoo.com
>> Selbst in die Unterwelt dringt durch Spalten Licht
>> EN:SiS(9)
>
> well, I've installed emacs version 22.2 into /usr/local and it doesn't
> save the files as root, it saves them as me.
>
> For the record
> ls -l /usr/local/bin/emacs
> -rwxr-xr-t   2 root  wheel  9673784 Aug  1 15:36 /usr/local/bin/emacs
>
> ls -l /usr/bin/emacs
> -r-sr-xr-x   1 root  wheel  30008 Aug 19  2006 /usr/bin/emacs
>

There is your problem. Emacs has the setuid bit set. this means it will
execute as the owner, which is root. 

While switching to a new version as worked around your problem, I would
be rther concerned about this. It would be extremely unusual to have
emacs installed with the setuid bit set. I would certainly be checking
to see what other binaries have this set and would immediately 
consider the system has been compromised. If you find many files with
the setuid bit set, I would strongly recommend a re-install.

Tim


-- 
tcross (at) rapttech dot com dot au


  parent reply	other threads:[~2008-08-02  1:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 18:44 Files created with emacs are owned by system iainb.forms
2008-07-31 21:34 ` Peter Dyballa
2008-07-31 21:41 ` Thierry Volpiatto
2008-08-01  8:23 ` Nikolaj Schumacher
     [not found] ` <mailman.15696.1217578999.18990.help-gnu-emacs@gnu.org>
2008-08-01 11:32   ` iainb.forms
2008-08-01 11:38     ` iainb.forms
2008-08-01 11:52     ` Peter Dyballa
     [not found]     ` <mailman.15702.1217591538.18990.help-gnu-emacs@gnu.org>
2008-08-01 12:01       ` Joost Kremers
2008-08-01 13:33         ` Peter Dyballa
     [not found]         ` <mailman.15706.1217597618.18990.help-gnu-emacs@gnu.org>
2008-08-01 13:47           ` Joost Kremers
2008-08-01 13:53             ` Richard G Riley
2008-08-01 14:08               ` Joost Kremers
2008-08-01 14:22               ` iainb.forms
2008-08-01 14:33                 ` Joost Kremers
2008-08-01 15:04                   ` iainb.forms
2008-08-01 15:53                     ` Peter Dyballa
2008-08-01 16:12                       ` Thierry Volpiatto
2008-08-01 16:25                         ` Peter Dyballa
2008-08-01 17:47                     ` Joost Kremers
2008-08-01 18:50                       ` Peter Dyballa
     [not found]                       ` <mailman.15726.1217616618.18990.help-gnu-emacs@gnu.org>
2008-08-01 19:17                         ` David Kastrup
2008-08-01 20:55                           ` Peter Dyballa
2008-08-02  8:25                           ` iainb.forms
2008-08-06 23:42                             ` Mark Hood
2008-08-01 19:24                         ` Joost Kremers
2008-08-02  1:54                     ` Tim X [this message]
     [not found]                     ` <mailman.15719.1217606007.18990.help-gnu-emacs@gnu.org>
2008-08-02 19:18                       ` D. Power
2008-08-01 15:31                 ` Peter Dyballa
2008-08-02  1:33                 ` Tim X
2008-08-02  1:29         ` Tim X
2008-08-01 13:16       ` iainb.forms
2008-08-01 13:39         ` Joost Kremers
2008-08-01 13:51         ` Peter Dyballa
2008-08-02  1:48         ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4kstc4o.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.