https://bugs.winehq.org/show_bug.cgi?id=39811
Bug ID: 39811 Summary: GetLongPathName not working on case insensitive filesystems when short path is passed Product: Wine Version: 1.7.49 Hardware: x86 OS: Mac OS X Status: NEW Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: piotr.caban@gmail.com
When short path is passed to GetLongPathName on case insensitive file system (and it's not vfat) it will fail. So far I have only confirmed the issue on Mac (when both read_directory_getattrlist and read_directory_stat is used). But I think there will be similar problem if case insensitive FS is used on Linux.
It's a regression that breaks some functionality in Quicken 2013.
It's caused by following commits: - read_directory_getattrlist: 5c98448aa3acb9bac40a0afa28ffbee3001081d0 - read_directory_stat: 2f0febe60a9f0b29840fc8d60679a8585b788ad5
Steps to reproduce the problem (on case insensitive file system): touch ~/.wine/drive_c/somelongname
char short_path[256], path2[256]; printf("%x\n", GetShortPathNameA("c:\somelongname", path, sizeof(path))); printf("%s\n", path); printf("%x\n", GetLongPathNameA(path, path2, sizeof(path2)); printf("%s\n", path2);
Output: b c:\SOME~LJ0 0
Correct output will be following: b c:\SOME~LJ0 f c:\somelongname
https://bugs.winehq.org/show_bug.cgi?id=39811
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |2f0febe60a9f0b29840fc8d6067 | |9a8585b788ad5
https://bugs.winehq.org/show_bug.cgi?id=39811
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=39811
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ken@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=39811
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matteo.mystral@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=39811
--- Comment #1 from Piotr Caban piotr.caban@gmail.com --- Probably a correct solution is to revert Ken's patch and remove "else if (!case_sensitive && ret && (errno == ENOENT || errno == ENOTDIR))" block from Matteo's patch but I'll leave it to patch authors.
https://bugs.winehq.org/show_bug.cgi?id=39811
--- Comment #2 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Piotr Caban from comment #1)
Probably a correct solution is to revert Ken's patch and remove "else if (!case_sensitive && ret && (errno == ENOENT || errno == ENOTDIR))" block from Matteo's patch but I'll leave it to patch authors.
That seems like a sensible solution. I would also add some tests to both NtQueryDirectoryFiles and GetLongPathName.
Actually if I'm not mistaken there is already a test for GetLongPathName which would regress with these patches...
https://bugs.winehq.org/show_bug.cgi?id=39811
--- Comment #3 from Piotr Caban piotr.caban@gmail.com --- (In reply to Matteo Bruni from comment #2)
Actually if I'm not mistaken there is already a test for GetLongPathName which would regress with these patches...
Yes, there are already GetLongPathName tests that regress because of the patches (in kernel32->path tests).
https://bugs.winehq.org/show_bug.cgi?id=39811
--- Comment #4 from Ken Thomases ken@codeweavers.com --- The suggested fix is OK with me.
After release, we might try putting in a test for the name matching the pattern of a short name and, if it doesn't, returning STATUS_NO_MORE_FILES. Obviously, we'll have to be much more careful with the testing this time around. :(
https://bugs.winehq.org/show_bug.cgi?id=39811
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |a8ef26149308f577151f14a2d35 | |9868754c7ea20 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Piotr Caban piotr.caban@gmail.com --- It works for me now. Marking as fixed.
https://bugs.winehq.org/show_bug.cgi?id=39811
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com Target Milestone|--- |1.8.x
https://bugs.winehq.org/show_bug.cgi?id=39811
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.0.
https://bugs.winehq.org/show_bug.cgi?id=39811
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.8.x |---
--- Comment #7 from Michael Stefaniuc mstefani@redhat.com --- Removing 1.8.x milestone from bugs included in 1.8.1.