#44284 [Opn->Bgs]: mkdir will not apply group sticky from supplied mode

From: Date: Mon, 03 Mar 2008 14:46:58 +0000
Subject: #44284 [Opn->Bgs]: mkdir will not apply group sticky from supplied mode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122880@lists.php.net to get a copy of this message
ID: 44284 Updated by: jani@php.net Reported By: php at displague dot com -Status: Open +Status: Bogus Bug Type: Directory function related Operating System: linux PHP Version: 5.2.5 New Comment: From 'man 2 mkdir': NOTES Under Linux apart from the permission bits, only the S_ISVTX mode bit is honored. That is, under Linux the created directory actually gets mode (mode & ~umask & 01777). See also stat(2). Previous Comments: ------------------------------------------------------------------------ [2008-02-28 18:16:30] php at displague dot com Description: ------------ The php function mkdir() does not apply the group sticky bit on folders created. The php function chmod() is capable of doing this. Previous, closed, bug reports show that mkdir() premitted sticky bits in the past when chmod() did not. All of my safe_ variables are off: [mjohansson@host tmp]$ php -r 'phpinfo();' | grep ^safe safe_mode => Off => Off safe_mode_exec_dir => no value => no value safe_mode_gid => Off => Off safe_mode_include_dir => no value => no value safe_mode_allowed_env_vars => PHP_ => PHP_ safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH Reproduce code: --------------- rm -rf test2 test3; php -r ' umask(0); mkdir("test2", 02770); mkdir("test3",02770); chmod("test3",02770);'; ls -lad test2 test3 Expected result: ---------------- drwxrws--- 2 mjohansson mjohansson 4096 Feb 28 13:05 test2 drwxrws--- 2 mjohansson mjohansson 4096 Feb 28 13:05 test3 Actual result: -------------- drwxrwx--- 2 mjohansson mjohansson 4096 Feb 28 13:05 test2 drwxrws--- 2 mjohansson mjohansson 4096 Feb 28 13:05 test3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44284&edit=1

« previous php.bugs (#122880) next »