To set up an svn repository (running on arch linux) I would like to use my NAS to store the repository. I can only mount it with CIFS (smb).

At first there was an issue where the httpd user could not write to the file system which I solved by adding the options rm,file_mode=0777,dir_mode=777.

The next error message that appeared when trying to commit something to the repository was Can't set permission on ... which comes from the fact that there are not permissions that can be set because it is not a unix file system. Now I am thinking whether it would be possible to mount the share such that it is owned by httpd already with the permissions already set correctly.

So my question is now what file_mode and dir_mode must I chose for svn to accept it? Is it possible at all? And how would I mount a CIFS share with as a specific user. All information I could find on this topic so far did also contain the umask option which my OS does not want to accept because it has been replaced with file_mode and dir_mode if I understand correctly.

The fall-back option would of course be to not use the NAS but a normal disk and sync to the NAS with a job.

What further options do you need? I am using the latest (and updated) ARM version of Arch Linux and installed the apache svn as described here.

  • 1) it seems strange that you can't use NFS, 2) try a less open mode (755 or 750)
    – Archemar
    Commented Sep 23, 2015 at 11:06
  • The device I have available does not provide NFS support unfortunately. I will try the other modes you suggested. Commented Sep 23, 2015 at 11:42
  • 750 gives internal server error. 755 fails with "permission denied". Commented Oct 20, 2015 at 18:44

2 Answers 2

  1. Is selinux enabled, and if so, is the remote disk blessed to allow httpd to write to it?

  2. Is running your subversion client over ssh rather than http an option? I've found that running a commit as a local user (via ssh) sometimes allows writing to unconventionally mounted disks in cases where the httpd user cannot.

  3. To mount a cifs share as a specific user, you will have to have a password stored somewhere. Either directly in the options of the fstab or in a credentials file that's referenced in the mounting options. This Ubuntu thread might help: https://askubuntu.com/questions/157128/proper-fstab-entry-to-mount-a-samba-share-on-boot

  • 1. selinux is not enabled. 2. subversion client is running over https, commit as local user with ssh is not an option. 3. How to mount as http user? (I am not sure if this would sole the problem, but maybe it would). Commented Oct 20, 2015 at 19:45
  • Mounting as the http user would likely require creating a user with the same name (and maybe the same UID ) on the NAS box. Set the password from the NAS http user. Then try putting that username and password in the mount options on the box hosting subversion. That's pretty terrible security, but it might work.
    – Bendy
    Commented Oct 20, 2015 at 20:02
  • ... what I meant was mounting as a specific user, as described. Turned out it just requires to add uid=http as option to the fstab. Commented Oct 20, 2015 at 20:05

The solution in my case was to mount the disk with following fstab option

//server/share /mnt cifs username=USER,password=PSWD,rw,file_mode=0755,dir_mode=0755,uid=http 0 0

The important thing seems to be the uid=http option.

You must log in to answer this question.

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