[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Make working copies read-only.

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2001-11-30 16:45:00 CET

On Fri, 2001-11-30 at 10:26, Kevin Pilch-Bisson wrote:
> > We should only wind up with a read-only file in the working copy if we
> > open it read-only when we create it or set it read-only afterwards.
> We don't create it here, we copy it from .svn.

Creation is a step in copying (when the target file doesn't exist). Six
of one, a half-dozen of the other.

> > > I'm afraid we might run into problems when try to mv over files in text-base
> > > from tmp/text-base, since text-base will be read-only. This would
> > > mean we would need to stat the file, make it writable, mv the file,
> > > then set it back to its original perms.

> > There is no problem moving a non-writable file. The only permissions
> > issues for moving are on the source and target directories.

> [...]
> kevin@pilchie:~ [576]$ cp A B
> cp: cannot create regular file `B': Permission denied

> The same thing happens with copies too. It may be possible with the rename()
> system call, but it won't be with the way apr_copy_file is implemented.

Unless I'm terribly mistaken, we shouldn't be doing anything like "cp A
B" when we move files from tmp/text-base to text-base. We should be
unlinking the target and calling rename().

If we have to do a copy instead of a rename for some reason (such as
portability), then we should unlink the target first, if we know we
might be trying to replace a non-writable file.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:50 2006

This is an archived mail posted to the Subversion Dev mailing list.