From 18dc1cd00f09d051497cf89e348f8ba794c63230 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Oct 2004 05:29:59 +0000 Subject: r2893: added very primitive name mangling support to pvfs (This used to be commit 749fa73544201f521d9cd3fa972b89cae99bc2c0) --- source4/ntvfs/posix/pvfs_resolve.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/posix/pvfs_resolve.c') diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index e846b7be77..5d6f270a42 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -33,9 +33,19 @@ /* compare two filename components. This is where the name mangling hook will go */ -static int component_compare(const char *c1, const char *c2) +static int component_compare(struct pvfs_state *pvfs, const char *comp, const char *name) { - return StrCaseCmp(c1, c2); + char *shortname; + int ret; + + if (StrCaseCmp(comp, name) == 0) return 0; + + shortname = pvfs_short_name_component(pvfs, name); + + ret = StrCaseCmp(comp, shortname); + + talloc_free(shortname); + return ret; } /* @@ -110,7 +120,7 @@ static NTSTATUS pvfs_case_search(struct pvfs_state *pvfs, struct pvfs_filename * } while ((de = readdir(dir))) { - if (component_compare(components[i], de->d_name) == 0) { + if (component_compare(pvfs, components[i], de->d_name) == 0) { break; } } -- cgit