[Bug 17875] New: GetTempFileName with unique != 0 broken
http://bugs.winehq.org/show_bug.cgi?id=17875 Summary: GetTempFileName with unique != 0 broken Product: Wine Version: 1.1.18 Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P1 Component: kernel32 AssignedTo: wine-bugs(a)winehq.org ReportedBy: dev_oskar(a)hotmail.com GetTempFileName called with a non-zero value for unique will not check if a file could be actually written in the provided path. Paint Shop Pro 9 (and it seems 8 too) uses the return code to test if it should create several temp directories. So under wine it will always fail if unique is non-zero, GetTempFileName will currently not test anything and won't return zero, so creation of the undo files later will fail because the directory doesn't exists. As the documentation tells the file isn't created my first patch isn't correct: ... if (unique) { sprintfW( p, formatW, unique ); /* need to check if we can create the file so applications can detect if they can write */ HANDLE handle; handle = CreateFileW( buffer, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 ); if (handle != INVALID_HANDLE_VALUE) { /* We created it */ CloseHandle( handle ); TRACE("created %s\n", debugstr_w(buffer) ); return unique; } /* Failure */ return 0; } else { /* get a "random" unique number and try to create the file */ ... It should check the directory if it exists. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 --- Comment #1 from Oskar Eisemuth <dev_oskar(a)hotmail.com> 2009-03-29 11:28:44 --- (In reply to comment #0) After further tests it should always check if the directory is valid regardless of unique. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 --- Comment #2 from Oskar Eisemuth <dev_oskar(a)hotmail.com> 2009-04-09 03:12:33 --- Created an attachment (id=20345) --> (http://bugs.winehq.org/attachment.cgi?id=20345) Patch for GetTempFileName to return 0 if the path doesn't exists. Includes GetTempFileName patch and a test-case -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase --- Comment #3 from Austin English <austinenglish(a)gmail.com> 2009-04-09 17:48:08 --- Please send patches to wine-patches(a)winehq.org -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Oskar Eisemuth <dev_oskar(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX --- Comment #4 from Oskar Eisemuth <dev_oskar(a)hotmail.com> 2009-04-11 12:25:07 --- The patch (including tests as requested) was send last month: http://www.winehq.org/pipermail/wine-patches/2009-March/071328.html A notice for the new version of the patch was send on devel too, so I consider the current status as "WONTFIX" and attached the patch here only for reference. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Vitaliy Margolen <vitaliy(a)kievinfo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|WONTFIX | --- Comment #5 from Vitaliy Margolen <vitaliy(a)kievinfo.com> 2009-04-11 12:41:45 --- It's still a valid bug. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish(a)gmail.com --- Comment #6 from Austin English <austinenglish(a)gmail.com> 2009-10-12 14:48:00 --- Still present. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 André H. <nerv(a)dawncrow.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv(a)dawncrow.de --- Comment #7 from André H. <nerv(a)dawncrow.de> 2010-06-01 12:56:11 --- try again with that patch? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 jussi.kivilinna(a)mbnet.fi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jussi.kivilinna(a)mbnet.fi --- Comment #8 from jussi.kivilinna(a)mbnet.fi 2010-07-19 15:45:50 --- Still same problem with 1.2 stable. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |xerox_xerox2000(a)yahoo.co.uk Ever Confirmed|0 |1 Severity|major |normal --- Comment #9 from Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> 2010-10-16 18:02:26 CDT --- The tests starting from line : /* And when the path is actually a file */ don't make really sense There is no way AFAICT how GetTempFileName can decide whether tmpfile is a file or a directory. I created some new tests, i'll see if i can get them into the tree. Once the tests are accepted, the fix is rather trivial i guess -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 --- Comment #10 from Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> 2010-10-16 18:05:06 CDT --- Created an attachment (id=31319) --> (http://bugs.winehq.org/attachment.cgi?id=31319) tests additional tests for GetTempFileName -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 --- Comment #11 from Austin English <austinenglish(a)gmail.com> 2010-10-22 13:37:02 CDT --- Probably fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=8819ae1e66fb0d41815945... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #12 from Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> 2010-10-22 15:14:08 CDT --- (In reply to comment #11)
Probably fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=8819ae1e66fb0d41815945...
yes ,don't have Photoshop, but this should be fixed according to Oskar's description + tests. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #13 from Alexandre Julliard <julliard(a)winehq.org> 2010-10-29 12:59:14 CDT --- Closing bugs fixed in 1.3.6. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.2.x -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=17875 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.2.x |--- --- Comment #14 from Alexandre Julliard <julliard(a)winehq.org> 2010-12-03 12:51:57 CST --- Removing 1.2.x milestone from bugs included in 1.2.2. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org