[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: Cathy Fitzpatrick <cathy_at_cathyjf.com>
Date: Thu, 21 Nov 2013 01:37:47 -0700

Hi,

There was a potentially confusing typo in the comments in my patch, so
I've attached a version with the typo fixed. Note that the code itself
was fine, the typo was just in the comments.

Cheers,

Cathy

On Wed, Nov 20, 2013 at 6:07 PM, Cathy Fitzpatrick <cathy_at_cathyjf.com> wrote:
> Hello,
>
> 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.
>
> Here is an example of the current behaviour (before my patch):
>
> [Cathy_at_localhost subversion]$ ls -la INSTALL
> -rw-rw-r--. 1 Cathy Cathy 63057 Nov 20 17:34 INSTALL
> [Cathy_at_localhost subversion]$ ./svn patch patch.diff
> U INSTALL
> [Cathy_at_localhost subversion]$ ls -la INSTALL
> -rw-------. 1 Cathy Cathy 63070 Nov 20 17:58 INSTALL
>
> Notice that applying the patch has changed the permissions of INSTALL.
>
> After my patch, we instead get the following:
>
> [Cathy_at_localhost subversion]$ ls -la INSTALL
> -rw-rw-r--. 1 Cathy Cathy 63057 Nov 20 17:59 INSTALL
> [Cathy_at_localhost subversion]$ ./svn patch patch.diff
> U INSTALL
> [Cathy_at_localhost subversion]$ ls -la INSTALL
> -rw-rw-r--. 1 Cathy Cathy 63070 Nov 20 17:59 INSTALL
>
> As expected, patching the file no longer alters its permissions.
>
>
> I have attached my patch to this email and it includes a log message.
>
> Regards,
>
> Cathy

Received on 2013-11-21 09:38:29 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.