The Samba-Bugzilla – Bug 5685
Fail to append to a writable only file in ver 3 and above (ver 2 OK)
Last modified: 2009-08-14 14:11:57 UTC
In the current working setup, we have Samba 2.2.8 running on a AIX 5.3 server.
Most of the data shared over Samba is mounted over NFS from a FileServer (Solaris). Note here that we have ACLs set at the FileServer side.
One of the files have rwxrwx-wx permissions which allow anyone to append data to it (tested from Windows using the cmd: echo "test" >> \\smbserver\share\testfile).
I'm trying to migrate to Samba 3 (3.0 or 3.2), however I'm having two issues:
- 1st the append mode doesn't work anymore and the above command return "Permission denied"!
Further analysis of the logs shows that ver 2.2.8 fails to open the file for RW and than does the open for write only!. In ver 3.0 and 3.2, it does only the try for RW mode and fails!
+ Why is this difference between the two versions (2 vs. 3)?
+ Is this a normal behaivor? or is there a way to set some parameters to allow the append mode?
PS. Note here that at the Unix OS level, everyone can append to the file.
- 2nd issue is related to ACLs as it seems that they are taken into account in ver 2.2.8 but not in 3.0 and 3.2.
In general, looks for me like, starting from ver 3, Samba is handling some extra verifications and not allowing the OS itself to check for the user's real permissions! Is this true somehow? Is there a way to force Samba to use the real OS permissions?
(In reply to comment #0)
I'm having trouble too.
I have folders on server with permissions like rwxrws-wx and was working fine.
When I try to update to samba 3.2.5 on debian Lenny, I cannot write to that folders anymore.
Jeremy, any idea what is going on here ?
If a client only requests WRITE_DATA on an NTCreateX open we correctly map this to O_WRONLY, so this should work in the latest 3.2.13 and above. Volker added a fix to allow smbd to traverse directories with no permissions granted for read (dropboxes) recently, not sure what version that went into but it might also be needed.
Please upgrade to a recent 3.2, 3.3 or 3.4 and re-test.
(In reply to comment #3)
Sorry the issue is still there!
First I have to mention that my second reported issue related to ACLs can be fixed by setting the "acl check permissions" to NO in the conf file.
For the first issue related to appending to a writable only file, I did the testing again on Samba 3.4.0, 22.214.171.124 and 126.96.36.199 on a file owned by myself with 300 permissions and tried to append a line to it using Windows command prompt without success. I also tried to open it in an append mode using TCL without success too.
Please note here that I'm unstalling the PWARE binary distributions for AIX (http://pware.hvcc.edu/download/aix53/).