s3: smbd: Moving lp_posix_pathnames() out of the lower-level code.
authorJeremy Allison <jra@samba.org>
Fri, 11 Dec 2015 22:41:38 +0000 (14:41 -0800)
committerJeremy Allison <jra@samba.org>
Sun, 13 Dec 2015 21:59:27 +0000 (22:59 +0100)
Prepare to remove lp_posix_pathnames() out of ms_has_wild().
Check before calls to ms_has_wild().

Fixup unix_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/filename.c

index 39b351be993ad0ec41c28fa77c034cbd90b94ce0..1174b590ea778cc2574d2c19d55aac4c637b7f2c 100644 (file)
@@ -448,11 +448,14 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
         * is true.
         */
 
-       name_has_wildcard = ms_has_wild(smb_fname->base_name);
-       if (name_has_wildcard && !allow_wcard_last_component) {
-               /* Wildcard not valid anywhere. */
-               status = NT_STATUS_OBJECT_NAME_INVALID;
-               goto fail;
+       if (!posix_pathnames) {
+               /* POSIX pathnames have no wildcards. */
+               name_has_wildcard = ms_has_wild(smb_fname->base_name);
+               if (name_has_wildcard && !allow_wcard_last_component) {
+                       /* Wildcard not valid anywhere. */
+                       status = NT_STATUS_OBJECT_NAME_INVALID;
+                       goto fail;
+               }
        }
 
        DEBUG(5,("unix_convert begin: name = %s, dirpath = %s, start = %s\n",
@@ -647,7 +650,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                /* The name cannot have a wildcard if it's not
                   the last component. */
 
-               name_has_wildcard = ms_has_wild(start);
+               if (!posix_pathnames) {
+                       name_has_wildcard = ms_has_wild(start);
+               }
 
                /* Wildcards never valid within a pathname. */
                if (name_has_wildcard && end) {