#include "includes.h"
-static bool get_real_filename(connection_struct *conn, const char *path,
- const char *name, TALLOC_CTX *mem_ctx,
- char **found_name);
+static int get_real_filename(connection_struct *conn, const char *path,
+ const char *name, TALLOC_CTX *mem_ctx,
+ char **found_name);
static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,
connection_struct *conn,
const char *orig_path,
*/
if (name_has_wildcard ||
- !get_real_filename(conn, dirpath, start,
- talloc_tos(), &found_name)) {
+ (get_real_filename(
+ conn, dirpath, start,
+ talloc_tos(), &found_name) == -1)) {
char *unmangled;
if (end) {
If the name looks like a mangled name then try via the mangling functions
****************************************************************************/
-static bool get_real_filename(connection_struct *conn, const char *path,
- const char *name, TALLOC_CTX *mem_ctx,
- char **found_name)
+int get_real_filename(connection_struct *conn, const char *path,
+ const char *name, TALLOC_CTX *mem_ctx,
+ char **found_name)
{
struct smb_Dir *cur_dir;
const char *dname;
*/
if (!mangled && !(conn->fs_capabilities & FILE_CASE_SENSITIVE_SEARCH)) {
errno = ENOENT;
- return False;
+ return -1;
}
/*
if (!(cur_dir = OpenDir(talloc_tos(), conn, path, NULL, 0))) {
DEBUG(3,("scan dir didn't open dir [%s]\n",path));
TALLOC_FREE(unmangled_name);
- return(False);
+ return -1;
}
/* now scan for matching names */
TALLOC_FREE(cur_dir);
if (!*found_name) {
errno = ENOMEM;
- return False;
+ return -1;
}
- return(True);
+ return 0;
}
}
TALLOC_FREE(unmangled_name);
TALLOC_FREE(cur_dir);
errno = ENOENT;
- return False;
+ return -1;
}
static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,