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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC