php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62199 is_readable() does not seem to tolerate crossing partitions inside a sambashare
Submitted: 2012-05-31 17:43 UTC Modified: 2012-05-31 18:05 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:7 of 7 (100.0%)
Same Version:7 (100.0%)
Same OS:5 (71.4%)
From: moodboom at gmail dot com Assigned:
Status: Open Package: Directory function related
PHP Version: 5.3.13 OS: linux (gentoo)
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-05-31 17:43 UTC] moodboom at gmail dot com
Description:
------------
Calls to PHP's is_readable() function are returning false on a directory that is readable from the command prompt. I have changed permissions to most-permissible and still no luck.

Any directory under the samba share that is not on the physical primary partition seems to fail. 

Here are the permissions as provided in the shell:

ls -lad /remote/samba_share
drwxrwxr-x 13 me users 0 May 29 15:49 /remote/samba_share

ls -la /remote/samba_share
drwxr-xr-x  4 me users 0 May  8 14:19 /remote/samba_share/local_dir
drwxr-xr-x 16 me users 0 May 14 19:49 /remote/samba_share/second_drive
drwxrwxrwx 12 me users 0 May 30 09:42 /remote/samba_share/ext_raid

NOTE: I started this as a question on stackoverflow, because of the number of other possible causes, but led to this bug report.

http://stackoverflow.com/questions/10818770/php-is-readable-fails-on-readable-samba-directory



Test script:
---------------
if (is_readable('/remote/samba_share'              )){ echo "share ok\n";  } else { echo "share BAD\n";  }
if (is_readable('/remote/samba_share/local_dir'    )){ echo "local ok\n";  } else { echo "local BAD\n";  }
if (is_readable('/remote/samba_share/second_drive' )){ echo "second ok\n"; } else { echo "second BAD\n"; }
if (is_readable('/remote/samba_share/ext_raid'     )){ echo "raid ok\n";   } else { echo "raid BAD\n";   }

Expected result:
----------------
share ok
local ok
second ok
raid ok

Actual result:
--------------
share ok
local ok
second BAD
raid BAD

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-31 18:05 UTC] moodboom at gmail dot com
Note that the C function access() (which I believe is used by is_readable()) works as expected:

C code: 

cout << "share: " << access("/remote/samba_share", R_OK) << endl; 
cout << "local: " << access("/remote/samba_share/local_dir", R_OK) << endl; 
cout << "second: " << access("/remote/samba_share/second_drive", R_OK) << endl; 
cout << "raid: " << access("/remote/samba_share/ext_raid", R_OK) << endl;

result: 

share: 0
local: 0
second: 0
raid: 0
 [2012-05-31 18:05 UTC] moodboom at gmail dot com
-: m at thedigitalmachine dot com +: moodboom at gmail dot com
 [2013-01-24 07:50 UTC] lukx at lukx dot de
Bug #49620 seems to be similar and offers some more test cases.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 16:02:23 2014 UTC