You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2012/11/28 21:36:40 UTC

Re: svn:executable is ignored on checkout form Windows to Samba share

Thorsten Schöning wrote on Wed, Nov 28, 2012 at 18:13:44 +0100:
> Hello,
> 
> I have some working copies on Samba shares, Ubuntu 12.04 LTS with all
> updates installed, which are accessed using TortoiseSVN 1.7.10 which
> uses Subversion 1.7.7. Some of those working copies contain executable
> Perl scripts with proper svn:executable defined as *, but depending on
> my Samba configuration the executable bit gets set or not. It only
> gets set if Smaba is configured to force specific permissions
> including the executable bit. If I checkout natively using a
> Subversion client on the shell the executable bits get properly
> applied.
> 
> Is the svn:executable property completely ignored on operations which
> are applied using Windows clients? I thought/hoped that Windows just

I think this is the code you're looking for:

 631   /* Tweak the on-disk file according to its properties.  */
 632 #ifndef WIN32
 633   if (props && apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
 634     SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE, FALSE,
 635                                        scratch_pool));
 636 #endif

What will happen is that, whenever a file is modified (eg, by 'update'
or 'switch'), the Windows client will write a new file and rename(2) it
on top of the old file... resetting the +x bit (to its default value) in
the process.

And that's one of the reasons behind the standard recommendation not to
access a single working copy from multiple systems, especally windows
and non-windows.

> ignores anything regarding svn:executable if it's done to itself but
> Samba could maybe recognize those permissions. This doesn't seem to be
> the case.
> 
> If Windows clients ignore applying svn:executable, do you have any
> ideas on how I could configure Samba to just apply it on Perl scripts?

You might try 'revert' or 'cleanup'.  But keep in mind that being able
to share a wc across operating systems might not work indefintiely...

> The shares are pretty general and I don't want e.g. CSS files to have
> the executable bit set. The only solution I found was a cron job
> regularly finding and fixing Perl scripts as Samba doesn't seem to
> provide any file type filters.
> 
> Thanks for any hints.
> 
> Mit freundlichen Grüßen,
> 
> Thorsten Schöning
> 
> -- 
> Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
> 
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
> 
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
> 

Re: svn:executable is ignored on checkout form Windows to Samba share

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Daniel Shahaf,
am Mittwoch, 28. November 2012 um 21:36 schrieben Sie:

> And that's one of the reasons behind the standard recommendation not to
> access a single working copy from multiple systems, especally windows
> and non-windows.

Thanks, looks like I would really be better off changing some habits.

> You might try 'revert' or 'cleanup'.

I decided for a little script like the following which just adds the
execute permissions for needed files and should be faster.

# Iterator given directories, search files, change permissions:
for dir in "$@"
do
  if [ ! -d "$dir" ]; then
    continue
  fi

  # Recursively find all Perl files which don't have any execute bit set:
  for file in $(find "$dir" -type f -iname "*.pl" ! -perm /111 -exec echo {} \;)
  do
    # svn:executable is a flag which stores * as value:
    if [ "`svn propget svn:executable "$file" 2> /dev/null`" ]; then
      chmod ug+x "$file"
    fi
  done
done

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow