Page 1 of 1

SMB2's Tree Connect Request is not sent from Windows 10

PostPosted: 15. August 2016 02:43
by johiroshi
When Apache on Windows 10 starts from service, shared files supported by SMB2 can't be read.
If using Windows 7, all files can be read. And if Apache starts from XAMPP Control Panel (not from service), files can be read.
Is this XAMPP/Apache Bugs ?

*** My Environment ***
Windows 10 Pro, ver. 1607, OS build 14393.51
Apache 2.4.17
PHP 5.6.23
Target Shared Device: QNAP NAS, TS231
***

Code: Select all
<?php

$file_path = "\\\\TS231-1\\fs_data\\data.xml";

var_dump(file_get_contents($file_path));

?>


*** Error Message ***
Warning: file_get_contents(\TS231-1\fs_data\data.xml): failed to open stream: Invalid argument in C:\xampp\htdocs\index.php on line 16
bool(false)
***

*** WireShark ***
Image
***

Re: SMB2's Tree Connect Request is not sent from Windows 10

PostPosted: 15. August 2016 10:02
by Nobbie
johiroshi wrote:Is this XAMPP/Apache Bugs ?


No. It is your missing Windows skills. A program which is started "directly" by a User, is run with this Users priviliges. If you start the same program as a service, that program is NOT run by your UserId, but i.e. from the "SYSTEM" User. The SYSTEM User runs with different priviliges and different environment than your own UserID.

That is plain and pure Windows Knowledge.

Re: SMB2's Tree Connect Request is not sent from Windows 10

PostPosted: 16. August 2016 00:53
by johiroshi
Nobbie wrote:A program which is started "directly" by a User, is run with this Users priviliges. If you start the same program as a service, that program is NOT run by your UserId, but i.e. from the "SYSTEM" User. The SYSTEM User runs with different priviliges and different environment than your own UserID.


Thanks, Nobbie.

I know what you say. Do you mean the privilege of "SYSTEM" user changes from Windows 7 to Windows 10 ?
On Windows 7, No difference is found when program is started as service or not as service. I can read shared file with no problem.
However, on Windows 10, as said before, I can not read shared file if program starts as service.

Is this new specifications of Windows ? or my missed skill of Apache ?