From owner-freebsd-questions@freebsd.org Sat Jan 9 22:48:15 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64362A6A76A for ; Sat, 9 Jan 2016 22:48:15 +0000 (UTC) (envelope-from lukasz@chroot.pl) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 48DF1117D for ; Sat, 9 Jan 2016 22:48:15 +0000 (UTC) (envelope-from lukasz@chroot.pl) Received: by mailman.ysv.freebsd.org (Postfix) id 460CBA6A769; Sat, 9 Jan 2016 22:48:15 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD04A6A768 for ; Sat, 9 Jan 2016 22:48:15 +0000 (UTC) (envelope-from lukasz@chroot.pl) Received: from mail.apsz.com.pl (mail.apsz.com.pl [91.217.18.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A025A117C for ; Sat, 9 Jan 2016 22:48:14 +0000 (UTC) (envelope-from lukasz@chroot.pl) Received: from chroot.pl (89-78-33-126.dynamic.chello.pl [89.78.33.126]) by mail.apsz.com.pl (Postfix) with ESMTPS id 785D54566F for ; Sat, 9 Jan 2016 23:48:12 +0100 (CET) Subject: Re: samba and file locks - solved To: questions@freebsd.org References: <568E80EF.4090001@chroot.pl> From: Lukasz Message-ID: <56918DEC.7070503@chroot.pl> Date: Sat, 9 Jan 2016 23:47:08 +0100 User-Agent: WebMail MIME-Version: 1.0 In-Reply-To: <568E80EF.4090001@chroot.pl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.0 required=4.0 tests=BAYES_50,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.apsz.com.pl X-Virus-Scanned: clamav-milter 0.99 at mail.apsz.com.pl X-Virus-Status: Clean X-Spam-Level: ** X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 22:48:15 -0000 Hello again, Sysctl security.bsd.see_other_gids variable caused problems with file locks. If it's set to 0 the problem appears. If it is set to 1 (default) everything works as expected. Regards Lukasz On 01/07/2016 04:14 PM, FreeBSD wrote: > Hello, > > I have a problem with file locks on share. My server is running > FreeBSD 10.2 (amd64), samba 4.3.3 (ROLE_ACTIVE_DIRECTORY_DC) and ZFS > pool (raidz) as a windows share. > There is a strange behavior when I open a file from one windows > workstation (smbstatus shows DENY_WRITE and everything seems right) and > after about 5 minutes later I open the same file, which is still edited > on first computer, from other windows workstation. At this moment I > should see a warning message which inform that the file is going to be > opened in read-only mode but nothing happen. The file is opened normally > in read-write mode, so I can write into this file from both workstations > at the same time overwriting data! It looks like the file lock doesn't > work any more. > > log.smbd shows: > ../source3/smbd/close.c:268(close_remove_share_mode) > close_remove_share_mode: Could not get share mode lock for file > data/filename > > I noticed the same situation with share based on UFS. > > Below is my smb4.conf. > > [global] > dos charset = CP852 > unix charset = ISO8859-2 > workgroup = WORKGROUP > realm = somedomain.int > server role = active directory domain controller > passdb backend = samba_dsdb > min receivefile size = 16384 > kernel change notify = No > dns forwarder = 192.168.1.1 > nsupdate command = /usr/local/bin/samba-nsupdate -g > rpc_server:tcpip = no > rpc_daemon:spoolssd = embedded > rpc_server:spoolss = embedded > rpc_server:winreg = embedded > rpc_server:ntsvcs = embedded > rpc_server:eventlog = embedded > rpc_server:srvsvc = embedded > rpc_server:svcctl = embedded > rpc_server:default = external > winbindd:use external pipes = true > idmap config nc:range = 10000-20000 > idmap config nc:backend = ad > idmap_ldb:use rfc2307 = yes > idmap config * : backend = tdb > aio read size = 16384 > aio write size = 16384 > aio write behind = true > write cache size = 262144 > map archive = No > map readonly = no > store dos attributes = Yes > vfs objects = dfs_samba4 acl_xattr > > [sysvol] > path = /var/db/samba4/sysvol > read only = No > vfs objects = acl_xattr > > [SHARE1] > comment = SHARE1 > path = /mnt/zfs_share/SHARE1 > read only = No > guest ok = Yes > map acl inherit = Yes > oplocks = No > level2 oplocks = No > vfs objects = zfsacl > nfs4:chown = Yes > nfs4:acedup = dontcare > nfs4:mode = simple > > Is this a bug in samba? Or I missed something. > > Thank you for any suggestions. > > Regards > > Lukasz > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >