help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why emacs touches read-only file?


From: Tim X
Subject: Re: Why emacs touches read-only file?
Date: Sat, 21 Apr 2007 13:48:04 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

Daniel <hanmoai@gmail.com> writes:

> On Apr 19, 7:28 pm, Tim X <t...@nospam.dev.null> wrote:
>> Daniel <hanm...@gmail.com> writes:
>> > Hi all,
>>
>> > 1. Create a file with permission of 444 (read-only) file.
>> > 2. Open the file using emacs.
>>
>> > Question.
>>
>> > My emacs open the read-only file as writable buffer. Also, I can
>> > modify it and save it. (AMAZING, emacs IGNORES unix file system. WOW.)
>>
>> > What happened to the emacs, and how it works properly (open files as
>> > read-only if it is read-only, and as writable if it is writable.)
>>
>> > Thank you,
>>
>> > Dan.
>>
>> doing the same thing with emacs 22 gives me a read only file. any attempt to
>> modify the file gives me a buffer is read only message.
>>
>> Your not running as root are you?
>>
>> Tim
>>
>> --
>> tcross (at) rapttech dot com dot au
>
> I am running it as root, but the permission is read-only to root also.
> Is there any problem?
>

Well, there shouldn't be. Some programs will allow root to edit read only files
and will only give a warning. However, I just tried it with emacs 22 and it
won't let me edit it unless I specifically ask it to. So, its probably not an
issue. Still, running as root is generally considered a bad thing as it is way
too easy to accidently change things. It can also undermine the protection
Unix/GNU Linux users generally have against viruses, trojans etc. Many people
are under the mistaken belief that you cannot get such things under Unix/GNU
Linux. However, this is not true. If your running as root it is possible for
your system to be compromised by most of the same techniques used on Windows,
such as malicious e-mail attachments or web sites that attempt to take
advantage of security weaknesses in browsers/browser plugins etc. . Of course,
because most people don't run as root and as there are considerably more
variables involved, there are few examples of attacks setup like this - most
Unix/Gnu Linux attacks concentrate on more network type weaknesses. Still,
running as root pretty much compromises the security model that the system is
based on.

There has been a number of users who have posted that they cannot reproduce the
behavior you are seeing. This would indicate it is something specific to your
setup. Possibly in your .emacs or emacs site file, possibly related to the fact
your accessing via VNC and the way it is configured. Have you tried doing the
same with other programs, such as vi? Have you tried doing the same in
different directories/partitions? Have you tried doing the same, but when not
running as root? 

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]