Edit report at https://bugs.php.net/bug.php?id=76698&edit=1
ID: 76698
Comment by: spam2 at rhsoft dot net
Reported by: zoeslam at gmail dot com
Summary: mkdir doesn't handle group write permission with
0770 mode
Status: Not a bug
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Debian Stretch
PHP Version: 7.2.8
Block user comment: N
Private report: N
New Comment:
the umask is for control default permission while the topic is explicit one!
mkdir also has a problem with permissions when create a recursive directory tree
Previous Comments:
------------------------------------------------------------------------
[2018-08-03 10:33:46] requinix@php.net
What's your umask?
------------------------------------------------------------------------
[2018-08-03 10:20:05] zoeslam at gmail dot com
Description:
------------
mkdir($dir, 0770) skips group write permission
https://3v4l.org/pKu4U
Test script:
---------------
$dir = uniqid('/tmp/test_0700_');
mkdir($dir, 0700);
$fileperms = 0777 & fileperms($dir);
var_dump(0700 === $fileperms);
var_dump(decoct($fileperms));
$dir = uniqid('/tmp/test_0770_');
mkdir($dir, 0770);
$fileperms = 0777 & fileperms($dir);
var_dump(0770 === $fileperms);
var_dump(decoct($fileperms));
Expected result:
----------------
bool(true)
string(3) "700"
bool(true)
string(3) "770"
Actual result:
--------------
bool(true)
string(3) "700"
bool(false)
string(3) "750"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76698&edit=1