Re: New repo quickly corrupted
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Nov 15, 2007, 22:37 UTC
- Message-ID
- <alpine.LFD.0.9999.0711151434290.4260@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.0.9999.0711151708470.21255@xanadu.home>
On Thu, 15 Nov 2007, Nicolas Pitre wrote:
> > Does "dos2unix" override file access bits? Because the object store is > always made read-only.
Almost all programs like that will entirely ignor the fact that something is read-only.
Why? Becuase you end up having to create a new file *anyway*. So nobody does modify-in-place, they literally end up doing
- create temp-file - while (data) read old file, write to tempfile - rename temp-file over oldfile
and unless you *explicitly* look at the permission bits you'll never even notice that the old file was read-only, because none of the steps above care at all!
So marking things read-only will give only limited protection. It will protect against most editors, and will protect against things that change files in-place and literally try to open the original file as read-write, but not much else.
Linus