The branch, master has been updated
       via  f4b4872 s3: smbd: Change open_streams_for_delete() to take a struct 
smb_filename *.
       via  f67d116 s3: smbd: Change open_streams_for_delete() to take a struct 
smb_filename *.
       via  fc122d9 s3: smbd: Change open_streams_for_delete() to static.
       via  a3856cb s3: smbd: Change delete_all_streams() to take a const 
struct smb_filename *.
       via  859d978 s3: VFS: vfs_fruit. If we have an fsp, use it in preference 
to a pathname in vfs_streaminfo.
       via  dbcdacc lib: Avoid a gencache_parse when setting a delete marker
       via  639b3ca lib: Avoid looking at fcntl'ed gencache.tdb
       via  b3dd6fd lib: Simplify gencache_pull_timeout callers
       via  6797014 lib: Make gencache_pull_timeout look at uint8_t
       via  1ff902f lib: Remove memcache from gencache
       via  b6f90f7 lib: Fix a typo in gencache
       via  f0e3515 lib: Simplify gencache_del
       via  f857f30 lib: skip deleted entries in gencache_iterate
      from  b73235f krb5_wrap: Do not use deprecated KRB5 functions

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f4b48729823b0a32d53abaeba2bbafa54a36a11c
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 4 14:16:13 2016 -0800

    s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
    
    Prepare for changing vfs_streaminfo to do the same.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    
    Autobuild-User(master): Ralph Böhme <s...@samba.org>
    Autobuild-Date(master): Mon Mar  7 21:12:56 CET 2016 on sn-devel-144

commit f67d11676fed97a6c1ad468e22bad8c5d8fe24f5
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 4 14:16:13 2016 -0800

    s3: smbd: Change open_streams_for_delete() to take a struct smb_filename *.
    
    Prepare for changing vfs_streaminfo to do the same.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit fc122d92550ce39efbf019dcb01f3a54e8bfa89c
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 4 14:13:22 2016 -0800

    s3: smbd: Change open_streams_for_delete() to static.
    
    Not used outside of open.c
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit a3856cbf893a39d88b064c882dc9236f33cdba27
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 4 14:07:04 2016 -0800

    s3: smbd: Change delete_all_streams() to take a const struct smb_filename *.
    
    Prepare for changing the interface to vfs_streaminfo().
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 859d9784ba2c7aeaebbe31292e20b98c7e827c2f
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 4 14:01:47 2016 -0800

    s3: VFS: vfs_fruit. If we have an fsp, use it in preference to a pathname 
in vfs_streaminfo.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit dbcdacc58df77c87f7e6f919208cfd141e37b2d4
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 3 17:39:09 2016 +0100

    lib: Avoid a gencache_parse when setting a delete marker
    
    We know that we want to put something into _notrans, no point in
    doing another round trip into gencache.tdb.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 639b3ca48a8dc4e853aa414ba175768413cb3aa3
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 3 17:41:34 2016 +0100

    lib: Avoid looking at fcntl'ed gencache.tdb
    
    gencache_notrans.tdb is much cheaper to look at than gencache.tdb because 
it's
    mutexed and thus avoids expensive fcntl locks. This patch aggressively uses 
the
    shared _notrans tdb for both positive and negative entries. It's a 
replacement
    for the memcache copy in every process that was removed a few patches ago.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit b3dd6fd8a4d77cbb7e4e1110204fb4ddf9d8caf8
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Jul 22 16:03:47 2015 +0200

    lib: Simplify gencache_pull_timeout callers
    
    gencache_pull_timeout used to point at the "/" right after the timeout.  
None
    of the callers was interested in the "/", they are interested in the 
payload.
    
    Increment the endpointer in gencache_pull_timeout and rename it.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 6797014d4509b7b243a50e9d2cac88007ec09dc4
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Jul 22 16:00:03 2015 +0200

    lib: Make gencache_pull_timeout look at uint8_t
    
    At this point we're still looking at TDB_DATA. This patch moves the casts 
to a
    more appropriate place.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit 1ff902fc32638315b686be65bdb57db1f65e12d8
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Jul 22 15:50:00 2015 +0200

    lib: Remove memcache from gencache
    
    The main reason for this was to avoid access to the fcntl-governed 
transaction
    based gencache.tdb. A later patch will make this unnecessary by filling
    gencache_notrans more aggressively.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit b6f90f713a5fee78a93601f11463ffe688c64dfb
Author: Volker Lendecke <v...@samba.org>
Date:   Sun Mar 6 10:27:06 2016 +0100

    lib: Fix a typo in gencache
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit f0e35154fefa361c5fa2eb0a2a3b35d1cdc17905
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 3 15:59:05 2016 +0100

    lib: Simplify gencache_del
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

commit f857f30236b1143be930ec56f233846d867bd3bd
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 3 15:59:05 2016 +0100

    lib: skip deleted entries in gencache_iterate
    
    "net cache flush" can give nasty error messages like
    
    Couldn't delete entry! key = IDMAP/UID2SID/12345
    
    These happen when there's an already deleted entry in
    gencache_notrans.tdb, indicated by a 0 timeout. This happens if two
    gencache_del function calls have happened right after the other and a
    gencache_stabilize has not wiped them.
    
    In gencache_iterate, don't show these deleted entries
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c          |   2 +-
 examples/VFS/skel_transparent.c     |   9 ++-
 source3/include/vfs.h               |   6 +-
 source3/include/vfs_macros.h        |   8 +--
 source3/lib/gencache.c              | 138 ++++++++++++++++++------------------
 source3/modules/vfs_catia.c         |  21 ++++--
 source3/modules/vfs_default.c       |  15 ++--
 source3/modules/vfs_fruit.c         |  21 ++----
 source3/modules/vfs_full_audit.c    |   6 +-
 source3/modules/vfs_media_harmony.c |  37 +++++-----
 source3/modules/vfs_streams_depot.c |  16 +++--
 source3/modules/vfs_streams_xattr.c |  29 +++++---
 source3/modules/vfs_time_audit.c    |   4 +-
 source3/modules/vfs_unityed_media.c |  19 ++---
 source3/smbd/close.c                |  15 ++--
 source3/smbd/filename.c             |   2 +-
 source3/smbd/nttrans.c              |   4 +-
 source3/smbd/open.c                 |  32 +++++----
 source3/smbd/proto.h                |   7 +-
 source3/smbd/trans2.c               |   8 ++-
 source3/smbd/vfs.c                  |  13 ++--
 21 files changed, 225 insertions(+), 187 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 457881d..67c387d 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -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)
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 55b1ed6..9fc9438 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -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,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index e77d702..1c6bc2f 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -188,6 +188,8 @@
                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);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index ae2ba1b..6059c2a 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -346,10 +346,10 @@
 #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))
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index c353aa6..84d273e 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -26,7 +26,6 @@
 #include "system/glob.h"
 #include "util_tdb.h"
 #include "tdb_wrap/tdb_wrap.h"
-#include "../lib/util/memcache.h"
 
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_TDB
@@ -35,7 +34,6 @@
 
 static struct tdb_wrap *cache;
 static struct tdb_wrap *cache_notrans;
-static int cache_notrans_seqnum;
 
 /**
  * @file gencache.c
@@ -124,7 +122,6 @@ static bool gencache_init(void)
        cache_notrans = tdb_wrap_open(NULL, cache_fname, 0,
                                      TDB_CLEAR_IF_FIRST|
                                      TDB_INCOMPATIBLE_HASH|
-                                     TDB_SEQNUM|
                                      TDB_NOSYNC|
                                      TDB_MUTEX_LOCKING,
                                      open_flags, 0644);
@@ -299,7 +296,7 @@ bool gencache_set_data_blob(const char *keystr, const 
DATA_BLOB *blob,
                return false;
        }
 
-       if (gencache_have_val(keystr, blob, timeout)) {
+       if ((timeout != 0) && gencache_have_val(keystr, blob, timeout)) {
                DEBUG(10, ("Did not store value for %s, we already got it\n",
                           keystr));
                return true;
@@ -370,6 +367,15 @@ done:
        return ret == 0;
 }
 
+static void gencache_del_parser(time_t timeout, DATA_BLOB blob,
+                               void *private_data)
+{
+       if (timeout != 0) {
+               bool *exists = private_data;
+               *exists = true;
+       }
+}
+
 /**
  * Delete one entry from the cache file.
  *
@@ -381,9 +387,10 @@ done:
 
 bool gencache_del(const char *keystr)
 {
-       bool exists, was_expired;
-       bool ret = false;
-       DATA_BLOB value;
+       TDB_DATA key = string_term_tdb_data(keystr);
+       bool exists = false;
+       bool result = false;
+       int ret;
 
        if (keystr == NULL) {
                return false;
@@ -395,31 +402,28 @@ bool gencache_del(const char *keystr)
 
        DEBUG(10, ("Deleting cache entry (key=[%s])\n", keystr));
 
-       /*
-        * We delete an element by setting its timeout to 0. This way we don't
-        * have to do a transaction on gencache.tdb every time we delete an
-        * element.
-        */
+       ret = tdb_chainlock(cache_notrans->tdb, key);
+       if (ret == -1) {
+               return false;
+       }
 
-       exists = gencache_get_data_blob(keystr, NULL, &value, NULL,
-                                       &was_expired);
+       gencache_parse(keystr, gencache_del_parser, &exists);
 
-       if (!exists && was_expired) {
+       if (exists) {
                /*
-                * gencache_get_data_blob has implicitly deleted this
-                * entry, so we have to return success here.
+                * We delete an element by setting its timeout to
+                * 0. This way we don't have to do a transaction on
+                * gencache.tdb every time we delete an element.
                 */
-               return true;
+               result = gencache_set(keystr, "", 0);
        }
 
-       if (exists) {
-               data_blob_free(&value);
-               ret = gencache_set(keystr, "", 0);
-       }
-       return ret;
+       tdb_chainunlock(cache_notrans->tdb, key);
+
+       return result;
 }
 
-static bool gencache_pull_timeout(char *val, time_t *pres, char **pendptr)
+static bool gencache_pull_timeout(uint8_t *val, time_t *pres, char **payload)
 {
        time_t res;
        char *endptr;
@@ -428,17 +432,17 @@ static bool gencache_pull_timeout(char *val, time_t 
*pres, char **pendptr)
                return false;
        }
 
-       res = strtol(val, &endptr, 10);
+       res = strtol((char *)val, &endptr, 10);
 
        if ((endptr == NULL) || (*endptr != '/')) {
-               DEBUG(2, ("Invalid gencache data format: %s\n", val));
+               DEBUG(2, ("Invalid gencache data format: %s\n", (char *)val));
                return false;
        }
        if (pres != NULL) {
                *pres = res;
        }
-       if (pendptr != NULL) {
-               *pendptr = endptr;
+       if (payload != NULL) {
+               *payload = endptr+1;
        }
        return true;
 }
@@ -446,7 +450,7 @@ static bool gencache_pull_timeout(char *val, time_t *pres, 
char **pendptr)
 struct gencache_parse_state {
        void (*parser)(time_t timeout, DATA_BLOB blob, void *private_data);
        void *private_data;
-       bool is_memcache;
+       bool copy_to_notrans;
 };
 
 static int gencache_parse_fn(TDB_DATA key, TDB_DATA data, void *private_data)
@@ -454,25 +458,23 @@ static int gencache_parse_fn(TDB_DATA key, TDB_DATA data, 
void *private_data)
        struct gencache_parse_state *state;
        DATA_BLOB blob;
        time_t t;
-       char *endptr;
+       char *payload;
        bool ret;
 
        if (data.dptr == NULL) {
                return -1;
        }
-       ret = gencache_pull_timeout((char *)data.dptr, &t, &endptr);
+       ret = gencache_pull_timeout(data.dptr, &t, &payload);
        if (!ret) {
                return -1;
        }
        state = (struct gencache_parse_state *)private_data;
        blob = data_blob_const(
-               endptr+1, data.dsize - PTR_DIFF(endptr+1, data.dptr));
+               payload, data.dsize - PTR_DIFF(payload, data.dptr));
        state->parser(t, blob, state->private_data);
 
-       if (!state->is_memcache) {
-               memcache_add(NULL, GENCACHE_RAM,
-                            data_blob_const(key.dptr, key.dsize),
-                            data_blob_const(data.dptr, data.dsize));
+       if (state->copy_to_notrans) {
+               tdb_store(cache_notrans->tdb, key, data, 0);
        }
 
        return 0;
@@ -485,7 +487,6 @@ bool gencache_parse(const char *keystr,
 {
        struct gencache_parse_state state;
        TDB_DATA key = string_term_tdb_data(keystr);
-       DATA_BLOB memcache_val;
        int ret;
 
        if (keystr == NULL) {
@@ -500,38 +501,35 @@ bool gencache_parse(const char *keystr,
 
        state.parser = parser;
        state.private_data = private_data;
+       state.copy_to_notrans = false;
 
-       if (memcache_lookup(NULL, GENCACHE_RAM,
-                           data_blob_const(key.dptr, key.dsize),
-                           &memcache_val)) {
-               /*
-                * Make sure that nobody has changed the gencache behind our
-                * back.
-                */
-               int current_seqnum = tdb_get_seqnum(cache_notrans->tdb);
-               if (current_seqnum == cache_notrans_seqnum) {
-                       /*
-                        * Ok, our memcache is still current, use it without
-                        * going to the tdb files.
-                        */
-                       state.is_memcache = true;
-                       gencache_parse_fn(key, make_tdb_data(memcache_val.data,
-                                                            
memcache_val.length),
-                                         &state);
-                       return true;
-               }
-               memcache_flush(NULL, GENCACHE_RAM);
-               cache_notrans_seqnum = current_seqnum;
+       ret = tdb_chainlock(cache_notrans->tdb, key);
+       if (ret != 0) {
+               return false;
        }
 
-       state.is_memcache = false;
-
        ret = tdb_parse_record(cache_notrans->tdb, key,
                               gencache_parse_fn, &state);
        if (ret == 0) {
+               tdb_chainunlock(cache_notrans->tdb, key);
                return true;
        }
+
+       state.copy_to_notrans = true;
+
        ret = tdb_parse_record(cache->tdb, key, gencache_parse_fn, &state);
+
+       if ((ret == -1) && (tdb_error(cache->tdb) == TDB_ERR_NOEXIST)) {
+               /*
+                * The record does not exist. Set a delete-marker in
+                * gencache_notrans, so that we don't have to look at
+                * the fcntl-based cache again.
+                */
+               gencache_set(keystr, "", 0);
+       }
+
+       tdb_chainunlock(cache_notrans->tdb, key);
+
        return (ret == 0);
 }
 
@@ -735,7 +733,7 @@ static int stabilize_fn(struct tdb_context *tdb, TDB_DATA 
key, TDB_DATA val,
                return 0;
        }
 
-       if (!gencache_pull_timeout((char *)val.dptr, &timeout, NULL)) {
+       if (!gencache_pull_timeout(val.dptr, &timeout, NULL)) {
                DEBUG(10, ("Ignoring invalid entry\n"));
                return 0;
        }
@@ -774,7 +772,7 @@ static int wipe_fn(struct tdb_context *tdb, TDB_DATA key, 
TDB_DATA val,
                return 0;
        }
 
-       ok = gencache_pull_timeout((char *)val.dptr, &timeout, NULL);
+       ok = gencache_pull_timeout(val.dptr, &timeout, NULL);
        if (!ok) {
                DEBUG(10, ("Ignoring invalid entry\n"));
                return 0;
@@ -800,7 +798,7 @@ static int wipe_fn(struct tdb_context *tdb, TDB_DATA key, 
TDB_DATA val,
  * @param timeout pointer to a time_t that is filled with entry's
  *        timeout
  *
- * @retval true when entry is successfuly fetched
+ * @retval true when entry is successfully fetched
  * @retval false for failure
  **/
 
@@ -869,7 +867,7 @@ static int gencache_iterate_blobs_fn(struct tdb_context 
*tdb, TDB_DATA key,
        char *keystr;
        char *free_key = NULL;
        time_t timeout;
-       char *endptr;
+       char *payload;
 
        if (tdb_data_cmp(key, last_stabilize_key()) == 0) {
                return 0;
@@ -889,10 +887,14 @@ static int gencache_iterate_blobs_fn(struct tdb_context 
*tdb, TDB_DATA key,
                }
        }
 
-       if (!gencache_pull_timeout((char *)data.dptr, &timeout, &endptr)) {
+       if (!gencache_pull_timeout(data.dptr, &timeout, &payload)) {
+               goto done;
+       }
+
+       if (timeout == 0) {
+               /* delete marker */
                goto done;
        }
-       endptr += 1;
 
        if (fnmatch(state->pattern, keystr, 0) != 0) {
                goto done;
@@ -903,8 +905,8 @@ static int gencache_iterate_blobs_fn(struct tdb_context 
*tdb, TDB_DATA key,
                   keystr, timestring(talloc_tos(), timeout)));
 
        state->fn(keystr,
-                 data_blob_const(endptr,
-                                 data.dsize - PTR_DIFF(endptr, data.dptr)),
+                 data_blob_const(payload,
+                                 data.dsize - PTR_DIFF(payload, data.dptr)),
                  timeout, state->private_data);
 
  done:
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 4a988b9..e2b4eb5 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -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;
        }
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 4de965e..ee9ddb2 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -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) {
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 73b5f3a..0c74286 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -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;


-- 
Samba Shared Repository

Reply via email to