Bug #70467 [Opn->Dup]: is_readable wrong results on a samba share

From: Date: Thu, 29 Jul 2021 16:33:27 +0000
Subject: Bug #70467 [Opn->Dup]: is_readable wrong results on a samba share
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235460@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70467&edit=1 ID: 70467 Updated by: cmb@php.net Reported by: ced at bernispa dot com Summary: is_readable wrong results on a samba share -Status: Open +Status: Duplicate Type: Bug Package: Streams related Operating System: Windows Server 2012 PHP Version: 5.6.13 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Closing as duplicate of bug #73543. Previous Comments: ------------------------------------------------------------------------ [2015-09-09 10:25:49] ced at bernispa dot com Description: ------------ 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 true. 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70467&edit=1

« previous php.bugs (#235460) next »