Search code examples
linuxfile-permissions

Linux permissions on files checked out from SVN


The server we use is configured to not run PHP scripts if the file is group writable. We use SVN to deploy projects on the server (essentially they are working copies we never make changes to or commit from). The release versions are copied to tags and then on the server we svn switch to the new tag.

This used to work great, but for one of our projects whenever we svn switch to a new version, the files are set to -rw-rw-r--. So after each deployment we need to manually do a "chmod -R g-w ./".

Any idea why this is happening and how to make SVN write files with the desired permissions.


Solution

  • This had nothing to do with SVN, but with default permissions. It appears the way to set the default permissions new files created is to do:

    setfacl -d -m g::r ./

    The -d flag changes the default permissions. -m modifies them and g::r means set only r for g.