Bug 4890 - File locking problem
Summary: File locking problem
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.25a
Hardware: x86 FreeBSD
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-16 07:24 UTC by vwdragon
Modified: 2020-05-21 00:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vwdragon 2007-08-16 07:24:15 UTC
Hello..

File server freebsd 6.2-STABLE + samba-3.0.25a + ldap + acls

Problem:
I've a situation where file locking does not seem to be functioning as expected, in that
more than one user can open and write to a file without any
notifications being displayed about the file already being opened by
another user.

I have two Windows XP clients accessing the same shared file, user1 has
the file open. User2 then opens the
same file, receiving no warnings about the file being open by another
user. File is modified by user1 and saved and remains open. File then
modified by user2 and saved. File closed and opened by user1 who
sees only modifications made by user2.

user1 (WinXP) open test2.ods

smbstatus:
Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock SharePath   Name   Time
--------------------------------------------------------------------------------------------------
14758        10004      DENY_WRITE 0x2019f     RDWR   EXCLUSIVE+BATCH /work/samba/bazafirm   test2.ods   Wed Aug  1 17:50:15
14758        10004      DENY_NONE  0x100001    RDONLY     NONE
/work/samba/bazafirm   .   Wed Aug  1 17:49:47

user2 (WinXP) open file:
smbstatus:
Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock SharePath   Name   Time
--------------------------------------------------------------------------------------------------
14787        10002      DENY_WRITE 0x2019f     RDWR   EXCLUSIVE+BATCH /work/samba/bazafirm   test2.ods   Wed Aug  1 17:55:38
14787        10002      DENY_NONE  0x100001    RDONLY     NONE /work/samba/bazafirm   .   Wed Aug  1 17:55:12


But when I use option "force user = root" tha file lock works OK!!!

user1 open file test3.ods

Samba version 3.0.25a
Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock    SharePath   Name   Time
--------------------------------------------------------------------------------------------------
2103         0          DENY_WRITE 0x2019f     RDWR      EXCLUSIVE+BATCH  /work/samba/bazafirm   test3.ods   Thu Aug 16 05:32:28


user2 open file test3.ods (file is open "read mode")

smbstatus:
Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock    SharePath   Name   Time
--------------------------------------------------------------------------------------------------
2103         0          DENY_WRITE 0x2019f     RDWR       LEVEL_II    /work/samba/bazafirm   test3.ods   Thu Aug 16 05:32:28


Why? This is working only if I set option "force user = root"???
Comment 1 Björn Jacke 2020-05-21 00:42:25 UTC
please open a new bug requirest if you still see issues with a supported release like 4.11 or 4.12 currently.