From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Why emacs touches read-only file? Date: Sat, 21 Apr 2007 13:48:04 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87r6qexua3.fsf@lion.rapttech.com.au> References: <1176920422.786251.122770@d57g2000hsg.googlegroups.com> <87zm53ye2l.fsf@lion.rapttech.com.au> <1177052457.225050.244290@b58g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177130161 7288 80.91.229.12 (21 Apr 2007 04:36:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2007 04:36:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 21 06:35:55 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hf7KD-0003iJ-TN for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Apr 2007 06:35:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hf7PL-0001vl-WF for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Apr 2007 00:41:12 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!sn-xt-sjc-04!sn-xt-sjc-10!sn-xt-sjc-07!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:6a2pkcuMEVrU5hxcMvg1dFhkXOI= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 64 Original-Xref: shelby.stanford.edu gnu.emacs.help:147340 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42944 Archived-At: Daniel writes: > On Apr 19, 7:28 pm, Tim X wrote: >> Daniel 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