Bug #65796 [Com]: mkdir creates folders with wrong permissions
| From: | drak@php.net | Date: | Tue, 01 Oct 2013 09:48:19 +0000 |
| Subject: | Bug #65796 [Com]: mkdir creates folders with wrong permissions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181864@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65796&edit=1
ID: 65796
Comment by: drak@php.net
Reported by: cmfcmf dot flach at gmail dot com
Summary: mkdir creates folders with wrong permissions
Status: Open
Type: Bug
Package: Directory function related
Operating System: Linux/Ubuntu 13.4
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I get the same on PHP 5.5.3. chmod('test', 0777) then transforms the directory to
the right chmod.
Previous Comments:
------------------------------------------------------------------------
[2013-10-01 09:44:10] cmfcmf dot flach at gmail dot com
Description:
------------
Creating a directory using mkdir() does not respect the permissions given.
Test script:
---------------
<?php
// Create a folder with 0777 permissions.
mkdir('test', 0777);
// Should be 0777, but is 0755.
echo substr(sprintf('%o', fileperms('test')), -4);
Expected result:
----------------
I expect the folder to be created with 0777 permission.
Actual result:
--------------
The folder is created with 0755 permission.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65796&edit=1