1

I have files on a Samba server in the local company network and accessing them from a Windows Vista machine. Usually, if I want to delete a directory containing read-only files, Windows simply deletes the whole folder anyway. However, when I do this with a dir on the server, Windows just tells me that I need permissions (screenshot of an identical error message, just different file). The workaround is to remove the read-only flag from the directory and all contained files and then deleting. However, I have a TortoiseSVN versioned dir on the server, and the .svn dirs contain read-only files. I need to remove the read-only flags from the dir before every commit, or else it fails. This is quite distressing and shouldn't be so. Does someone know how to attack this problem? (If someone knows how to tell TortoiseSVN to not make its files read-only, that would probably be ok as well) ... Thanks!

EDIT:

The file in question is a shared file, i.e. I have no specific user account on the Samba server. Owner is nobody, and everyone has all rights to the file. If (in Windows) I set the file as "readonly", then (in Linux, Debian Lenny, where Samba is installed) everyone suddenly has absolutely no rights on the file anymore. If I remove the readonly flag, everyone has all rights again.

Here is the Samba config file smb.conf:

# Samba config file created using SWAT
# from 192.168.1.200 (192.168.1.200)
# Date: 2006/08/25 17:14:50

# Global parameters
[global]
        workgroup = FIRMA
        server string = %h server (Samba %v)
        security = SHARE
        obey pam restrictions = Yes
        passdb backend = ****
        passwd program = ****
        passwd chat = ****
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        panic action = /usr/share/samba/panic-action %d
        include = /etc/samba/dhcp.conf

[homes]
        comment = Home Directories
        create mask = 0700
        directory mask = 0700
        browseable = No

[shared]
        path = /baldur
        read only = No
        create mask = 0777
        directory mask = 0777
        guest only = Yes
        guest ok = Yes
        map archive = yes
        map system = yes
        map hidden = yes

EDIT 2:

baldur:/baldur/Mitarbeiter/Felix/Praktikum/projektrenate# ls -ld .svn
drwxrwxrwx 6 nobody nogroup 4096 15. Dez 19:34 .svn

baldur:/baldur/Mitarbeiter/Felix/Praktikum/projektrenate/.svn# ls -al
insgesamt 32
drwxrwxrwx 6 nobody nogroup 4096 15. Dez 19:34 .
drwxrwxrwx 5 nobody nogroup 4096 15. Dez 13:37 ..
-rwxrw-rw- 1 nobody nogroup   77 15. Dez 18:19 all-wcprops
-r-xr--r-- 1 nobody nogroup  236 15. Dez 18:19 entries
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 12:56 prop-base
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 12:56 props
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 18:19 text-base
drwxrwxrwx 5 nobody nogroup 4096 15. Dez 18:19 tmp
baldur:/baldur/Mitarbeiter/Felix/Praktikum/projektrenate/.svn# less entries
baldur:/baldur/Mitarbeiter/Felix/Praktikum/projektrenate/.svn# ls -al
insgesamt 32
drwxrwxrwx 6 nobody nogroup 4096 15. Dez 19:34 .
drwxrwxrwx 5 nobody nogroup 4096 15. Dez 13:37 ..
-rwxrw-rw- 1 nobody nogroup   77 15. Dez 18:19 all-wcprops
-rwxrw-rw- 1 nobody nogroup  236 15. Dez 18:19 entries
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 12:56 prop-base
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 12:56 props
drwxrwxrwx 2 nobody nogroup 4096 15. Dez 18:19 text-base
drwxrwxrwx 5 nobody nogroup 4096 15. Dez 18:19 tmp
baldur:/baldur/Mitarbeiter/Felix/Praktikum/projektrenate/.svn#
Felix Dombek
  • 127
  • 7

1 Answers1

1

You should export the project, not delete the .svn folders. See: http://svnbook.red-bean.com/en/1.0/re10.html

Edit: delete readonly = yes added to the share entry in samba configuration is fixing the problem of deleting folders that contain read only files. Thanks to @Felix Dombek

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83
  • I don't delete the .svn folders. TortoiseSVN needs to access and modify files in them when it's doing commits/updates. But the Samba NAS won't let it unless I remove the read-only flag from them. – Felix Dombek Dec 21 '10 at 15:39
  • can you please check the permissions on the .svn folder, the owner/group of the .svn folder and the user/groups that is used to mount the share? Or just print them here and replace/remove any confidential information. – Mircea Vutcovici Dec 21 '10 at 15:45
  • I think it is a problem with the `create mask`. Can you please tell me on which share you have the problem and give the output of `ls -ld .svn`? – Mircea Vutcovici Dec 21 '10 at 18:54
  • What exactly do you mean by "which share"? ... updated question again, it's too long to fit here! note `entries` – Felix Dombek Dec 21 '10 at 19:26
  • I was referring to samba share name, like `[shared]` in this case. I think it is an application issue, not a samba one. If you upgrade TurtoiseSVN is the problem solved? Also, could you give us the full error message that Windows is displaying when you try to delete a folder with R/O files? – Mircea Vutcovici Dec 22 '10 at 14:47
  • yes, `shared` is correct. My TortoiseSVN is fresh off it's homepage. The error message is this one: http://www-01.ibm.com/support/docview.wss?uid=swg21315271&aid=1 only with `entries`. – Felix Dombek Dec 22 '10 at 17:19
  • Try to add `delete readonly = yes` in samba configuration in the section `shared`. See:http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#id2539582 – Mircea Vutcovici Dec 22 '10 at 18:25
  • 1
    Cool! I added `map readonly = no` and `delete readonly = yes` (which is probably unneeded when unmapped, but anyway) and it seems to work fine now! Thanks a lot. – Felix Dombek Dec 23 '10 at 13:16
  • Can you please test which option is required? I think that only `delete readonly = yes` is required. – Mircea Vutcovici Dec 23 '10 at 15:24
  • I could do that next week. I believe you're right concerning deletion, but I wasn't sure what exactly TortoiseSVN does. Maybe it just needs to change the files' contents or rename them and I wasn't sure whether that would work as well. Unless someone really needs to set something as readonly on the NAS (which I doubt) the current method is ok. But to get a final answer on this issue, I will try your proposal. – Felix Dombek Dec 23 '10 at 21:51