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

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

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 21 Nov 2013 11:19:34 +0000

Cathy Fitzpatrick <cathy_at_cathyjf.com> writes:

> Currently the `svn patch` command changes the permissions on any file
> it patches to 600. This occurs because it creates a file under the
> system temporary directory for applying the patch, and then copies
> this file to the final destination. `apr_file_mktemp` sensibly assigns
> mode 600 to files created under the system temporary directory to
> avoid them being exposed to the entire system. So the result is that
> any file that `svn patch` patches ends up with 600 permissions rather
> than whatever it had before.

Patch is no different from other commands like revert and update in this
behaviour:

$ ls -l wc/A/f
-rw-r--r-- 1 pm pm 2 Nov 21 10:46 wc/A/f

$ # change permissions with patch
$ (umask 077 ; svn patch x.x wc)
U wc/A/f
$ ls -l wc/A/f
-rw------- 1 pm pm 5 Nov 21 10:47 wc/A/f

$ # change permissions with revert
$ (umask 070 ; svn revert -R wc)
Reverted 'wc/A/f'
$ ls -l wc/A/f
-rw----rw- 1 pm pm 2 Nov 21 10:50 wc/A/f

$ # change permissions with update
(umask 007 ; xsvn up wc)
Updating 'wc':
U wc/A/f
Updated to revision 2.
$ ls -l wc/A/f
-rw-rw---- 1 pm pm 8 Nov 21 10:51 wc/A/f

Is there some justification for changing patch so that it is different
from the other commands? Should we change all commands?

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2013-11-21 12:20:15 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.