|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70467 is_readable wrong results on a samba share
Submitted: 2015-09-09 10:25 UTC Modified: 2021-07-29 16:33 UTC
Avg. Score:4.0 ± 1.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: ced at bernispa dot com Assigned: cmb (profile)
Status: Duplicate Package: Streams related
PHP Version: 5.6.13 OS: Windows Server 2012
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.
Block user comment
Status: Assign to:
Bug Type:
From: ced at bernispa dot com
New email:
PHP Version: OS:


 [2015-09-09 10:25 UTC] ced at bernispa dot com
Switching from php 5.2.17 to 5.6.12 phpmailer started having problems
sending attachments stored on a samba server joined to an Active Directory
domain and referenced by UNC paths.
The problem is not with phpmailer but with an is_readable() calls that it
does on the files to be attached: it now returns false where with 5.2.17
returned true.

For many files on that samba file server now is_readable() returns false,
even if they can be regularly be openend by php and file_exists() reports

From my tests looks like is_readable() doesn't really tests the file
readability but does something like this: it gets the UID/GID of the php
process and then compares it with the ACLs of the requested file. But my
samba server has an historically setup where on some shares the php
user/group is not mentioned on any ACLs because it is in the "admin users"
directive inside smb.conf.

From smb.conf(5):
This is a list of users who will be granted administrative privileges on
the share. This means that they will do all file operations as the
super-user (root).
You should use this option very carefully, as any user in this list
will be able to do anything they like on the share, irrespective of
file permissions.

With permissions defined like that, is_readable() wrongly reports that the
file is not readable while it is. I haven't tested it but i suspect that
also is_writable() has the same problem.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-29 16:33 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-07-29 16:33 UTC]
Closing as duplicate of bug #73543.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 16:01:28 2024 UTC