http://bugs.winehq.org/show_bug.cgi?id=21292
Summary: system call "open" doesn't reject trailing slash in filenames Product: Wine Version: 1.0.1 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: simon@josefsson.org
Here is another test case that triggers gnulib self-tests failures under Wine but not under Windows XP. Under Wine it prints:
out 3
but under Windows XP it prints:
out -1
which is expected.
Thanks, /Simon
jas@mocca:~$ cat foo.c #include <fcntl.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h>
int main (void) { int fd = open ("nonexist.ent/", O_CREAT | O_RDONLY, 0600); printf ("out %d\n", fd); return 0; } jas@mocca:~$ i586-mingw32msvc-gcc -o foo.exe foo.c jas@mocca:~$ wine --version wine-1.0.1 jas@mocca:~$ wine ./foo.exe out 3 jas@mocca:~$
http://bugs.winehq.org/show_bug.cgi?id=21292
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase
http://bugs.winehq.org/show_bug.cgi?id=21292
Andrew Nguyen arethusa26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #1 from Andrew Nguyen arethusa26@gmail.com 2010-01-09 18:27:53 --- I'm confirming with wine-1.1.36. Although native msvcrt doesn't make the test program exhibit the correct behavior on Wine, testing the app on Windows XP confirms the expected behavior.
http://bugs.winehq.org/show_bug.cgi?id=21292
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|msvcrt |-unknown
--- Comment #2 from Jeff Zaroyko jeffz@jeffz.name 2010-01-09 18:34:21 --- (In reply to comment #1)
Unsetting msvcrt component then. It's likely that because open is implemented with CreateFileW which is subsequently implemented with something in ntdll.
http://bugs.winehq.org/show_bug.cgi?id=21292
--- Comment #3 from Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de 2010-01-16 12:58:47 --- Created an attachment (id=25755) --> (http://bugs.winehq.org/attachment.cgi?id=25755) Patch
Not sure what to do about it, as NT4 gives different result as all other systems
http://bugs.winehq.org/show_bug.cgi?id=21292
--- Comment #4 from Jeff Zaroyko jeffz@jeffz.name 2010-01-16 16:46:32 --- (In reply to comment #3)
Created an attachment (id=25755)
--> (http://bugs.winehq.org/attachment.cgi?id=25755) [details]
Does that file actually exist after the call succeeds?
Have you tested the ntdll api NtCreateFile/NtOpenFile to see if the behavior is actually there rather than in kernel32?
http://bugs.winehq.org/show_bug.cgi?id=21292
--- Comment #5 from Austin English austinenglish@gmail.com 2012-06-24 22:38:58 CDT --- Now gives out 4.
Still present in 1.5.7.
http://bugs.winehq.org/show_bug.cgi?id=21292
--- Comment #6 from Austin English austinenglish@gmail.com 2012-06-24 22:39:20 CDT --- Created attachment 40696 --> http://bugs.winehq.org/attachment.cgi?id=40696 precompiled exe
https://bugs.winehq.org/show_bug.cgi?id=21292
--- Comment #7 from Ken Sharp imwellcushtymelike@gmail.com --- Back to printing 3. Wine 1.7.45.
https://bugs.winehq.org/show_bug.cgi?id=21292
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source
https://bugs.winehq.org/show_bug.cgi?id=21292
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #8 from super_man@post.com --- wine 1.8rc1 and wine-staging 1.7.55 both prints 3
https://bugs.winehq.org/show_bug.cgi?id=21292
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #9 from winetest@luukku.com --- (In reply to super_man from comment #8)
wine 1.8rc1 and wine-staging 1.7.55 both prints 3
Both wine 2.5-git and wine-staging 2.4 prints 3.
https://bugs.winehq.org/show_bug.cgi?id=21292
Martin Storsjö martin@martin.st changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |martin@martin.st
--- Comment #10 from Martin Storsjö martin@martin.st --- Created attachment 69568 --> https://bugs.winehq.org/attachment.cgi?id=69568 Test case based on CreateFileA()
I also ran into this (via a testsuite), and I had created a testcase (based on CreateFileA() instead of the CRT open() as tested here) before I found this preexisting bug.