summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_gpfs.c
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2015-04-29 16:53:04 +0200
committerJeremy Allison <jra@samba.org>2015-04-29 23:42:20 +0200
commitd748652e5b1c1c0238a2b86cdf14d7f6de7ce9b2 (patch)
tree4f3ef6aa38c07024276d7dbb5bb93d808e06eb6b /source3/modules/vfs_gpfs.c
parent57303c30b24630f54dc15455ee6c1d20de04ab4f (diff)
downloadsamba-d748652e5b1c1c0238a2b86cdf14d7f6de7ce9b2.tar.gz
vfs: kernel_flock and named streams
Streams implementing VFS modules may implement streams in a way that the fsp will have the basefile open in the fsp fd, so lacking a distinct fd for the stream, kernel_flock will apply on the basefile which is wrong. The actual check is deffered to the VFS module implementing the kernel_flock call. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11243 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules/vfs_gpfs.c')
-rw-r--r--source3/modules/vfs_gpfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index c8ba563f14c..6ab17d5026b 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -135,6 +135,16 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
return 0;
}
+ /*
+ * A named stream fsp will have the basefile open in the fsp
+ * fd, so lacking a distinct fd for the stream we have to skip
+ * kernel_flock and set_gpfs_sharemode for stream.
+ */
+ if (!is_ntfs_default_stream_smb_fname(fsp->fsp_name)) {
+ DEBUG(2,("%s: kernel_flock on stream\n", fsp_str_dbg(fsp)));
+ return 0;
+ }
+
kernel_flock(fsp->fh->fd, share_mode, access_mask);
if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {