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

Re: `svn co` creates files with wrong permissions

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 1 Nov 2009 09:59:25 +0100

On Sun, Nov 01, 2009 at 03:23:29AM +0100, Arfrever Frehtes Taifersar Arahesis wrote:
> 2009-11-01 02:34:06 Arfrever Frehtes Taifersar Arahesis napisaƂ(a):
> > `svn co` (and `svn up`) creates files with wrong permissions. This problem
> > doesn't occur with Subversion 1.6.x_at_HEAD, so it's a regression in trunk.
> > I use Subversion trunk_at_40332.
> This regression has been introduced in r40264.

This happens because we now use mkstemp() to create temporary files
in many places, and mkstemp() locks down permissions to 0600. The temp
file is then copied to the working copy and permissions aren't adjusted.
So the (very old) bug you ran into is that instead of adjusting permissions,
svn is using the permissions of the tempfile unaltered, even though those
permissions might not make sense in the WC.
Note that on win32 all files inherit their perms from their parent
folder and we have no way to override this yet. So this problem only
happens on UNIX.

I ran into a similar problem before, see r40275. Specifically, see the change
made to libsvn_wc/copy.c:copy_file_administratively in r40275. It shows an
example of how the problem can be fixed by doing a single svn_io_copy_perms()
call after installing the temp file in the working copy. If there is no
source file to copy perms from (you can even pass NULL for 'src'), the
destination will automatically get default permissions, which should honour
the umask.


Received on 2009-11-01 10:00:05 CET

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