s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
authorJeremy Allison <jra@samba.org>
Fri, 4 Mar 2016 22:16:13 +0000 (14:16 -0800)
committerRalph Boehme <slow@samba.org>
Mon, 7 Mar 2016 20:12:56 +0000 (21:12 +0100)
Prepare for changing vfs_streaminfo to do the same.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Mar  7 21:12:56 CET 2016 on sn-devel-144

20 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_catia.c
source3/modules/vfs_default.c
source3/modules/vfs_fruit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/smbd/close.c
source3/smbd/filename.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/proto.h
source3/smbd/trans2.c
source3/smbd/vfs.c

index 457881dc8bea429f6f719a3102ec594276c75a8d..67c387d83dfd50015d4856ad08ea84685e18878b 100644 (file)
@@ -579,7 +579,7 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
-                               const char *fname,
+                               const struct smb_filename *smb_fname,
                                TALLOC_CTX *mem_ctx,
                                unsigned int *num_streams,
                                struct stream_struct **streams)
index 55b1ed60c627901766a2616396d8488cc0da6677..9fc943819d6b7e937c1797ea9b4308614ebf86e8 100644 (file)
@@ -699,14 +699,17 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
-                               const char *fname,
+                               const struct smb_filename *smb_fname,
                                TALLOC_CTX *mem_ctx,
                                unsigned int *num_streams,
                                struct stream_struct **streams)
 {
        return SMB_VFS_NEXT_STREAMINFO(handle,
-                                      fsp,
-                                      fname, mem_ctx, num_streams, streams);
+                               fsp,
+                               smb_fname,
+                               mem_ctx,
+                               num_streams,
+                               streams);
 }
 
 static int skel_get_real_filename(struct vfs_handle_struct *handle,
index e77d702d742e0dd40d5200657264365edcdba871..1c6bc2f8fa2fab11cc714386748db96f00576e34 100644 (file)
                const struct smb_filename * */
 /* Version 35 - Change lchown from const char *, to
                const struct smb_filename * */
+/* Version 35 - Change streaminfo from const char *, to
+               const struct smb_filename * */
 
 #define SMB_VFS_INTERFACE_VERSION 35
 
@@ -721,7 +723,7 @@ struct vfs_fn_pointers {
 
        NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle,
                                  struct files_struct *fsp,
-                                 const char *fname,
+                                 const struct smb_filename *smb_fname,
                                  TALLOC_CTX *mem_ctx,
                                  unsigned int *num_streams,
                                  struct stream_struct **streams);
@@ -1153,7 +1155,7 @@ struct file_id smb_vfs_call_file_id_create(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 char *fname,
+                                const struct smb_filename *smb_fname,
                                 TALLOC_CTX *mem_ctx,
                                 unsigned int *num_streams,
                                 struct stream_struct **streams);
index ae2ba1b797fcecad928c483f49077b87aa26ecbf..6059c2ab1a600ed6136ac89e8bfceaa35cd4a854 100644 (file)
 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf) \
        smb_vfs_call_file_id_create((handle)->next, (sbuf))
 
-#define SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) \
-       smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (fname), (mem_ctx), (num_streams), (streams))
-#define SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, num_streams, streams) \
-       smb_vfs_call_streaminfo((handle)->next, (fsp), (fname), (mem_ctx), (num_streams), (streams))
+#define SMB_VFS_STREAMINFO(conn, fsp, smb_fname, mem_ctx, num_streams, streams) \
+       smb_vfs_call_streaminfo((conn)->vfs_handles, (fsp), (smb_fname), (mem_ctx), (num_streams), (streams))
+#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_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))
index 4a988b9b3a6c6efc2bfb7abdb461bba5b68da6ce..e2b4eb5745e3fc13727c9f638950adad5b1feab0 100644 (file)
@@ -792,7 +792,7 @@ static int catia_chflags(struct vfs_handle_struct *handle,
 static NTSTATUS
 catia_streaminfo(struct vfs_handle_struct *handle,
                 struct files_struct *fsp,
-                const char *path,
+                const struct smb_filename *smb_fname,
                 TALLOC_CTX *mem_ctx,
                 unsigned int *_num_streams,
                 struct stream_struct **_streams)
@@ -800,22 +800,35 @@ catia_streaminfo(struct vfs_handle_struct *handle,
        char *mapped_name = NULL;
        NTSTATUS status;
        int i;
+       struct smb_filename *catia_smb_fname = NULL;
        unsigned int num_streams = 0;
        struct stream_struct *streams = NULL;
 
        *_num_streams = 0;
        *_streams = NULL;
 
-       status = catia_string_replace_allocate(handle->conn, path,
-                                       &mapped_name, vfs_translate_to_unix);
+       status = catia_string_replace_allocate(handle->conn,
+                               smb_fname->base_name,
+                               &mapped_name,
+                               vfs_translate_to_unix);
        if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                return status;
        }
 
-       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, mapped_name,
+       catia_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       mapped_name,
+                                       NULL,
+                                       NULL);
+       if (catia_smb_fname == NULL) {
+               TALLOC_FREE(mapped_name);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, catia_smb_fname,
                                         mem_ctx, &num_streams, &streams);
        TALLOC_FREE(mapped_name);
+       TALLOC_FREE(catia_smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
index 4de965e239cb200170e0b337814d519282a769b6..ee9ddb20e5fe24b88dfa0be1d9cb1a609ac6ee8f 100644 (file)
@@ -2186,7 +2186,7 @@ static struct file_id vfswrap_file_id_create(struct vfs_handle_struct *handle,
 
 static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
                                   struct files_struct *fsp,
-                                  const char *fname,
+                                  const struct smb_filename *smb_fname,
                                   TALLOC_CTX *mem_ctx,
                                   unsigned int *pnum_streams,
                                   struct stream_struct **pstreams)
@@ -2206,17 +2206,18 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
                ret = SMB_VFS_FSTAT(fsp, &sbuf);
        }
        else {
-               struct smb_filename smb_fname;
+               struct smb_filename smb_fname_cp;
 
-               ZERO_STRUCT(smb_fname);
-               smb_fname.base_name = discard_const_p(char, fname);
+               ZERO_STRUCT(smb_fname_cp);
+               smb_fname_cp.base_name = discard_const_p(char,
+                                       smb_fname->base_name);
 
                if (lp_posix_pathnames()) {
-                       ret = SMB_VFS_LSTAT(handle->conn, &smb_fname);
+                       ret = SMB_VFS_LSTAT(handle->conn, &smb_fname_cp);
                } else {
-                       ret = SMB_VFS_STAT(handle->conn, &smb_fname);
+                       ret = SMB_VFS_STAT(handle->conn, &smb_fname_cp);
                }
-               sbuf = smb_fname.st;
+               sbuf = smb_fname_cp.st;
        }
 
        if (ret == -1) {
index e0d1fae06d68ae40aa55678585665db87f9d3a8e..0c742861d76ab91f3b449179972e1b3a579b6f9c 100644 (file)
@@ -3168,24 +3168,18 @@ exit:
 
 static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
                                 struct files_struct *fsp,
-                                const char *fname,
+                                const struct smb_filename *smb_fname,
                                 TALLOC_CTX *mem_ctx,
                                 unsigned int *pnum_streams,
                                 struct stream_struct **pstreams)
 {
        struct fruit_config_data *config = NULL;
-       struct smb_filename *smb_fname = NULL;
        struct adouble *ad = NULL;
        NTSTATUS status;
 
        SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
                                return NT_STATUS_UNSUCCESSFUL);
-       DEBUG(10, ("fruit_streaminfo called for %s\n", fname));
-
-       smb_fname = synthetic_smb_fname(talloc_tos(), fname, NULL, NULL);
-       if (smb_fname == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
+       DEBUG(10, ("fruit_streaminfo called for %s\n", smb_fname->base_name));
 
        if (config->meta == FRUIT_META_NETATALK) {
                ad = ad_get(talloc_tos(), handle,
@@ -3197,7 +3191,6 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
                                    smb_roundup(handle->conn,
                                                AFP_INFO_SIZE))) {
                                TALLOC_FREE(ad);
-                               TALLOC_FREE(smb_fname);
                                return NT_STATUS_NO_MEMORY;
                        }
                }
@@ -3216,16 +3209,13 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
                                                ad_getentrylen(
                                                        ad, ADEID_RFORK)))) {
                                TALLOC_FREE(ad);
-                               TALLOC_FREE(smb_fname);
                                return NT_STATUS_NO_MEMORY;
                        }
                }
                TALLOC_FREE(ad);
        }
 
-       TALLOC_FREE(smb_fname);
-
-       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
                                         pnum_streams, pstreams);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -3236,7 +3226,6 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
                if (!del_fruit_stream(mem_ctx, pnum_streams, pstreams,
                                      ":" NETATALK_META_XATTR ":$DATA")) {
                                TALLOC_FREE(ad);
-                               TALLOC_FREE(smb_fname);
                                return NT_STATUS_NO_MEMORY;
                }
        }
@@ -3792,7 +3781,7 @@ static void fruit_copy_chunk_done(struct tevent_req *subreq)
         * because streams are few and small.
         */
        status = vfs_streaminfo(state->handle->conn, state->src_fsp,
-                               state->src_fsp->fsp_name->base_name,
+                               state->src_fsp->fsp_name,
                                req, &num_streams, &streams);
        if (tevent_req_nterror(req, status)) {
                return;
index d29064b00d1dd7eabb547e8173169afa33b4d1f9..691b1e14deb070e44a78794a1d76bebbaf250349 100644 (file)
@@ -1674,18 +1674,18 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha
 
 static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
                                          struct files_struct *fsp,
-                                         const char *fname,
+                                         const struct smb_filename *smb_fname,
                                          TALLOC_CTX *mem_ctx,
                                          unsigned int *pnum_streams,
                                          struct stream_struct **pstreams)
 {
        NTSTATUS result;
 
-       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
                                         pnum_streams, pstreams);
 
        do_log(SMB_VFS_OP_STREAMINFO, NT_STATUS_IS_OK(result), handle,
-              "%s", fname);
+              "%s", smb_fname->base_name);
 
        return result;
 }
index 67e2541c1235fc8636e66121c36d58ef880b23c5..2ae6c4a96a1454e124193c89e9704ccc4daef7e5 100644 (file)
@@ -1962,43 +1962,42 @@ out:
  */
 static NTSTATUS mh_streaminfo(struct vfs_handle_struct *handle,
                struct files_struct *fsp,
-               const char *fname,
+               const struct smb_filename *smb_fname,
                TALLOC_CTX *ctx,
                unsigned int *num_streams,
                struct stream_struct **streams)
 {
        NTSTATUS status;
-       char *clientPath;
-       TALLOC_CTX *mem_ctx;
+       int ret;
+       struct smb_filename *clientFname = NULL;
 
        DEBUG(MH_INFO_DEBUG, ("Entering mh_streaminfo\n"));
-       if (!is_in_media_files(fname))
-       {
-               status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname,
-                               ctx, num_streams, streams);
+       if (!is_in_media_files(smb_fname->base_name)) {
+               status = SMB_VFS_NEXT_STREAMINFO(handle,
+                               fsp,
+                               smb_fname,
+                               ctx,
+                               num_streams,
+                               streams);
                goto out;
        }
 
-       clientPath = NULL;
-       mem_ctx = talloc_tos();
-
-       if (alloc_get_client_path(handle, mem_ctx,
-                               fname,
-                               &clientPath))
-       {
-               status = map_nt_error_from_unix(errno);
+       ret = alloc_get_client_smb_fname(handle,
+                               talloc_tos(),
+                               smb_fname,
+                               &clientFname);
+       if (ret != 0) {
+               status = NT_STATUS_NO_MEMORY;
                goto err;
        }
 
        /* This only works on files, so we don't have to worry about
         * our fake directory stat'ing here.
         */
-       // But what does this function do, exactly?  Does it need
-       // extra modifications for the Avid stuff?
-       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, clientPath,
+       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, clientFname,
                                ctx, num_streams, streams);
 err:
-       TALLOC_FREE(clientPath);
+       TALLOC_FREE(clientFname);
 out:
        return status;
 }
index d998dc51a347e60b151a86d1169c52b53c2762ed..ef5ef64dfa0a481ac0cfad8db04f7ec397383487 100644 (file)
@@ -911,17 +911,20 @@ static bool collect_one_stream(const char *dirname,
 
 static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
                                         struct files_struct *fsp,
-                                        const char *fname,
+                                        const struct smb_filename *smb_fname,
                                         TALLOC_CTX *mem_ctx,
                                         unsigned int *pnum_streams,
                                         struct stream_struct **pstreams)
 {
-       struct smb_filename *smb_fname_base;
+       struct smb_filename *smb_fname_base = NULL;
        int ret;
        NTSTATUS status;
        struct streaminfo_state state;
 
-       smb_fname_base = synthetic_smb_fname(talloc_tos(), fname, NULL, NULL);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL);
        if (smb_fname_base == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -975,7 +978,12 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
 
        *pnum_streams = state.num_streams;
        *pstreams = state.streams;
-       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, pnum_streams, pstreams);
+       status = SMB_VFS_NEXT_STREAMINFO(handle,
+                               fsp,
+                               smb_fname_base,
+                               mem_ctx,
+                               pnum_streams,
+                               pstreams);
 
  out:
        TALLOC_FREE(smb_fname_base);
index b54809f134e50afea074f6a660f42ee35412a9f8..3887d9ffce8102e39b69529fbd81d8937d28a377 100644 (file)
@@ -811,7 +811,7 @@ static bool collect_one_stream(struct ea_struct *ea, void *private_data)
 
 static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
                                         struct files_struct *fsp,
-                                        const char *fname,
+                                        const struct smb_filename *smb_fname,
                                         TALLOC_CTX *mem_ctx,
                                         unsigned int *pnum_streams,
                                         struct stream_struct **pstreams)
@@ -825,19 +825,21 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
                ret = SMB_VFS_FSTAT(fsp, &sbuf);
        }
        else {
-               struct smb_filename *smb_fname = NULL;
-               smb_fname = synthetic_smb_fname(talloc_tos(), fname, NULL,
-                                               NULL);
-               if (smb_fname == NULL) {
+               struct smb_filename *smb_fname_base = NULL;
+               smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL);
+               if (smb_fname_base == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
                if (lp_posix_pathnames()) {
-                       ret = SMB_VFS_LSTAT(handle->conn, smb_fname);
+                       ret = SMB_VFS_LSTAT(handle->conn, smb_fname_base);
                } else {
-                       ret = SMB_VFS_STAT(handle->conn, smb_fname);
+                       ret = SMB_VFS_STAT(handle->conn, smb_fname_base);
                }
-               sbuf = smb_fname->st;
-               TALLOC_FREE(smb_fname);
+               sbuf = smb_fname_base->st;
+               TALLOC_FREE(smb_fname_base);
        }
 
        if (ret == -1) {
@@ -860,7 +862,7 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
                 */
                status = NT_STATUS_OK;
        } else {
-               status = walk_xattr_streams(handle, fsp, fname,
+               status = walk_xattr_streams(handle, fsp, smb_fname->base_name,
                                    collect_one_stream, &state);
        }
 
@@ -877,7 +879,12 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
        *pnum_streams = state.num_streams;
        *pstreams = state.streams;
 
-       return SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, pnum_streams, pstreams);
+       return SMB_VFS_NEXT_STREAMINFO(handle,
+                       fsp,
+                       smb_fname,
+                       mem_ctx,
+                       pnum_streams,
+                       pstreams);
 }
 
 static uint32_t streams_xattr_fs_capabilities(struct vfs_handle_struct *handle,
index 30dae9814df52358903bb3ea9ece4dff262b96fb..3bdc98b4fd695f339dab67b89025d83e455d5664 100644 (file)
@@ -1533,7 +1533,7 @@ static struct file_id smb_time_audit_file_id_create(struct vfs_handle_struct *ha
 
 static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle,
                                          struct files_struct *fsp,
-                                         const char *fname,
+                                         const struct smb_filename *smb_fname,
                                          TALLOC_CTX *mem_ctx,
                                          unsigned int *pnum_streams,
                                          struct stream_struct **pstreams)
@@ -1543,7 +1543,7 @@ static NTSTATUS smb_time_audit_streaminfo(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
                                         pnum_streams, pstreams);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
index d46b376099f23d47a680e72e0de93cc96674cfce..7544b8fdfa0d86d1e051133b974f9646ccc05ee3 100644 (file)
@@ -1489,26 +1489,27 @@ err:
 
 static NTSTATUS um_streaminfo(struct vfs_handle_struct *handle,
                              struct files_struct *fsp,
-                             const char *fname,
+                             const struct smb_filename *smb_fname,
                              TALLOC_CTX *ctx,
                              unsigned int *num_streams,
                              struct stream_struct **streams)
 {
        NTSTATUS status;
-       char *client_path = NULL;
        int ret;
+       struct smb_filename *client_fname = NULL;
 
        DEBUG(10, ("Entering um_streaminfo\n"));
 
-       if (!is_in_media_files(fname)) {
-               return SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname,
+       if (!is_in_media_files(smb_fname->base_name)) {
+               return SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname,
                                               ctx, num_streams, streams);
        }
 
-       ret = alloc_get_client_path(handle, talloc_tos(),
-                                   fname, &client_path);
+       ret = alloc_get_client_smb_fname(handle,
+                               talloc_tos(),
+                               smb_fname,
+                               &client_fname);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
                goto err;
        }
 
@@ -1518,10 +1519,10 @@ static NTSTATUS um_streaminfo(struct vfs_handle_struct *handle,
         * function do, exactly?  Does it need extra modifications for
         * the Avid stuff?
         */
-       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, client_path,
+       status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, client_fname,
                                         ctx, num_streams, streams);
 err:
-       TALLOC_FREE(client_path);
+       TALLOC_FREE(client_fname);
        return status;
 }
 
index 144998f3ebdb1e367029c557668bff64e0ba8f5b..3b887c86385c23d7779e823907a7ac4c669f1efe 100644 (file)
@@ -170,7 +170,7 @@ NTSTATUS delete_all_streams(connection_struct *conn,
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
 
-       status = vfs_streaminfo(conn, NULL, smb_fname->base_name, talloc_tos(),
+       status = vfs_streaminfo(conn, NULL, smb_fname, talloc_tos(),
                                &num_streams, &stream_info);
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
index 86f66860f5b97af029d1a4741eccdb75347b072c..14eb53f31463cc4b1fc393271bf347edf7a2b578 100644 (file)
@@ -1315,7 +1315,7 @@ static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,
        }
 
        /* Fall back to a case-insensitive scan of all streams on the file. */
-       status = vfs_streaminfo(conn, NULL, smb_fname->base_name, mem_ctx,
+       status = vfs_streaminfo(conn, NULL, smb_fname, mem_ctx,
                                &num_streams, &streams);
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
index 75b283e79999572d1fb687e829a7313e43dbab49..c6ad095919b21a5ffea5abf280430e8ee9917305 100644 (file)
@@ -698,7 +698,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
                if (NT_STATUS_IS_OK(status) && num_names) {
                        file_status &= ~NO_EAS;
                }
-               status = vfs_streaminfo(conn, NULL, smb_fname->base_name, ctx,
+               status = vfs_streaminfo(conn, NULL, smb_fname, ctx,
                        &num_streams, &streams);
                /* There is always one stream, ::$DATA. */
                if (NT_STATUS_IS_OK(status) && num_streams > 1) {
@@ -1337,7 +1337,7 @@ static void call_nt_transact_create(connection_struct *conn,
                if (NT_STATUS_IS_OK(status) && num_names) {
                        file_status &= ~NO_EAS;
                }
-               status = vfs_streaminfo(conn, NULL, smb_fname->base_name, ctx,
+               status = vfs_streaminfo(conn, NULL, smb_fname, ctx,
                        &num_streams, &streams);
                /* There is always one stream, ::$DATA. */
                if (NT_STATUS_IS_OK(status) && num_streams > 1) {
index a80d2e643c2b63c9fdc1be8dfb5bce2e4e7cbd0c..baebd7c5f2bfee16214904f918cbc96e60d3ffbc 100644 (file)
@@ -3859,7 +3859,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
 
-       status = vfs_streaminfo(conn, NULL, smb_fname->base_name, talloc_tos(),
+       status = vfs_streaminfo(conn, NULL, smb_fname, talloc_tos(),
                                &num_streams, &stream_info);
 
        if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)
index a859cb6a966d1dcca921f5df8b3c3a259724777b..e1ec063226f1ca7592aa29b0e2f355d53115f5c8 100644 (file)
@@ -1215,7 +1215,7 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp);
 NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
 NTSTATUS vfs_streaminfo(connection_struct *conn,
                        struct files_struct *fsp,
-                       const char *fname,
+                       const struct smb_filename *smb_fname,
                        TALLOC_CTX *mem_ctx,
                        unsigned int *num_streams,
                        struct stream_struct **streams);
index 8cd03c49900009bec60d8653376eac4fa4b5ae11..b1eb9a9d2af1948e9e129b59024d5d1ea90f332c 100644 (file)
@@ -5180,8 +5180,12 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                                return NT_STATUS_INVALID_PARAMETER;
                        }
 
-                       status = vfs_streaminfo(conn, fsp, smb_fname->base_name,
-                                               talloc_tos(), &num_streams, &streams);
+                       status = vfs_streaminfo(conn,
+                                               fsp,
+                                               smb_fname,
+                                               talloc_tos(),
+                                               &num_streams,
+                                               &streams);
 
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(10, ("could not get stream info: %s\n",
index 19f75d17cc07f96348d96c381089b575c5e54c2d..a1154aee784d6b242534429a6b0207a59393b459 100644 (file)
@@ -1365,14 +1365,19 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
  */
 NTSTATUS vfs_streaminfo(connection_struct *conn,
                        struct files_struct *fsp,
-                       const char *fname,
+                       const struct smb_filename *smb_fname,
                        TALLOC_CTX *mem_ctx,
                        unsigned int *num_streams,
                        struct stream_struct **streams)
 {
        *num_streams = 0;
        *streams = NULL;
-       return SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams);
+       return SMB_VFS_STREAMINFO(conn,
+                       fsp,
+                       smb_fname,
+                       mem_ctx,
+                       num_streams,
+                       streams);
 }
 
 /*
@@ -2124,13 +2129,13 @@ struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle,
 
 NTSTATUS smb_vfs_call_streaminfo(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
-                                const char *fname,
+                                const struct smb_filename *smb_fname,
                                 TALLOC_CTX *mem_ctx,
                                 unsigned int *num_streams,
                                 struct stream_struct **streams)
 {
        VFS_FIND(streaminfo);
-       return handle->fns->streaminfo_fn(handle, fsp, fname, mem_ctx,
+       return handle->fns->streaminfo_fn(handle, fsp, smb_fname, mem_ctx,
                                          num_streams, streams);
 }