http://bugs.winehq.org/show_bug.cgi?id=10612
Summary: LookupAccountNameA returns Domain Size that is one byte too big Product: Wine Version: 0.9.49. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-advapi32 AssignedTo: wine-bugs@winehq.org ReportedBy: lehmannd@in.tum.de
When calling LookupAccountNameA in Windows, cbReferencedDomainName is set to the number of characters in the string (e.g. for "DOMAIN" windows returns 6). In my tests Wine always returned the string "DOMAIN" and the length 7.
I think the bug is in there because LookupAccountNameW is called internally but that function is supposed to return the number of characters plus 1.
I confirmed the behaviour in Vista and Windows 2000.
I will try to fix it myself.
http://bugs.winehq.org/show_bug.cgi?id=10612
Daniel Lehmann lehmannd@in.tum.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lehmannd@in.tum.de
http://bugs.winehq.org/show_bug.cgi?id=10612
Zac Brown zac@zacbrown.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zac@zacbrown.org
--- Comment #1 from Zac Brown zac@zacbrown.org 2007-12-20 21:53:49 --- Hi,
I just submitted a patch for this bug. The patch can be found here: http://www.winehq.org/pipermail/wine-patches/2007-December/048210.html
This small patch seems to make wine behave properly. After some careful study, if you look at the first two cases in dlls/advapi32/test/security.c for LookupAccountName, one would think they should both behave the same but Windows seems to treat instances when no Sid is provided differently.
Another odd behavior by Windows.
-Zac
http://bugs.winehq.org/show_bug.cgi?id=10612
--- Comment #2 from Zac Brown zac@zacbrown.org 2007-12-20 22:20:39 --- Ignore that patch, has stupid mistakes in it. Will send a second, improved one.
-Zac
http://bugs.winehq.org/show_bug.cgi?id=10612
--- Comment #3 from Zac Brown zac@zacbrown.org 2007-12-21 02:35:29 --- This is a better patch that I submitted to wine-patches tonight:
http://www.winehq.org/pipermail/wine-patches/2007-December/048222.html
This should address the issues properly.
-Zac
http://bugs.winehq.org/show_bug.cgi?id=10612
--- Comment #4 from Daniel Lehmann lehmannd@in.tum.de 2008-03-27 06:08:05 --- I created a GUI test application which demonstrates the bug:
http://www.daniellehmann.net/advapi32.zip
http://bugs.winehq.org/show_bug.cgi?id=10612
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |download
--- Comment #5 from Austin English austinenglish@gmail.com 2008-03-28 13:04:42 --- Confirming in wine 0.9.58.
Can you post the source to that app and/or integrate it into a wine regression test?
http://bugs.winehq.org/show_bug.cgi?id=10612
--- Comment #6 from Daniel Lehmann lehmannd@in.tum.de 2008-03-29 18:03:32 --- Sorry, forgot the source code. I uploaded it here:
http://www.daniellehmann.net/advapi32source.zip
It's Delphi code but I hope it will be useful anyway.
Thanks a lot!
http://bugs.winehq.org/show_bug.cgi?id=10612
Daniel Lehmann lehmannd@in.tum.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|0.9.49. |0.9.58.
http://bugs.winehq.org/show_bug.cgi?id=10612
James Hawkins truiken@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|0.9.58. |0.9.49.
--- Comment #7 from James Hawkins truiken@gmail.com 2008-03-29 18:21:57 --- Don't change the original reported version.
http://bugs.winehq.org/show_bug.cgi?id=10612
--- Comment #8 from Daniel Lehmann lehmannd@in.tum.de 2008-09-07 14:42:55 --- Confirmed in Wine 1.1.4
http://bugs.winehq.org/show_bug.cgi?id=10612
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, testcase
http://bugs.winehq.org/show_bug.cgi?id=10612
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bunglehead@gmail.com
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com 2009-01-14 20:52:21 --- I can't reproduce this on wine-1.1.12-586-g8b10dd2. First call LookupAccountNameA returns length including NULL and the second one returns copied characters count without NULL.
Daniel, could you be more specific about argument set - I've tested this on WinXP SP2 with NULL account name and it matches Wine behavior here:
--- 1st call LookupAccountNameA(NULL, NULL, NULL, &sid_size, NULL, &domain_size, &sid_use); --- 2nd call /* try NULL account name */ LookupAccountNameA(NULL, NULL, psid, &sid_size, domain, &domain_size, &sid_use); ---
Example taken from current test_LookupAccountName from advapi32/tests.
http://bugs.winehq.org/show_bug.cgi?id=10612
Daniel Lehmann lehmannd@in.tum.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #10 from Daniel Lehmann lehmannd@in.tum.de 2009-01-15 04:26:21 --- This has been fixed somewhere between 1.1.5 and 1.1.12.
Thank you!
http://bugs.winehq.org/show_bug.cgi?id=10612
Daniel Lehmann lehmannd@in.tum.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Daniel Lehmann lehmannd@in.tum.de 2009-01-15 04:27:12 --- I am new to bugzilla but I guess I can close this.
http://bugs.winehq.org/show_bug.cgi?id=10612
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|FIXED |
--- Comment #12 from Austin English austinenglish@gmail.com 2009-01-15 05:04:41 --- (In reply to comment #11)
I am new to bugzilla but I guess I can close this.
We close bugs whenever the next version is released.
http://bugs.winehq.org/show_bug.cgi?id=10612
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #13 from Austin English austinenglish@gmail.com 2009-01-15 05:04:47 --- Fixed.
http://bugs.winehq.org/show_bug.cgi?id=10612
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Alexandre Julliard julliard@winehq.org 2009-01-16 10:37:22 --- Closing bugs fixed in 1.1.13.