Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.os.linux.development.apps Subject: Re: fopen() of a read-only file for writing? Date: Thu, 19 Apr 2012 14:16:39 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 27 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1334844999 6054 64.122.56.22 (19 Apr 2012 14:16:39 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 19 Apr 2012 14:16:39 +0000 (UTC) User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.os.linux.development.apps:466 On 2012-04-19, Joe Shead wrote: > I tested it, and it works. With a new non-root user, I got the EACCES that I > expected. > > I'll just say, for anyone out there who wants to read my humble opinion, > that sometimes root wants to set things (like relatively stable C++ code, or > an initialization script) to read-only, so he knows that if he opens those > files to take a look, Don't do stuff like that (browsing around looking at source code) as root. > he can't easily accidentally modify them. If he wants to change the > file, he would actually like to be forced to do a chmod, make the > deliberate changes, and then chmod it back to read-only. I do that > all the time. Don't log in as root. Browse around as a normal user and then use sudo when you decide you want to change something that requires root privleges. -- Grant Edwards grant.b.edwards Yow! You should all JUMP at UP AND DOWN for TWO HOURS gmail.com while I decide on a NEW CAREER!!