[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue May 11 16:39:02 UTC 2021
The branch, master has been updated
via 3f57c6bba67 VFS: Update status of SMB_VFS_STREAMINFO
via 1928459d388 s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used
via a8e786cff49 s3/modules: VFS: glusterfs: Remove SMB_VFS_STREAMINFO
via 9fca2ae73ac s3/modules: VFS: unityed_media: Remove SMB_VFS_STREAMINFO
via 8df9d738f55 s3/modules: VFS: stream_xattr: Remove SMB_VFS_STREAMINFO
via 1faf2ed294b s3/modules: VFS: streams_depo: Remove SMB_VFS_STREAMINFO
via c6eef9cdf17 s3/modules: VFS: media_harmony: Remove SMB_VFS_STREAMINFO
via 98c20b3aa33 s3/modules: VFS: fruit: Remove SMB_VFS_STREAMINFO
via d7894f63f4a s3/modules: VFS: catia: Remove SMB_VFS_STREAMINFO
via 697dd778628 s3: Remove vfs_streaminfo function
via 4bca55aea10 s3/module: VFS: fruit: vfs_streaminfo -> vfs_fstreaminfo
via 631ab9eff78 s3/lib: adouble: vfs_streaminfo -> vfs_fstreaminfo
via 250b2496bda s3/smbd: open: vfs_streaminfo -> vfs_fstreaminfo
via 8331852d6be s3/smbd: filename: vfs_streaminfo -> vfs_fstreaminfo
via 2b9b1c24d48 s3/smbd: close vfs_streaminfo->vfs_fstreaminfo
via 89e2dbafee6 s3/smbd: trans2: vfs_streaminfo -> vfs_fstreaminfo
via 40d44601cf1 s3/smbd: ntrans: vfs_streaminfo -> vfs_fstreaminfo
via 4842710aaa7 s3/smbd: add new toplevel vfs_fstreaminfo wrapper
via a8eb80a5788 s3: VFS: streams_xattr: Add impl for SMB_VFS_FSTREAMINFO
via a23667a03a3 s3: VFS: streams_depot SMB_VFS_FSTREAMINFO impl
via de29a2a0768 s3: VFS: glusterfs: Initialise fstreaminfo_fn to NULL
via 8e469af3cf3 s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO
via f2a243512fa s3: VFS: catia: Implement SMB_VFS_FSTREAMINFO
via 64af0aeb23d VFS: Add SMB_VFS_FSTREAMINFO
from 556b114f11c audit logging tests: Fix flapping test
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 3f57c6bba67b5250f402bf6a346acb12707f7b33
Author: Noel Power <noel.power at suse.com>
Date: Thu Apr 29 15:41:28 2021 +0100
VFS: Update status of SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue May 11 16:38:40 UTC 2021 on sn-devel-184
commit 1928459d388d6665cef0297fe18072b55277bbe1
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:55:35 2021 +0100
s3: VFS: Remove SMB_VFS_STREAMINFO(), no longer used
---------------
/ \
/ REST \
/ IN \
/ PEACE \
/ \
| |
| SMB_VFS_STREAMINFO |
| |
| |
| 28 April |
| 2021 |
| |
| |
*| * * * | *
_________)/\\_//(\/(/\)/\//\/\////|_)_______
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a8e786cff4981a81406273d9c6ac2dc9e186165a
Author: Jeremy Allison <jra at samba.org>
Date: Mon May 10 15:07:35 2021 -0700
s3/modules: VFS: glusterfs: Remove SMB_VFS_STREAMINFO
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 9fca2ae73ace3912b72f1eb506090d1bdd846edb
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:42:37 2021 +0100
s3/modules: VFS: unityed_media: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8df9d738f55a04e181fe51ed7644a24226bb9cee
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:40:07 2021 +0100
s3/modules: VFS: stream_xattr: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1faf2ed294bdc1c97a003c309e758e1318e23ef7
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:32:33 2021 +0100
s3/modules: VFS: streams_depo: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit c6eef9cdf174b85bbc39c5b6e9486f3301b29792
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:30:23 2021 +0100
s3/modules: VFS: media_harmony: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 98c20b3aa33a510fcf98c5fc0234668a625e2b21
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 17:20:21 2021 +0100
s3/modules: VFS: fruit: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit d7894f63f4abf2c0fe139383a43d11f7e9612aa6
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 16:13:55 2021 +0100
s3/modules: VFS: catia: Remove SMB_VFS_STREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 697dd7786288bdb2f2fb3d0a4ffcdc66c7521a1d
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 16:59:11 2021 +0100
s3: Remove vfs_streaminfo function
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4bca55aea1072113564b610f8bc8f7a21a0f69a9
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 16:58:35 2021 +0100
s3/module: VFS: fruit: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 631ab9eff78c89d0b9df32eeec56f6efe07e5e4b
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 16:00:52 2021 +0100
s3/lib: adouble: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 250b2496bda37d28a78d79feee9f87f97088d460
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 15:35:59 2021 +0100
s3/smbd: open: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8331852d6becad1aeef25890774a4b0761b7a87a
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 15:10:07 2021 +0100
s3/smbd: filename: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 2b9b1c24d48b1fd5bd956613512f82b17a481164
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 14:33:02 2021 +0100
s3/smbd: close vfs_streaminfo->vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 89e2dbafee67387a6e98fe81d730176349205c54
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 13:59:22 2021 +0100
s3/smbd: trans2: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 40d44601cf1f5245fd0625d2a1b43316cae1eb62
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 13:13:36 2021 +0100
s3/smbd: ntrans: vfs_streaminfo -> vfs_fstreaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4842710aaa7d14aec83e70d8d9dbbf465c3c4c1f
Author: Noel Power <noel.power at suse.com>
Date: Wed Apr 28 09:51:05 2021 +0100
s3/smbd: add new toplevel vfs_fstreaminfo wrapper
This will allow for calling SMB_VFS_FSTREAMINFO in a piecemeal
fashion, at the end of the patch set vfs_fstreaminfo will replace
vfs_streaminfo
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a8eb80a5788b1eaafb14e54045a132c03036cfae
Author: Noel Power <noel.power at suse.com>
Date: Tue Apr 27 16:57:57 2021 +0100
s3: VFS: streams_xattr: Add impl for SMB_VFS_FSTREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a23667a03a33845b0dcf237839ceb978e8439a7c
Author: Noel Power <noel.power at suse.com>
Date: Tue Apr 27 16:51:35 2021 +0100
s3: VFS: streams_depot SMB_VFS_FSTREAMINFO impl
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit de29a2a07686dfbc0a7c1aba30fb137ff0684b29
Author: Noel Power <noel.power at suse.com>
Date: Tue Apr 27 16:14:27 2021 +0100
s3: VFS: glusterfs: Initialise fstreaminfo_fn to NULL
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8e469af3cf3d0c9f1eb82ec74097d685326a649a
Author: Noel Power <noel.power at suse.com>
Date: Tue Apr 27 16:09:35 2021 +0100
s3: vfs: fruit: Implement SMB_VFS_FSTREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit f2a243512fabdc6302e909f133eee7d900204a12
Author: Noel Power <noel.power at suse.com>
Date: Tue Apr 27 15:49:36 2021 +0100
s3: VFS: catia: Implement SMB_VFS_FSTREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 64af0aeb23ded0917d972701577a18d30fc9df61
Author: Noel Power <noel.power at suse.com>
Date: Fri May 7 16:11:46 2021 -0700
VFS: Add SMB_VFS_FSTREAMINFO
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
examples/VFS/skel_opaque.c | 13 ++++----
examples/VFS/skel_transparent.c | 16 +++++-----
source3/include/vfs.h | 34 ++++++++++----------
source3/include/vfs_macros.h | 5 +++
source3/lib/adouble.c | 4 +--
source3/modules/The_New_VFS.org | 2 +-
source3/modules/The_New_VFS.txt | 2 +-
source3/modules/vfs_catia.c | 29 +++++++++++------
source3/modules/vfs_default.c | 59 +++++++++++++++--------------------
source3/modules/vfs_fruit.c | 13 ++++----
source3/modules/vfs_full_audit.c | 35 ++++++++++-----------
source3/modules/vfs_glusterfs.c | 2 +-
source3/modules/vfs_media_harmony.c | 47 ----------------------------
source3/modules/vfs_not_implemented.c | 5 ++-
source3/modules/vfs_streams_depot.c | 46 ++++++++-------------------
source3/modules/vfs_streams_xattr.c | 33 +++++---------------
source3/modules/vfs_time_audit.c | 9 +++---
source3/modules/vfs_unityed_media.c | 41 ------------------------
source3/smbd/close.c | 4 +--
source3/smbd/filename.c | 4 +--
source3/smbd/nttrans.c | 4 +--
source3/smbd/open.c | 4 +--
source3/smbd/proto.h | 4 +--
source3/smbd/trans2.c | 6 ++--
source3/smbd/vfs.c | 33 ++++++++++++++------
25 files changed, 167 insertions(+), 287 deletions(-)
Changeset truncated at 500 lines:
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 56d2e42d160..256ab2a5e41 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -628,12 +628,11 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
return NT_STATUS_INVALID_DEVICE_REQUEST;
}
-static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *num_streams,
- struct stream_struct **streams)
+static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *num_streams,
+ struct stream_struct **streams)
{
return NT_STATUS_NOT_IMPLEMENTED;
}
@@ -1057,7 +1056,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.fget_compression_fn = skel_fget_compression,
.set_compression_fn = skel_set_compression,
- .streaminfo_fn = skel_streaminfo,
+ .fstreaminfo_fn = skel_fstreaminfo,
.get_real_filename_fn = skel_get_real_filename,
.connectpath_fn = skel_connectpath,
.brl_lock_windows_fn = skel_brl_lock_windows,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index c5bcc5314d8..dfb324d52a3 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -840,16 +840,14 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
compression_fmt);
}
-static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *num_streams,
- struct stream_struct **streams)
+static NTSTATUS skel_fstreaminfo(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *num_streams,
+ struct stream_struct **streams)
{
- return SMB_VFS_NEXT_STREAMINFO(handle,
+ return SMB_VFS_NEXT_FSTREAMINFO(handle,
fsp,
- smb_fname,
mem_ctx,
num_streams,
streams);
@@ -1363,7 +1361,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.fget_compression_fn = skel_fget_compression,
.set_compression_fn = skel_set_compression,
- .streaminfo_fn = skel_streaminfo,
+ .fstreaminfo_fn = skel_fstreaminfo,
.get_real_filename_fn = skel_get_real_filename,
.connectpath_fn = skel_connectpath,
.brl_lock_windows_fn = skel_brl_lock_windows,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index eaa816d8bec..1af6bdec1fe 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -349,6 +349,7 @@
* Version 45 - Remove SMB_VFS_CHMOD
* Version 45 - Add SMB_VFS_FNTIMES
* Version 45 - Remove SMB_VFS_NTIMES
+ * Version 45 - ADD SMB_VFS_FSTREAMINFO
*/
#define SMB_VFS_INTERFACE_VERSION 45
@@ -1112,12 +1113,11 @@ struct vfs_fn_pointers {
char *base_path,
char *snap_path);
- NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *num_streams,
- struct stream_struct **streams);
+ NTSTATUS (*fstreaminfo_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *num_streams,
+ struct stream_struct **streams);
int (*get_real_filename_fn)(struct vfs_handle_struct *handle,
const struct smb_filename *path,
@@ -1586,12 +1586,11 @@ struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
uint64_t smb_vfs_call_fs_file_id(struct vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
-NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *num_streams,
- struct stream_struct **streams);
+NTSTATUS smb_vfs_call_fstreaminfo(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *num_streams,
+ struct stream_struct **streams);
int smb_vfs_call_get_real_filename(struct vfs_handle_struct *handle,
const struct smb_filename *path,
const char *name,
@@ -2047,12 +2046,11 @@ NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
struct files_struct *fsp,
uint16_t compression_fmt);
-NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *num_streams,
- struct stream_struct **streams);
+NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *num_streams,
+ struct stream_struct **streams);
int vfs_not_implemented_get_real_filename(struct vfs_handle_struct *handle,
const struct smb_filename *path,
const char *name,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 40ff68aedab..3769593c2e4 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -353,6 +353,11 @@
#define SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx, num_streams, streams) \
smb_vfs_call_streaminfo((handle)->next, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
+#define SMB_VFS_FSTREAMINFO(fsp, mem_ctx, num_streams, streams) \
+ smb_vfs_call_fstreaminfo((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (num_streams), (streams))
+#define SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx, num_streams, streams) \
+ smb_vfs_call_fstreaminfo(handle->next, (fsp), (mem_ctx), (num_streams), (streams))
+
#define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) \
smb_vfs_call_get_real_filename((conn)->vfs_handles, (path), (name), (mem_ctx), (found_name))
#define SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx, found_name) \
diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index 8a34d6ba074..bfbdb3f9709 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -1603,9 +1603,7 @@ static bool ad_unconvert_get_streams(struct vfs_handle_struct *handle,
return false;
}
- status = vfs_streaminfo(handle->conn,
- fsp,
- fsp->fsp_name,
+ status = vfs_fstreaminfo(fsp,
mem_ctx,
num_streams,
streams);
diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org
index 19dd46f9fe1..b3437ecb7c2 100644
--- a/source3/modules/The_New_VFS.org
+++ b/source3/modules/The_New_VFS.org
@@ -290,7 +290,7 @@ whenever VFS access is done in a piecemeal fashion.
| SMB_VFS_SNAP_DELETE() | [[Disk][Disk]] | - |
| SMB_VFS_STAT() | [[Path][Path]] | Todo |
| SMB_VFS_STATVFS() | [[Disk][Disk]] | - |
-| SMB_VFS_STREAMINFO() | [[Path][Path]] | Todo |
+| SMB_VFS_STREAMINFO() | [[Path][Path]] | - |
| SMB_VFS_STRICT_LOCK_CHECK() | [[fsp][fsp]] | - |
| SMB_VFS_SYMLINKAT() | [[NsC][NsC]] | - |
| SMB_VFS_SYS_ACL_BLOB_GET_FD() | [[xpathref][xpathref]] | - |
diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt
index 51e7d347a16..7b97f8a0fce 100644
--- a/source3/modules/The_New_VFS.txt
+++ b/source3/modules/The_New_VFS.txt
@@ -358,7 +358,7 @@ Table of Contents
SMB_VFS_SNAP_DELETE() [Disk] -
SMB_VFS_STAT() [Path] Todo
SMB_VFS_STATVFS() [Disk] -
- SMB_VFS_STREAMINFO() [Path] Todo
+ SMB_VFS_STREAMINFO() [Path] -
SMB_VFS_STRICT_LOCK_CHECK() [fsp] -
SMB_VFS_SYMLINKAT() [NsC] -
SMB_VFS_SYS_ACL_BLOB_GET_FD() [xpathref] -
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 7cb9a8a1433..c87fdda2239 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -908,9 +908,8 @@ static int catia_chflags(struct vfs_handle_struct *handle,
}
static NTSTATUS
-catia_streaminfo(struct vfs_handle_struct *handle,
+catia_fstreaminfo(struct vfs_handle_struct *handle,
struct files_struct *fsp,
- const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
unsigned int *_num_streams,
struct stream_struct **_streams)
@@ -919,9 +918,11 @@ catia_streaminfo(struct vfs_handle_struct *handle,
NTSTATUS status;
unsigned int i;
struct smb_filename *catia_smb_fname = NULL;
+ struct smb_filename *smb_fname = NULL;
unsigned int num_streams = 0;
struct stream_struct *streams = NULL;
+ smb_fname = fsp->fsp_name;
*_num_streams = 0;
*_streams = NULL;
@@ -947,8 +948,11 @@ catia_streaminfo(struct vfs_handle_struct *handle,
return status;
}
- status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, catia_smb_fname,
- mem_ctx, &num_streams, &streams);
+ status = SMB_VFS_NEXT_FSTREAMINFO(handle,
+ catia_smb_fname->fsp,
+ mem_ctx,
+ &num_streams,
+ &streams);
TALLOC_FREE(mapped_name);
TALLOC_FREE(catia_smb_fname);
if (!NT_STATUS_IS_OK(status)) {
@@ -972,18 +976,23 @@ catia_streaminfo(struct vfs_handle_struct *handle,
stream_type += 1;
}
- status = catia_string_replace_allocate(handle->conn, stream_name,
- &mapped_name, vfs_translate_to_windows);
+ status = catia_string_replace_allocate(handle->conn,
+ stream_name,
+ &mapped_name,
+ vfs_translate_to_windows);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(streams);
return status;
}
if (stream_type != NULL) {
- streams[i].name = talloc_asprintf(streams, ":%s:%s",
- mapped_name, stream_type);
+ streams[i].name = talloc_asprintf(streams,
+ ":%s:%s",
+ mapped_name,
+ stream_type);
} else {
- streams[i].name = talloc_asprintf(streams, ":%s",
+ streams[i].name = talloc_asprintf(streams,
+ ":%s",
mapped_name);
}
TALLOC_FREE(mapped_name);
@@ -2146,7 +2155,7 @@ static struct vfs_fn_pointers vfs_catia_fns = {
.getlock_fn = catia_getlock,
.realpath_fn = catia_realpath,
.chflags_fn = catia_chflags,
- .streaminfo_fn = catia_streaminfo,
+ .fstreaminfo_fn = catia_fstreaminfo,
.strict_lock_check_fn = catia_strict_lock_check,
.translate_name_fn = catia_translate_name,
.fsctl_fn = catia_fsctl,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 1bb927f5a47..27b38f50816 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -3021,61 +3021,52 @@ static uint64_t vfswrap_fs_file_id(struct vfs_handle_struct *handle,
return file_id;
}
-static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
+static NTSTATUS vfswrap_fstreaminfo(vfs_handle_struct *handle,
struct files_struct *fsp,
- const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
unsigned int *pnum_streams,
struct stream_struct **pstreams)
{
- SMB_STRUCT_STAT sbuf;
struct stream_struct *tmp_streams = NULL;
- int ret;
+ unsigned int num_streams = *pnum_streams;
+ struct stream_struct *streams = *pstreams;
+ NTSTATUS status;
- if ((fsp != NULL) && (fsp->fsp_flags.is_directory)) {
+ if (fsp->fsp_flags.is_directory) {
/*
* No default streams on directories
*/
goto done;
}
-
- if ((fsp != NULL) && (fsp_get_pathref_fd(fsp) != -1)) {
- ret = SMB_VFS_FSTAT(fsp, &sbuf);
- }
- else {
- struct smb_filename *smb_fname_cp = NULL;
-
- smb_fname_cp = cp_smb_filename_nostream(talloc_tos(), smb_fname);
- if (smb_fname_cp == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
-
- ret = vfs_stat(handle->conn, smb_fname_cp);
- sbuf = smb_fname_cp->st;
- TALLOC_FREE(smb_fname_cp);
- }
-
- if (ret == -1) {
- return map_nt_error_from_unix(errno);
+ status = vfs_stat_fsp(fsp);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
- if (S_ISDIR(sbuf.st_ex_mode)) {
- goto done;
+ if (num_streams + 1 < 1) {
+ /* Integer wrap. */
+ return NT_STATUS_INVALID_PARAMETER;
}
- tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct,
- (*pnum_streams) + 1);
+ tmp_streams = talloc_realloc(mem_ctx,
+ streams,
+ struct stream_struct,
+ num_streams + 1);
if (tmp_streams == NULL) {
return NT_STATUS_NO_MEMORY;
}
- tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA");
- if (tmp_streams[*pnum_streams].name == NULL) {
+ tmp_streams[num_streams].name = talloc_strdup(tmp_streams, "::$DATA");
+ if (tmp_streams[num_streams].name == NULL) {
return NT_STATUS_NO_MEMORY;
}
- tmp_streams[*pnum_streams].size = sbuf.st_ex_size;
- tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
+ tmp_streams[num_streams].size = fsp->fsp_name->st.st_ex_size;
+ tmp_streams[num_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(
+ handle->conn,
+ fsp,
+ &fsp->fsp_name->st);
+ num_streams += 1;
- *pnum_streams += 1;
+ *pnum_streams = num_streams;
*pstreams = tmp_streams;
done:
return NT_STATUS_OK;
@@ -3827,7 +3818,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
.chflags_fn = vfswrap_chflags,
.file_id_create_fn = vfswrap_file_id_create,
.fs_file_id_fn = vfswrap_fs_file_id,
- .streaminfo_fn = vfswrap_streaminfo,
+ .fstreaminfo_fn = vfswrap_fstreaminfo,
.get_real_filename_fn = vfswrap_get_real_filename,
.connectpath_fn = vfswrap_connectpath,
.brl_lock_windows_fn = vfswrap_brl_lock_windows,
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index eabed7eb883..856a7beb650 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -3834,22 +3834,24 @@ static void fruit_filter_empty_streams(unsigned int *pnum_streams,
*pnum_streams = num_streams;
}
-static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
+static NTSTATUS fruit_fstreaminfo(vfs_handle_struct *handle,
struct files_struct *fsp,
- const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
unsigned int *pnum_streams,
struct stream_struct **pstreams)
{
struct fruit_config_data *config = NULL;
+ const struct smb_filename *smb_fname = NULL;
NTSTATUS status;
+ smb_fname = fsp->fsp_name;
+
SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
return NT_STATUS_UNSUCCESSFUL);
DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
- status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
+ status = SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx,
pnum_streams, pstreams);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -4653,8 +4655,7 @@ static void fruit_offload_write_done(struct tevent_req *subreq)
* streams, because we're in vfs_fruit. We don't do this async
* because streams are few and small.
*/
- status = vfs_streaminfo(state->handle->conn, state->src_fsp,
- state->src_fsp->fsp_name,
+ status = vfs_fstreaminfo(state->src_fsp,
req, &num_streams, &streams);
if (tevent_req_nterror(req, status)) {
return;
@@ -5208,7 +5209,7 @@ static struct vfs_fn_pointers vfs_fruit_fns = {
.stat_fn = fruit_stat,
.lstat_fn = fruit_lstat,
.fstat_fn = fruit_fstat,
- .streaminfo_fn = fruit_streaminfo,
+ .fstreaminfo_fn = fruit_fstreaminfo,
.fntimes_fn = fruit_fntimes,
.ftruncate_fn = fruit_ftruncate,
.fallocate_fn = fruit_fallocate,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 060fecfba40..f1ded4fff04 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -163,7 +163,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_CHFLAGS,
SMB_VFS_OP_FILE_ID_CREATE,
SMB_VFS_OP_FS_FILE_ID,
- SMB_VFS_OP_STREAMINFO,
+ SMB_VFS_OP_FSTREAMINFO,
SMB_VFS_OP_GET_REAL_FILENAME,
SMB_VFS_OP_CONNECTPATH,
SMB_VFS_OP_BRL_LOCK_WINDOWS,
@@ -302,7 +302,7 @@ static struct {
{ SMB_VFS_OP_CHFLAGS, "chflags" },
{ SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" },
{ SMB_VFS_OP_FS_FILE_ID, "fs_file_id" },
- { SMB_VFS_OP_STREAMINFO, "streaminfo" },
+ { SMB_VFS_OP_FSTREAMINFO, "fstreaminfo" },
{ SMB_VFS_OP_GET_REAL_FILENAME, "get_real_filename" },
{ SMB_VFS_OP_CONNECTPATH, "connectpath" },
{ SMB_VFS_OP_BRL_LOCK_WINDOWS, "brl_lock_windows" },
@@ -2006,25 +2006,24 @@ static uint64_t smb_full_audit_fs_file_id(struct vfs_handle_struct *handle,
return result;
}
-static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
- TALLOC_CTX *mem_ctx,
- unsigned int *pnum_streams,
- struct stream_struct **pstreams)
+static NTSTATUS smb_full_audit_fstreaminfo(vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *mem_ctx,
+ unsigned int *pnum_streams,
+ struct stream_struct **pstreams)
{
- NTSTATUS result;
+ NTSTATUS result;
- result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
- pnum_streams, pstreams);
+ result = SMB_VFS_NEXT_FSTREAMINFO(handle, fsp, mem_ctx,
+ pnum_streams, pstreams);
- do_log(SMB_VFS_OP_STREAMINFO,
- NT_STATUS_IS_OK(result),
- handle,
- "%s",
- smb_fname_str_do_log(handle->conn, smb_fname));
+ do_log(SMB_VFS_OP_FSTREAMINFO,
+ NT_STATUS_IS_OK(result),
+ handle,
+ "%s",
+ smb_fname_str_do_log(handle->conn, fsp->fsp_name));
- return result;
+ return result;
}
static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
@@ -2981,7 +2980,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.snap_check_path_fn = smb_full_audit_snap_check_path,
.snap_create_fn = smb_full_audit_snap_create,
.snap_delete_fn = smb_full_audit_snap_delete,
- .streaminfo_fn = smb_full_audit_streaminfo,
+ .fstreaminfo_fn = smb_full_audit_fstreaminfo,
.get_real_filename_fn = smb_full_audit_get_real_filename,
.connectpath_fn = smb_full_audit_connectpath,
.brl_lock_windows_fn = smb_full_audit_brl_lock_windows,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 2ce89121ac1..7f34f18d069 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -2351,7 +2351,7 @@ static struct vfs_fn_pointers glusterfs_fns = {
.realpath_fn = vfs_gluster_realpath,
.chflags_fn = vfs_gluster_chflags,
.file_id_create_fn = NULL,
- .streaminfo_fn = NULL,
+ .fstreaminfo_fn = NULL,
--
Samba Shared Repository
More information about the samba-cvs
mailing list