php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53214 is_readable() returns false on readable files on windows network drive to linux
Submitted: 2010-10-31 19:35 UTC Modified: 2010-10-31 20:44 UTC
From: nevdelap at gmail dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.3.3 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nevdelap at gmail dot com
New email:
PHP Version: OS:

 

 [2010-10-31 19:35 UTC] nevdelap at gmail dot com
Description:
------------
This is the setup I have.

Windows guest in a VirtualBox with a network drive connected to a network share 
on the virtual machine to an ext3 directory on the Linux host.

In other words in Windows N: is connected to \\vboxsvr\nev which is the directory 
/home/nev on the Linux box.

Php is_readable($file) where $file is a filename on the N: drive returns false 
though the file is readable.

Test script:
---------------
<?php
	assert(!is_readable('N:\test.txt'));
	echo file_get_contents('N:\test.txt');
?>

Expected result:
----------------
If the test is on C:\ it works correctly. The assertion fails.

C:\test.txt contains the text 'this is a test'.

<?php
	assert(!is_readable('C:\test.txt'));
	echo file_get_contents('C:\test.txt');
?>

C:\>php test.php
PHP Warning:  assert(): Assertion failed in C:\test.php on line 2

Warning: assert(): Assertion failed in C:\test.php on line 2
this is a test
C:\>

Actual result:
--------------
N:\test.txt contains the text 'this is a test'.

<?php
	assert(!is_readable('N:\test.txt'));
	echo file_get_contents('N:\test.txt');
?>

Gives this result...

N:\>php test.php
this is a test
N:\>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-31 19:47 UTC] pajoye@php.net
-Status: Open +Status: Feedback -Operating System: Windows/Linux +Operating System: Windows
 [2010-10-31 19:47 UTC] pajoye@php.net
Does it work with local filesystem as expected?

What is used on the remote host? Samba? Which version?

Why expected and actual results show two different scripts? 

Please show one script and what you expect as output or result.

Btw, the OS is about where PHP runs, not what you use on some remote servers :)
 [2010-10-31 19:54 UTC] nevdelap at gmail dot com
-Status: Feedback +Status: Open
 [2010-10-31 19:54 UTC] nevdelap at gmail dot com
The two scripts (identical except for the driver letters) are only to make it 
explicit that one result is on C: - the local drive, which you asked about - the 
answer is there, and the other N: - the remove drive.

Does it work with local filesystem as expected? - Yes - that is what C: is 
showing.

What is used on the remote host? Samba? Which version? - VirtualBox does the 
sharing. Not the remote host.

Please show one script and what you expect as output or result. - It is the same 
script aside from the drive letters which just make it more explicit what is 
happening.
 [2010-10-31 19:55 UTC] nevdelap at gmail dot com
remove was meant to be remote. (of course)
 [2010-10-31 20:33 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-10-31 20:33 UTC] pajoye@php.net
Remote shares work just fine, including is_readable.

I have no idea what uses virtualbox for the shares, I suppose some custom versions of Samba.

But it does not look like a PHP problem to me, as shares work fine in our test platforms (with Samba too).

I would suggest to debug virtualbox to see what it does or what is used for the share and then try to figure out why it fails.
 [2010-10-31 20:43 UTC] nevdelap at gmail dot com
-Status: Feedback +Status: Closed
 [2010-10-31 20:43 UTC] nevdelap at gmail dot com
Very good. You are right. Across samba it works fine, so the issue appears to be 
in VirtualBoxes implementation.

Thanks!
 [2010-10-31 20:44 UTC] pajoye@php.net
-Status: Closed +Status: Bogus
 [2010-10-31 20:44 UTC] pajoye@php.net
Not a bug > bogus
 [2014-08-19 06:41 UTC] a959193 at trbvm dot com
I have the same problem, but with Windows on host and Windows on guest machine in Virtual Box.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 00:01:41 2024 UTC