]> granicus.if.org Git - php/commitdiff
Fix #63527: DCOM does not work with Username, Password parameter
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 10 Jul 2020 13:43:32 +0000 (15:43 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 20 Jul 2020 12:43:29 +0000 (14:43 +0200)
We must not mix multibyte and wide character strings in the
`COAUTHIDENTITY` structure.  Using wide character strings throughout
would have the advantage that the remote connection can be established
regardless of the code page of the server, but that would more likely
break BC, so we just drop the wide character string conversion of the
username.

NEWS
ext/com_dotnet/com_com.c

diff --git a/NEWS b/NEWS
index 0aa1b695b575affa0d60f10d74f3cbd3721d1cd6..3f1d6bd39c4ef50e4c0eceeedd510ffdaece1216 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,9 @@ PHP                                                                        NEWS
 
 - COM:
   . Fixed bug #63208 (BSTR to PHP string conversion not binary safe). (cmb)
-  
+  . Fixed bug #63527 (DCOM does not work with Username, Password parameter).
+    (cmb)
+
 - Curl:
   . Fixed bug #79741 (curl_setopt CURLOPT_POSTFIELDS asserts on object with
     declared properties). (Nikita)
index eb79ed76ff07e08bcb7a1f6c361d40df886f9406..2eeac4aaf2f2d2f016cb3980b6dd4348c3344151 100644 (file)
@@ -133,7 +133,7 @@ PHP_FUNCTION(com_create_instance)
                info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page);
 
                if (user_name) {
-                       authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page);
+                       authid.User = (OLECHAR*)user_name;
                        authid.UserLength = (ULONG)user_name_len;
 
                        if (password) {