php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #342 mkdir and chmod produce wrong perms
Submitted: 1998-05-03 23:28 UTC Modified: 1998-05-04 14:15 UTC
From: whit at transpect dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Release Candidate 4 OS: Redhat 5.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: whit at transpect dot com
New email:
PHP Version: OS:

 

 [1998-05-03 23:28 UTC] whit at transpect dot com
In changing a working script from php2 to php3, a

mkdir("$docroot/$pgfrom",755);

command, that used to make that directory 755 as requested, now ends up
with perms:

d-wxr----t

Then if I try to fix it with:

chmod("$docroot/$pgfrom",755); nothing happens.

However, chmod("$docroot/$pgfrom","755");

produces perms of:  d-wxrw--wt

- which is still wrong. A definite problem since the next thing I want to
do is create a file in that directory.

This is with php-3.0RC4.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-04 14:15 UTC] jim
This is the correct behavior. To pass an octal number
to chmod (and other functions that deal with file
permissions), you need to specify one, a la:
chmod("$docroot/$pgfrom", 0755);
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC