Bug 19611

Summary: ee silently overwrites write-protected files
Product: Base System Reporter: gerti-FreeBSD <gerti-FreeBSD>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description gerti-FreeBSD 2000-06-30 23:00:00 UTC
ee run under root silently overwrites write-protected files.

How-To-Repeat: Obvious.
Comment 1 Sheldon Hearn 2000-07-03 10:46:27 UTC
On Fri, 30 Jun 2000 14:56:12 MST, gerti-freebsd@bitart.com wrote:

> >Description:
> ee run under root silently overwrites write-protected files.

It would be possible to introduce an extra check for file permissions
when ee is run under root, but this would introduce an artificial limit.

At the moment, the software expects anyone running as root to be clueful
enough to realize that root pays no heed to file permissions.

The alternative which you suggests introduces a new frustration -- the
"root" user has to bail out of ee to change the access permissions of
the file and then restart ee.  This would be quite annoying.

It _would_ be possible to pop a dialogue up when root is about to save
to a file which is read-only.  If you feel that this is something you
want to work on, I'd suggest that you first chat to the author, High
Mahon <h_mahon@fc.hp.com> about whether he wants the software to behave
like this, before working on a patch.

I think it would be a bad idea for our ee to differ in its interface
from the standard ee, which new users often rely on.

Ciao,
Sheldon.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-03 10:46:39 UTC
State Changed
From-To: open->closed

Deferred to author.
Comment 3 Sheldon Hearn 2000-07-04 08:53:49 UTC
On Mon, 03 Jul 2000 17:04:36 EST, Gerd Knops wrote:

> Agreed. Actually the current ee behavior seems consistent with other  
> tools when used as root. I still think a warning would be in order for  
> any tool writing to a file without write permision, but reality is  
> different.

At least one other person agrees with you that a warning is in order,
since vi(1) gives a warning.

So if you want to take this further, try to get hold of ee(1)'s author
and see if he's happy with the idea.  You can post his feedback as a
follow-up to your own PR by making sure that you use this subject line
and send a message to freebsd-gnats-submit@FreeBSD.org:

Subject: Re: bin/19611: ee silently overwrites write-protected files

Ciao,
Sheldon.