[Samba] Read only behaviour of a file when opened two or more times.

Sebastien Torres Sebastien.Torres at pgs.com
Wed Dec 19 16:46:01 MST 2012


Hello,
My samba server (version samba-3.0.33-3.39.el5_8) on CentOS 5.8 (kernel 2.6.18-308.1.1.el5) opens files as read only once it has been opened from the second time onwards.  The first time the file is opened, it is possible to edit the file and save these changes.  Once the file has been closed and then opened again, it is opened as a read only file and when making changes, it is not possible to save using the same file name however a different name needs specifying (save as).
In smbd.log I see some of the following, sanitised:

Works:-
[2012/12/19 22:10:48, 4] smbd/open.c:open_file_ntcreate(1605)
  calling open_file with flags=0x2 flags2=0x0 mode=0744, access_mask = 0x20196, open_access_mask = 0x20196
[2012/12/19 22:10:48, 2] smbd/open.c:open_file(391)
  USER opened file FILE read=No write=Yes (numopen=2)

Doesn't work:-
[2012/12/19 22:10:48, 3] smbd/vfs.c:reduce_name(922)
  reduce_name: FILE reduced to /path/FILE
[2012/12/19 22:10:48, 4] smbd/open.c:open_file_ntcreate(1605)
  calling open_file with flags=0x0 flags2=0x0 mode=0744, access_mask = 0x20089, open_access_mask = 0x20089
[2012/12/19 22:10:48, 2] smbd/open.c:open_file(391)
  USER opened file FILE read=Yes write=No (numopen=2)

Note the difference in access_mask and open_access_mask.

This is something that has recently developed, my colleagues nor I have made changes to the samba config.  The windows attributes on the file do not have 'read only' checked.  The share is an nfs export from a netapp, again, no configurations have been made.  'read only = No', 'map read-only = no' and 'readonly = no' has been set in /etc/samba/smb.conf.

Has anyone seen this kind of behaviour?
Help would be greatly appreciated, thanks in advance.

Regards,
Sebastien

Sébastien Torres
Desktop Administrator – GlobalIT - PGS<http://www.pgs.com/>
T: +44 1 932 376 505  | M: +44 7 787 743 974 | VOIP: 74416505

This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.


More information about the samba mailing list