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
 [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: Tue Mar 19 08:01:29 2024 UTC