[Samba] Lock order violation and file lost
Jeremy Allison
jra at samba.org
Thu Apr 24 12:10:05 MDT 2014
On Thu, Apr 24, 2014 at 11:52:26AM -0400, Thomas Schulz wrote:
> I will probably file a bug about this, but perhaps someone here will
> have some ideas.
>
> We have a problem with files being deleted instead of being saved when
> making changes in Microsoft Excel. The log shows an error of:
> 'Lock order violation'. This is with Samba 4.1.6 and happens on both
> Linux (2.6.25-14.fc9.i686) and Solaris 10. No such problem when running
> Samba 3.6.22.
>
> We have a setup where we need to allow any user to edit an excel file.
> To allow this we have an ACL set on the directory and on the file to force
> wirte permission for group. The problem only occurs when the user doing
> the editing is not the current owneer of the file. Before the attempt to
> edit the file we have the file (as seen on Linux or Solaris):
>
> -rwxrwxr--+ 1 user1 users 2611248 Apr 23 14:02 glorp.xlsx*
>
> The directory and the file have the following ACLs.
> # file: .
> # owner: root
> # group: users
> user::rwx
> group::rwx #effective:rwx
> group:users:rwx #effective:rwx
> mask:rwx
> other:r-x
> default:user::rwx
> default:group::rwx
> default:group:users:rwx
> default:mask:rwx
> default:other:r-x
>
> # file: glorp.xlsx
> # owner: user1
> # group: users
> user::rwx
> user:user1:rwx #effective:rwx
> group::rwx #effective:rwx
> group:users:rwx #effective:rwx
> mask:rwx
> other:r--
>
> After making changes and trying to save the file, a pop up box says
> 'file not saved'. At this point the file is gone but we have the following
> files in the directroy.
>
> -rwxrwxr--+ 1 user1 users 2596791 Apr 23 13:39 F790B97D.tmp
> -rwxrwxr--+ 1 user2 users 165 Apr 23 14:01 ~$glorp.xlsx
>
> The F790B97D.tmp looks to be the original file without the changes.
What is in your smb.conf ? Are you storing DOS
attributes in extended EA's ?
As far as I can see in the code the offending
open_file_fchmod() can only get called if
'store dos attributes = no' (i.e. smbd is
trying to store DOS attrs in the filesystem
mode bits, not an EA).
Jeremy.
More information about the samba
mailing list