Remove call into reduce_name if case sensitive. This allows us to pass
[ira/wip.git] / source3 / smbd / filename.c
index ee97388da28c925e1b66b923765308c9734fcf0e..16e36312bbf78fa472f36ab6e9f6a05f55310086 100644 (file)
@@ -238,7 +238,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                }
        }
 
-       posix_pathnames = lp_posix_pathnames();
+       posix_pathnames = (lp_posix_pathnames() ||
+                               (ucf_flags & UCF_POSIX_PATHNAMES));
 
        /*
         * Strip off the stream, and add it back when we're done with the
@@ -829,7 +830,8 @@ static int get_real_filename_full_scan(connection_struct *conn,
                                       TALLOC_CTX *mem_ctx, char **found_name)
 {
        struct smb_Dir *cur_dir;
-       char *dname = NULL;
+       const char *dname = NULL;
+       char *talloced = NULL;
        char *unmangled_name = NULL;
        long curpos;
 
@@ -881,11 +883,11 @@ static int get_real_filename_full_scan(connection_struct *conn,
 
        /* now scan for matching names */
        curpos = 0;
-       while ((dname = ReadDirName(cur_dir, &curpos, NULL))) {
+       while ((dname = ReadDirName(cur_dir, &curpos, NULL, &talloced))) {
 
                /* Is it dot or dot dot. */
                if (ISDOT(dname) || ISDOTDOT(dname)) {
-                       TALLOC_FREE(dname);
+                       TALLOC_FREE(talloced);
                        continue;
                }
 
@@ -908,13 +910,13 @@ static int get_real_filename_full_scan(connection_struct *conn,
                        TALLOC_FREE(cur_dir);
                        if (!*found_name) {
                                errno = ENOMEM;
-                               TALLOC_FREE(dname);
+                               TALLOC_FREE(talloced);
                                return -1;
                        }
-                       TALLOC_FREE(dname);
+                       TALLOC_FREE(talloced);
                        return 0;
                }
-               TALLOC_FREE(dname);
+               TALLOC_FREE(talloced);
        }
 
        TALLOC_FREE(unmangled_name);
@@ -973,8 +975,8 @@ static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,
        }
 
        if (errno != ENOENT) {
+               DEBUG(10, ("vfs_stat failed: %s\n", strerror(errno)));
                status = map_nt_error_from_unix(errno);
-               DEBUG(10, ("vfs_stat failed: %s\n", nt_errstr(status)));
                goto fail;
        }