Make VFS op "streaminfo" stackable

Frank Lahm franklahm at googlemail.com
Fri Aug 26 07:53:12 MDT 2011


2011/8/26 Frank Lahm <franklahm at googlemail.com>:
> I'm currently starring at struct vfs_handle_struct trying to come up
> with anything that could be used to determine inside
> smb_vfs_call_streaminfo() whether it has been called through
> SMB_VFS_STREAMINFO (which should do the initialisation) or
> SMB_VFS_NEXT_STREAMINFO.

This should work, shouldn't it ?


diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 35a8331..c846174 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1673,6 +1673,11 @@ NTSTATUS smb_vfs_call_streaminfo(struct
vfs_handle_struct *handle,
                                 struct stream_struct **streams)
 {
        VFS_FIND(streaminfo);
+       if (handle->prev->next == NULL) {
+               /* VFS op chain start */
+               *num_streams = 0;
+               *streams = NULL;
+       }
        return handle->fns->streaminfo(handle, fsp, fname, mem_ctx,
                                       num_streams, streams);
 }


More information about the samba-technical mailing list