[PATCH v2] ntdll: Avoid matching the config directory for /windows/ in lookup_unix_name().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46863 Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ntdll/directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index b46c2a6736..717873551b 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2638,7 +2638,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer char *p; unix_name[pos + ret] = 0; for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/'; - if (!redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 ))) + if (!redirect || strncmp( unix_name + pos, "/windows/", 9 )) { if (!stat( unix_name, &st )) { -- 2.17.1
Zebediah Figura <z.figura12(a)gmail.com> writes:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46863 Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ntdll/directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index b46c2a6736..717873551b 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2638,7 +2638,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer char *p; unix_name[pos + ret] = 0; for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/'; - if (!redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 ))) + if (!redirect || strncmp( unix_name + pos, "/windows/", 9 ))
There's no reason that /windows/ would be at the start of the path. Redirections should also work when accessed from the Z: drive for instance. -- Alexandre Julliard julliard(a)winehq.org
On 04/03/2019 02:11 PM, Alexandre Julliard wrote:
Zebediah Figura <z.figura12(a)gmail.com> writes:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46863 Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- dlls/ntdll/directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index b46c2a6736..717873551b 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2638,7 +2638,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer char *p; unix_name[pos + ret] = 0; for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/'; - if (!redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 ))) + if (!redirect || strncmp( unix_name + pos, "/windows/", 9 ))
There's no reason that /windows/ would be at the start of the path. Redirections should also work when accessed from the Z: drive for instance.
I see; that does make that approach somewhat unfeasible. I guess the better thing to do is adjust the subsequent conditions for failing early, then.
participants (2)
-
Alexandre Julliard -
Zebediah Figura