From:             friedrich dot grosse at gmail dot com
Operating system: Windows Server 2008 R2
PHP version:      5.4.8
Package:          COM related
Bug Type:         Bug
Bug description:DCOM does not work with Username, Password parameter

Description:
------------
I try to instantiate a DCOM object on a remote machine (Windows Server 2008
R2) 
in another 
domain using the Username and Password parameters of the COM class
constructor 
[1]
I did also figure out that there is a Domain parameter which is not
mentioned in 
the manual at 
[1].

However I can not authenticate at the remote machine.
The event log there indicates that only the first character of the Logon 
Accounts Username has 
been transmitted to the DCOM Server.
The Domain parameter has been received completely.

I am not familiar with PHP internals but I did a quick look in the source
code 
and would guess 
that the issue can be traced back to [2].

The user_name and user_name_len are already parsed some lines above.
Why is php_com_string_to_olestring called with a -1 as second parameter
which 
leads to 
determining the length of the username again?

Maybe giving user_name_len instead of -1 could fix this issue?


[1] http://de1.php.net/manual/de/class.com.php
[2]
https://github.com/php/php-src/blob/master/ext/com_dotnet/com_com.c#L131

Test script:
---------------
try {
  $DCOMserverInfo = array(
      'Server' => "Server.com",
      'Username' => "Admin",
      'Domain' => "Testdomain.com",
      'Password' => "password"
  );
  /** You may change the COM module name to word.application or whatever
COM enabled app is installed on the target machine. **/
  $comObj = new COM("word.application", $DCOMserverInfo);
  echo "Everything works fine";
}
catch (Exception $exception) {
  echo exception->getMessage();
}

Expected result:
----------------
Everything works fine

Actual result:
--------------
Failed to create COM object `word.application': Access is denied.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63527&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63527&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63527&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63527&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63527&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63527&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63527&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63527&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63527&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63527&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63527&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63527&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63527&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63527&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63527&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63527&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63527&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63527&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63527&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63527&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63527&r=mysqlcfg

Reply via email to