http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #4 from Anastasius Focht focht@gmx.net 2009-04-07 15:38:49 --- Hello,
GetUserNameEx (NameSamCompatible) is now partially implemented by commit dcb3e52e2dfd0d6e494164932fb2b684d463a005
Although it goes further only to hit NTLM auth/secure RPC bug it now seems to hide the security descriptor bug (.rsp files) due to another bug in LookupAccountNameW(). Compare with previous analysis from my comment #1
--- snip --- ... 0038:Call KERNEL32.CreateFileW(0106fe00 L"c:\scriptdbg\Debug\RSP000001856.rsp",00000000,00000000,00000000,00000003,00000000,00000000) ret=5aee09d3 0038:Ret KERNEL32.CreateFileW() retval=ffffffff ret=5aee09d3 ... 0038:Call KERNEL32.LoadLibraryExW(0106f2b8 L"C:\windows\system32\secur32.dll",00000000,00000008) ret=5aeef431 0038:Ret KERNEL32.LoadLibraryExW() retval=60ea0000 ret=5aeef431 ... 0038:Call KERNEL32.GetProcAddress(60ea0000,5aee1388 "GetUserNameExW") ret=5aee1016 0038:Ret KERNEL32.GetProcAddress() retval=60ea6370 ret=5aee1016 0038:Call secur32.GetUserNameExW(00000002,1513dcbc,1513dc44) ret=5aee1041 0038:Call KERNEL32.GetComputerNameW(1513d8b6,1513dad8) ret=60eadf3c 0038: open_key( parent=0000, access=000f003f, attributes=00000000, name=L"Machine\System\CurrentControlSet\Control\ComputerName" ) 0038: open_key() = 0 { hkey=030c } 0038: open_key( parent=030c, access=000f003f, attributes=00000000, name=L"ActiveComputerName" ) 0038: open_key() = 0 { hkey=0438 } 0038: get_key_value( hkey=0438, name=L"ComputerName" ) 0038: get_key_value() = 0 { type=1, total=12, data={6e,00,65,00,78,00,75,00,73,00,00,00} } 0038: close_handle( handle=0438 ) 0038: close_handle() = 0 0038: close_handle( handle=030c ) 0038: close_handle() = 0 0038:Ret KERNEL32.GetComputerNameW() retval=00000001 ret=60eadf3c 0038:Call advapi32.GetUserNameW(1513d8c2,1513dad8) ret=60eadf84 0038:Ret advapi32.GetUserNameW() retval=00000001 ret=60eadf84 0038:Ret secur32.GetUserNameExW() retval=00000001 ret=5aee1041 0038:Call ntdll.RtlAllocateHeap(00550000,00000000,00000100) ret=78134ce9 0038:Ret ntdll.RtlAllocateHeap() retval=146e03a8 ret=78134ce9 0038:Call advapi32.LookupAccountNameW(00000000,1513dcbc L"nexus\focht",1513db08,1513da74,146e03a8,1513da6c,1513dca8) ret=5aee1b0c 0038:fixme:advapi:LookupAccountNameW (null) L"nexus\focht" 0x1513db08 0x1513da74 0x146e03a8 0x1513da6c 0x1513dca8 - stub 0038: open_key( parent=0000, access=000f003f, attributes=00000000, name=L"Machine\System\CurrentControlSet\Control\ComputerName" ) 0038: open_key() = 0 { hkey=030c } 0038: open_key( parent=030c, access=000f003f, attributes=00000000, name=L"ActiveComputerName" ) 0038: open_key() = 0 { hkey=0438 } 0038: get_key_value( hkey=0438, name=L"ComputerName" ) 0038: get_key_value() = 0 { type=1, total=12, data={6e,00,65,00,78,00,75,00,73,00,00,00} } 0038: close_handle( handle=0438 ) 0038: close_handle() = 0 0038: close_handle( handle=030c ) 0038: close_handle() = 0 0038:Ret advapi32.LookupAccountNameW() retval=00000000 ret=5aee1b0c 0038:Call KERNEL32.GetLastError() ret=5af3e0f7 0038:Ret KERNEL32.GetLastError() retval=00000534 ret=5af3e0f7 ... 0038:Call KERNEL32.RaiseException(e06d7363,00000001,00000003,1513db2c) ret=78158dd3 ... 0038:Call KERNEL32.GetLastError() ret=78132d14 0038:Ret KERNEL32.GetLastError() retval=00000534 ret=78132d14 ... 0038:Call KERNEL32.CreateFileW(0106fe00 L"c:\scriptdbg\Debug\RSP000001856.rsp",40000000,00000000,1513dbf4,00000002,00000100,00000000) ret=5aee1113 0038: create_file( access=40000000, attributes=00000040, sharing=00000000, create=5, options=00000050, attrs=00000100, objattr={rootdir=0000,sd={},name=L""}, filename="/home/focht/.wine/dosdevices/c:/scriptdbg/Debug/RSP000001856.rsp" ) 0038: create_file() = 0 { handle=030c } --- snip ---
LookupAccountNameW( "<computername>\<user>") fails -> exception and the .rsp file creation goes the "fallback" route with NULL sd and DACL which of course succeeds (server will grant full access rights with no SD/ACL present).
You can't compare the account name arg directly with GetUserNameW() respective GetComputerNameW() when it's in format "<computername>\<user>". You already split the parts - now use them ;-)
Regards