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

Re: Fwd: [PATCH] Fix for `svn patch` changing permissions of patched files

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 22 Nov 2013 13:31:00 +0000

Branko Čibej <brane_at_wandisco.com> writes:

>
> We're obviously making a lot of assumptions about which permissions are
> correct. When we replace a file in the working copy, we should copy the
> file's permissions, not invent new ones based on either the source
> (which may be an arbitrary temporary file) or the umask.
>
> Of course, this is moderately easy on Unix (ignoring filesystems that
> support ACLs) and quite a major pain on Windows.

Yes, I think the aim of preserving the permissions when replacing files
is good. We also want to avoid changing the permissions of files in the
system temporary dir, those should remain 600. Running 'svn diff' on a
working copy that has a file that requires translation reveals two
different bugs that cause files in the system temp dir to have their
permissions changed:

   - svn_subst_copy_and_translate4 uses the parent directory of a
     temporary file as the temporary directory for a call to
     svn_io_open_unique_file3. That causes svn_io_open_unique_file3 to
     set the permissions on the file according to umask.

   - svn_subst_copy_and_translate4 copies the permissions from the
     working file to a file in the system temp dir.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2013-11-22 14:31:39 CET

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