From 9377f3bce0866e2fadeea5ba87f7ee41f7d9ba31 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Mar 2016 11:34:30 -0700 Subject: [PATCH] s3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert(). This allows vendors to ensure that flags such as UCF_PREP_CREATEFILE are always passed to their VFS modules whilst smbd is doing pathname lookup - even before the create VFS call is done. Signed-off-by: Jeremy Allison Reviewed-by: Richard Sharpe Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Mar 26 00:08:40 CET 2016 on sn-devel-144 --- source3/smbd/msdfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index a51548a531d..51e3dff2678 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -669,7 +669,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx, const char *dfspath, /* Incoming complete dfs path */ const struct dfs_path *pdp, /* Parsed out server+share+extrapath. */ - bool search_flag, /* Called from a findfirst ? */ + uint32_t ucf_flags, int *consumedcntp, char **pp_targetpath) { @@ -691,7 +691,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx, */ status = unix_convert(ctx, conn, pdp->reqpath, &smb_fname, - search_flag ? UCF_ALWAYS_ALLOW_WCARD_LCOMP : 0); + ucf_flags); if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_EQUAL(status, @@ -707,7 +707,10 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx, if (is_msdfs_link_internal(ctx, conn, smb_fname->base_name, pp_targetpath, NULL)) { - if (search_flag) { + /* XX_ALLOW_WCARD_XXX is called from search functions. */ + if (ucf_flags & + (UCF_COND_ALLOW_WCARD_LCOMP| + UCF_ALWAYS_ALLOW_WCARD_LCOMP)) { DEBUG(6,("dfs_path_lookup (FindFirst) No redirection " "for dfs link %s.\n", dfspath)); status = NT_STATUS_OK; -- 2.47.3