]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert().
authorJeremy Allison <jra@samba.org>
Fri, 25 Mar 2016 18:34:30 +0000 (11:34 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 25 Mar 2016 23:08:40 +0000 (00:08 +0100)
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 <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 26 00:08:40 CET 2016 on sn-devel-144

source3/smbd/msdfs.c

index a51548a531d04d2fde0a0a352a8fd44ad70feb55..51e3dff26787d57ff38ece466975d9bb20d53c47 100644 (file)
@@ -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;