Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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

http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.