http://bugs.winehq.org/show_bug.cgi?id=17096
Summary: Visual C++ 2005 Trial can't build project, complains when starting mspdbsrv Product: Wine Version: 1.1.13 Platform: Other URL: http://download.microsoft.com/download/6/f/5/6f5f7a01- 50bb-422d-8742- c099c8896969/En_vs_2005_vsts_180_Trial.img OS/Version: other Status: NEW Keywords: download Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
Since Visual C++ Express 2005 installs, I figured I'd try the trial for full-on Visual C++ 2005, available at the given url. Sure enough, it took 30 minutes, but it installed!
Then I tried building a project. I tried both Chromium's net unittest and a trivial old visual c++ 6 (?) project from codeguru, http://www.codeguru.com/cpp/g-m/gdi/capturingimages/article.php/c6333/ In both cases, visual c++ 2005 complained during compile:
MSPDBSRV: fatal error: Unable to start server: server already exist
From +relay, the commandline it's using to start mspdbsrv is
C:\Program Files\Microsoft Visual Studio 8\Common7\ide\mspdbsrv.exe -start -spawn
And sure enough, running wine mspdbsrv -start -spawn in directory C:\Program Files\Microsoft Visual Studio 8\Common\ide\ generates the same error message (and a remarkably short +relay log).
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #1 from Dan Kegel dank@kegel.com 2009-01-23 10:35:26 --- Created an attachment (id=18934) --> (http://bugs.winehq.org/attachment.cgi?id=18934) +relay log of starting mspdbsrv -start -spawn
http://bugs.winehq.org/show_bug.cgi?id=17096
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #2 from Anastasius Focht focht@gmx.net 2009-02-05 17:09:48 --- Hello,
--- quote --- MSPDBSRV: fatal error: Unable to start server: server already exist --- quote ---
Looks like GetUserNameExW() is the first problem here. It needs to return something useful.
--- snip --- ... 0036:Call secur32.GetUserNameExW(00000002,00000000,0033d924) ret=10314c28 0036:fixme:secur32:GetUserNameExW 2 (nil) 0x33d924 0036:Ret secur32.GetUserNameExW() retval=00000000 ret=10314c28 0036:Call KERNEL32.GetLastError() ret=10314c2e 0036:Ret KERNEL32.GetLastError() retval=00000000 ret=10314c2e ... 0036:Call version.GetFileVersionInfoSizeW(0033e78c L"C:\Program Files\Microsoft Visual Studio 8\Common7\ide\mspdbsrv.exe",0033d374) ret=10314f3e 0036:Call KERNEL32.GetModuleHandleExW(00000000,0033e78c,0033d200) ret=65b15c77 0036:Ret KERNEL32.GetModuleHandleExW() retval=00000000 ret=65b15c77 0036:Call KERNEL32.LoadLibraryExW(0033e78c L"C:\Program Files\Microsoft Visual Studio 8\Common7\ide\mspdbsrv.exe",00000000,00000002) ret=65b15c99 0036:Ret KERNEL32.LoadLibraryExW() retval=00750001 ret=65b15c99 ... 0036:Call KERNEL32.CreateProcessW(0033e78c L"C:\Program Files\Microsoft Visual Studio 8\Common7\ide\mspdbsrv.exe",0033e994 L"mspdbsrv.exe -start -spawn",00000000,00000000,00000000,00000008,00000000,0033e584 L"C:\Program Files\Microsoft Visual Studio 8\Common7\ide\",0033d324,0033e9fc) ret=1031505d ... 0036:trace:process:CreateProcessW started process pid 0038 tid 0039 0036:Ret KERNEL32.CreateProcessW() retval=00000001 ret=1031505d --- snip ---
MSDN: http://msdn.microsoft.com/en-us/library/ms724435.aspx
With current user name returned (GetUserNameW seems sufficient when "NameSamCompatible" is requested) it goes a little further just to unearth a wineserver file security (SID) misconception.
The IDE creates a temporary command file for compiler (cl.exe) run. "response file" -> *.rsp
--- snip --- 002e:Call KERNEL32.CreateFileW(00f5fad0 L"c:\test\Debug\RSP000001846.rsp",00000000,00000000,00000000,00000003,00000000,00000000) ret=5aee09d3 002e:trace:ntdll:NtCreateFile handle=0x7ddb29f0 access=00000000 name=L"\??\C:\test\Debug\RSP000001846.rsp" objattr=00000040 root=(nil) sec=(nil) io=0x7ddb29f4 alloc_size=(nil) attr=00000000 sharing=00000000 disp=1 options=00000050 ea=(nil).0x00000000 002e:warn:ntdll:NtCreateFile L"\??\C:\test\Debug\RSP000001846.rsp" not found (c0000034) 002e:Ret KERNEL32.CreateFileW() retval=ffffffff ret=5aee09d3 ... 002e:Call KERNEL32.LoadLibraryExW(00f5a5d8 L"C:\windows\system32\secur32.dll",00000000,00000008) ret=5aeef431 002e:Ret KERNEL32.LoadLibraryExW() retval=60cc0000 ret=5aeef431 ... 002e:Call KERNEL32.GetProcAddress(60cc0000,5aee1388 "GetUserNameExW") ret=5aee1016 002e:Ret KERNEL32.GetProcAddress() retval=60cc2670 ret=5aee1016 002e:Call secur32.GetUserNameExW(00000002,7ddb2cac,7ddb2c34) ret=5aee1041 002e:fixme:secur32:GetUserNameExW 2 0x7ddb2cac 0x7ddb2c34 002e:Call advapi32.GetUserNameW(7ddb2cac,7ddb2c34) ret=60cd1fbf 002e:Ret advapi32.GetUserNameW() retval=00000001 ret=60cd1fbf 002e:Ret secur32.GetUserNameExW() retval=00000001 ret=5aee1041 002e:Call ntdll.RtlAllocateHeap(00550000,00000000,00000100) ret=78134ce9 002e:Ret ntdll.RtlAllocateHeap() retval=0e176dd8 ret=78134ce9 002e:Call advapi32.LookupAccountNameW(00000000,7ddb2cac L"focht",7ddb2af8,7ddb2a64,0e176dd8,7ddb2a5c,7ddb2c98) ret=5aee1b0c 002e:fixme:advapi:LookupAccountNameW (null) L"focht" 0x7ddb2af8 0x7ddb2a64 0xe176dd8 0x7ddb2a5c 0x7ddb2c98 - stub 002e:trace:ntdll:RtlAllocateAndInitializeSid (0x7ddb290e, 0x0002,0x00000020,0x00000220,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x7ddb2908) 002e:trace:ntdll:RtlLengthSid sid=0xf4e768 002e:trace:ntdll:RtlLengthSid sid=0xf4e768 002e:trace:ntdll:RtlLengthSid sid=0xf4e768 002e:trace:ntdll:RtlLengthSid sid=0xf4e768 002e:trace:ntdll:RtlFreeSid (0xf4e768) 002e:Ret advapi32.LookupAccountNameW() retval=00000001 ret=5aee1b0c ... 002e:Call advapi32.GetSidLengthRequired(00000002) ret=5aee1d09 002e:Ret advapi32.GetSidLengthRequired() retval=00000010 ret=5aee1d09 002e:Call advapi32.InitializeSid(7ddb2ae0,5aee1dac,00000002) ret=5aee1d1e 002e:Ret advapi32.InitializeSid() retval=00000001 ret=5aee1d1e 002e:Call advapi32.GetSidSubAuthority(7ddb2ae0,00000000) ret=5aee1d44 002e:Ret advapi32.GetSidSubAuthority() retval=7ddb2ae8 ret=5aee1d44 002e:Call advapi32.GetSidSubAuthority(7ddb2ae0,00000001) ret=5aee1d44 002e:Ret advapi32.GetSidSubAuthority() retval=7ddb2aec ret=5aee1d44 ... 002e:Call advapi32.InitializeSecurityDescriptor(0e176c78,00000001) ret=5aee0ab2 002e:Ret advapi32.InitializeSecurityDescriptor() retval=00000001 ret=5aee0ab2 ... 002e:Call advapi32.SetSecurityDescriptorDacl(0e176c78,00000001,0e176f38,00000000) ret=5aee1a44 002e:Ret advapi32.SetSecurityDescriptorDacl() retval=00000001 ret=5aee1a44 002e:Call KERNEL32.CreateFileW(00f5fad0 L"c:\test\Debug\RSP000001846.rsp",40000000,00000000,7ddb2be4,00000002,00000100,00000000) ret=5aee1113 002e:trace:ntdll:NtCreateFile handle=0x7ddb2a60 access=40000000 name=L"\??\C:\test\Debug\RSP000001846.rsp" objattr=00000040 root=(nil) sec=0xe176c78 io=0x7ddb2a64 alloc_size=(nil) attr=00000100 sharing=00000000 disp=5 options=00000050 ea=(nil).0x00000000 002e:trace:ntdll:RtlGetSaclSecurityDescriptor (0xe176c78,0x7ddb2824,0x7ddb2828,0x7ddb2823) 002e:trace:ntdll:RtlGetDaclSecurityDescriptor (0xe176c78,0x7ddb2825,0x7ddb282c,0x7ddb2823) 002e: create_file( access=40000000, attributes=00000040, sharing=00000000, create=5, options=00000050, attrs=00000100, objattr={rootdir=0000,sd={control=00000004,owner=<not present>,group=<not present>,sacl={},dacl={{AceType=ACCESS_ALLOWED_ACE_TYPE,Mask=10000000,AceFlags=0,Sid={S-1-5-32-544}},{AceType=ACCESS_ALLOWED_ACE_TYPE,Mask=10000000,AceFlags=0,Sid={S-1-5-32-544}}}},name=L""}, filename="/home/focht/.wine/dosdevices/c:/test/Debug/RSP000001846.rsp" ) 002e: create_file() = 0 { handle=05e4 } --- snip ---
Two "access allowed" ACEs are present in security descriptor, SID: "S-1-5-32-544" -> "Administrators" (GetUserNameExW -> LookupAccountNameW -> default Admin SID) and GENERIC_ALL access. Owner and group are not set in SD.
Later, file access fails which blocks the build/compiler run:
--- snip --- .... 0031:Call KERNEL32.CreateFileW(00531190 L"c:\test\Debug\RSP000001846.rsp",80000000,00000003,0033fba8,00000003,00000080,00000000) ret=781657d7 0031:trace:ntdll:NtCreateFile handle=0x33fa90 access=80000000 name=L"\??\C:\test\Debug\RSP000001846.rsp" objattr=00000042 root=(nil) sec=(nil) io=0x33fa94 alloc_size=(nil) attr=00000080 sharing=00000003 disp=1 options=00000050 ea=(nil).0x00000000 0031: create_file( access=80000000, attributes=00000042, sharing=00000003, create=1, options=00000050, attrs=00000080, objattr={rootdir=0000,sd={},name=L""}, filename="/home/focht/.wine/dosdevices/c:/test/Debug/RSP000001846.rsp" ) 0031: create_file() = ACCESS_DENIED { handle=0000 } 0031:Ret KERNEL32.CreateFileW() retval=ffffffff ret=781657d7 ... --- snip ---
--- snip --- [Debug]$ ls -lsa total 40 ... 8 -rw-rw-r-- 1 focht focht 6084 2009-02-05 21:27 BuildLog.htm 4 ---------- 1 focht focht 462 2009-02-05 21:27 RSP000001846.rsp 4 ---------- 1 focht focht 822 2009-02-05 21:27 RSP000002846.rsp ... --- snip ---
When a security descriptor is supplied with create_file(), wineserver looks at the owner and if not present, it retrieves the SID from current user process token. The (default) "interactive" SID is the one returned, leading to following problem...
When wineserver translates the security descriptor to appropriate mode bits (sd_to_mode), it loops through ACEs, in this case two (identical) "access allowed" ACEs of admin SID. Due to SID mismatch (neither "world" nor "owner" SID), no mode bits are actually set with the result seen above.
The next problem is mspdb client trying to establish secure RPC (NTLM auth) to mspdbsrv.exe server (GetUserNameExW needed). No password is given hence it fails while trying to retrieve cached credentials if winbind/samba is not properly set up. You could patch ntlm_InitializeSecurityContextW() to fall back to empty passwd again (which was the case some time ago).
Regards
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #3 from Dan Kegel dank@kegel.com 2009-02-05 17:19:23 --- Thanks for the analysis!
Please vote for this bug if you want this fixed for 1.2, if there are enough votes I'll nominate it.
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
http://bugs.winehq.org/show_bug.cgi?id=17096
mockfrog winehq.org@mockfrog.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winehq.org@mockfrog.de
http://bugs.winehq.org/show_bug.cgi?id=17096
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |loaden@gmail.com
--- Comment #5 from Jeff Zaroyko jeffz@jeffz.name 2009-05-02 06:02:55 --- *** Bug 18323 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=17096
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.2.0
--- Comment #6 from Dan Kegel dank@kegel.com 2009-08-08 07:20:46 --- IMHO it's time for this to Just Work. Nominating for 1.2.
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #7 from Dan Kegel dank@kegel.com 2009-08-08 07:46:26 --- I tried working around the ".rsp file created with mode 000" problem as follows:
--- a/server/file.c +++ b/server/file.c @@ -526,6 +526,9 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owne /* no ACL means full access rights to anyone */ new_mode = S_IRWXU | S_IRWXO;
+// kludge + new_mode = S_IRWXU | S_IRWXO; + return new_mode & ~denied_mode; }
just to see what happened next. It seemed to get stuck in a loop,
fixme:ole:NdrCorrelationInitialize (0x33e758, 0x33e358, 1024, 0x0): stub fixme:netapi32:NetWkstaUserGetInfo Level 1 processing is partially implemented fixme:advapi:LsaOpenPolicy ((null),0x33df64,0x00000001,0x33df80) stub fixme:advapi:LsaClose (0xcafe) stub fixme:ntlm:ntlm_InitializeSecurityContextW using ntlm_auth cached credentials not supported err:rpc:RPCRT4_SecurePacket EncryptMessage failed with 0x80090321
fixme:ole:NdrCorrelationInitialize (0x33e758, 0x33e358, 1024, 0x0): stub fixme:netapi32:NetWkstaUserGetInfo Level 1 processing is partially implemented fixme:advapi:LsaOpenPolicy ((null),0x33df64,0x00000001,0x33df80) stub fixme:advapi:LsaClose (0xcafe) stub fixme:ntlm:ntlm_InitializeSecurityContextW using ntlm_auth cached credentials not supported err:rpc:RPCRT4_SecurePacket EncryptMessage failed with 0x80090321
...
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #8 from Dan Kegel dank@kegel.com 2009-08-08 07:57:31 --- That looks kinda similar to the log in http://www.winehq.org/pipermail/wine-users/2009-June/056166.html fwiw.
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2009-10-06 09:29:22 --- *** Bug 19912 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=17096
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2009-10-06 09:30:30 --- *** Bug 19581 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=17096
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #11 from Alexandre Julliard julliard@winehq.org 2009-10-06 10:40:46 --- File permission issue should be fixed by 07ec73fcaa80c754591e13e02bccff06fee742fc. It then runs into bug 19781.
http://bugs.winehq.org/show_bug.cgi?id=17096
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org 2009-10-09 11:13:51 --- Closing bugs fixed in 1.1.31.
http://bugs.winehq.org/show_bug.cgi?id=17096
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |07ec73fcaa80c754591e13e02bc | |cff06fee742fc Component|-unknown |advapi32
--- Comment #13 from Anastasius Focht focht@gmx.net 2012-02-12 12:56:36 CST --- Hello,
filling fields ...
Two bugs in one but well ;-)
http://source.winehq.org/git/wine.git/commit/dcb3e52e2dfd0d6e494164932fb2b68... (secur32: Implement GetUserNameEx(NameSamCompatible))
http://source.winehq.org/git/wine.git/commitdiff/07ec73fcaa80c754591e13e02bc... (advapi32: Retrieve the current user SID from the server in lookup_user_account_name)
Regards
https://bugs.winehq.org/show_bug.cgi?id=17096
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- OS|other |Linux URL|http://download.microsoft.c |https://web.archive.org/web |om/download/6/f/5/6f5f7a01- |/20161115203751/http://down |50bb-422d-8742-c099c8896969 |load.microsoft.com/download |/En_vs_2005_vsts_180_Trial. |/6/f/5/6f5f7a01-50bb-422d-8 |img |742-c099c8896969/En_vs_2005 | |_vsts_180_Trial.img Hardware|Other |x86