s3:smbd: don't set kernel flock if "kernel share modes = no"
authorMichael Adam <obnox@samba.org>
Sat, 8 Sep 2012 08:52:28 +0000 (10:52 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 8 Sep 2012 11:05:05 +0000 (13:05 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Sep  8 13:05:05 CEST 2012 on sn-devel-104

source3/smbd/open.c

index e919b1392e568e47bce0eda191f7b40af2453ac7..bf2a6729bf6b7430003325aa259f8c5aeb3d6503 100644 (file)
@@ -2577,7 +2577,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
            the kernel refuses the operations then the kernel is wrong.
           note that GPFS supports it as well - jmcd */
 
-       if (fsp->fh->fd != -1) {
+       if (fsp->fh->fd != -1 && lp_kernel_share_modes(SNUM(conn))) {
                int ret_flock;
                ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
                if(ret_flock == -1 ){