Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to update a certain svn working copy remotely through php. For that, I have given www-data user write permission to the .svn folder (It is owned by someuser:www-data, and I have set directory permissions to 775).

However, after sometime, permissions on the directory automatically get reverted back to 755.

1) What is causing this and how to fix this?

2) I am bit uncomfortable giving www-data user write permissions to the directory. Is there an alternate way?

share|improve this question
1) Most likely SVN itself. We cannot know with such little details. 2) Why don't you just execute svn update? – m0skit0 Aug 31 '11 at 7:23
Cannot run svn update because it (svn update) needs to create .svn/lock file (for which www-data does not have permission) – tanon Aug 31 '11 at 7:47

Regarding the first question, you probably want to setup auditd to monitor the directory for permissions changes:

How do I set a watch on a file for auditing?

Let us say you would like to audit a /etc/passwd file. You need to type command as follows:

# auditctl -w /etc/passwd -p war -k password-file

Regarding your second question, it may be a better idea to give the www user sudo permission to another user to run the svn command alone, this way it can't write out random data there and if you want you could more closely control what it can do to the svn repo.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .