The Samba-Bugzilla – Attachment 6838 Details for
Bug 8419
Make VFS op "streaminfo" stackable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch implementing function wrapper vfs_streaminfo
0001-Make-VFS-op-streaminfo-stackable.patch (text/plain), 5.79 KB, created by
franklahm
on 2011-08-30 08:39:47 UTC
(
hide
)
Description:
Patch implementing function wrapper vfs_streaminfo
Filename:
MIME Type:
Creator:
franklahm
Created:
2011-08-30 08:39:47 UTC
Size:
5.79 KB
patch
obsolete
>From 6484e3be73d83cf5e3c45edfefea46d9ba2dbaa7 Mon Sep 17 00:00:00 2001 >From: Frank Lahm <franklahm@googlemail.com> >Date: Tue, 30 Aug 2011 10:33:43 +0200 >Subject: [PATCH] Make VFS op streaminfo stackable > >--- > source3/smbd/close.c | 6 +++--- > source3/smbd/filename.c | 4 ++-- > source3/smbd/nttrans.c | 4 ++-- > source3/smbd/open.c | 6 +++--- > source3/smbd/proto.h | 6 ++++++ > source3/smbd/trans2.c | 5 ++--- > source3/smbd/vfs.c | 17 +++++++++++++++++ > 7 files changed, 35 insertions(+), 13 deletions(-) > >diff --git a/source3/smbd/close.c b/source3/smbd/close.c >index aeed4e3..843ed00 100644 >--- a/source3/smbd/close.c >+++ b/source3/smbd/close.c >@@ -207,8 +207,8 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname) > TALLOC_CTX *frame = talloc_stackframe(); > NTSTATUS status; > >- status = SMB_VFS_STREAMINFO(conn, NULL, fname, talloc_tos(), >- &num_streams, &stream_info); >+ status = vfs_streaminfo(conn->vfs_handles, NULL, fname, talloc_tos(), >+ &num_streams, &stream_info); > > if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) { > DEBUG(10, ("no streams around\n")); >@@ -217,7 +217,7 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname) > } > > if (!NT_STATUS_IS_OK(status)) { >- DEBUG(10, ("SMB_VFS_STREAMINFO failed: %s\n", >+ DEBUG(10, ("vfs_streaminfo failed: %s\n", > nt_errstr(status))); > goto fail; > } >diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c >index 08bc79d..f3cc9af 100644 >--- a/source3/smbd/filename.c >+++ b/source3/smbd/filename.c >@@ -1185,8 +1185,8 @@ static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx, > } > > /* Fall back to a case-insensitive scan of all streams on the file. */ >- status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, mem_ctx, >- &num_streams, &streams); >+ status = vfs_streaminfo(conn->vfs_handles, NULL, smb_fname->base_name, mem_ctx, >+ &num_streams, &streams); > > if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { > SET_STAT_INVALID(smb_fname->st); >diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c >index 427e566..e4852f4 100644 >--- a/source3/smbd/nttrans.c >+++ b/source3/smbd/nttrans.c >@@ -702,7 +702,7 @@ void reply_ntcreate_and_X(struct smb_request *req) > if (NT_STATUS_IS_OK(status) && num_names) { > file_status &= ~NO_EAS; > } >- status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, ctx, >+ status = vfs_streaminfo(conn->vfs_handles, NULL, smb_fname->base_name, ctx, > &num_streams, &streams); > /* There is always one stream, ::$DATA. */ > if (NT_STATUS_IS_OK(status) && num_streams > 1) { >@@ -1277,7 +1277,7 @@ static void call_nt_transact_create(connection_struct *conn, > if (NT_STATUS_IS_OK(status) && num_names) { > file_status &= ~NO_EAS; > } >- status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, ctx, >+ status = vfs_streaminfo(conn->vfs_handles, NULL, smb_fname->base_name, ctx, > &num_streams, &streams); > /* There is always one stream, ::$DATA. */ > if (NT_STATUS_IS_OK(status) && num_streams > 1) { >diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index 1cab9ab..f104035 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -2974,8 +2974,8 @@ NTSTATUS open_streams_for_delete(connection_struct *conn, > TALLOC_CTX *frame = talloc_stackframe(); > NTSTATUS status; > >- status = SMB_VFS_STREAMINFO(conn, NULL, fname, talloc_tos(), >- &num_streams, &stream_info); >+ status = vfs_streaminfo(conn->vfs_handles, NULL, fname, talloc_tos(), >+ &num_streams, &stream_info); > > if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) > || NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { >@@ -2985,7 +2985,7 @@ NTSTATUS open_streams_for_delete(connection_struct *conn, > } > > if (!NT_STATUS_IS_OK(status)) { >- DEBUG(10, ("SMB_VFS_STREAMINFO failed: %s\n", >+ DEBUG(10, ("vfs_streaminfo failed: %s\n", > nt_errstr(status))); > goto fail; > } >diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h >index b7bb063..355ca56 100644 >--- a/source3/smbd/proto.h >+++ b/source3/smbd/proto.h >@@ -1166,6 +1166,12 @@ int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname, > SMB_STRUCT_STAT *psbuf); > NTSTATUS vfs_stat_fsp(files_struct *fsp); > NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid); >+NTSTATUS vfs_streaminfo(struct vfs_handle_struct *handle, >+ struct files_struct *fsp, >+ const char *fname, >+ TALLOC_CTX *mem_ctx, >+ unsigned int *num_streams, >+ struct stream_struct **streams); > > /* The following definitions come from smbd/avahi_register.c */ > >diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c >index 114f688..f116357 100644 >--- a/source3/smbd/trans2.c >+++ b/source3/smbd/trans2.c >@@ -4683,9 +4683,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, > return NT_STATUS_INVALID_PARAMETER; > } > >- status = SMB_VFS_STREAMINFO( >- conn, fsp, smb_fname->base_name, talloc_tos(), >- &num_streams, &streams); >+ status = vfs_streaminfo(conn->vfs_handles, fsp, smb_fname->base_name, >+ talloc_tos(), &num_streams, &streams); > > if (!NT_STATUS_IS_OK(status)) { > DEBUG(10, ("could not get stream info: %s\n", >diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c >index 35a8331..1225fe6 100644 >--- a/source3/smbd/vfs.c >+++ b/source3/smbd/vfs.c >@@ -1125,6 +1125,23 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp) > return NT_STATUS_OK; > } > >+/** >+ * Initialize num_streams and streams, then call VFS op streaminfo >+ */ >+NTSTATUS vfs_streaminfo(struct vfs_handle_struct *handle, >+ struct files_struct *fsp, >+ const char *fname, >+ TALLOC_CTX *mem_ctx, >+ unsigned int *num_streams, >+ struct stream_struct **streams) >+{ >+ *num_streams = 0; >+ *streams = NULL; >+ VFS_FIND(streaminfo); >+ return handle->fns->streaminfo(handle, fsp, fname, mem_ctx, >+ num_streams, streams); >+} >+ > /* > generate a file_id from a stat structure > */ >-- >1.7.0.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8419
:
6824
|
6825
|
6838
|
6843
|
6924
|
7002
|
7006
|
7011