php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49949 ftp_chmod function set permission incorrect!
Submitted: 2009-10-22 02:50 UTC Modified: 2009-10-23 06:08 UTC
From: contact at ireallyhost dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 5.2.11 OS: Linux
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: contact at ireallyhost dot com
New email:
PHP Version: OS:

 

 [2009-10-22 02:50 UTC] contact at ireallyhost dot com
Description:
------------
ftp_chmod function

Permission file incorrect!
when set permission from variable



Reproduce code:
---------------
:::::example:::::::
$file = 'path/example.php';
$permission = 0664; or $permission = "0664";

===ftp function==
ftp_chmod($conn_id, $permission,$file)
!! invalid permission file (result is 204)

but 

ftp_chmod($conn_id, 0664,$file)
!! Permission file 0664 is ok

Expected result:
----------------
$permission = 0664; or $permission = "0664";

ftp_chmod($conn_id, $permission,$file)


permission file is 0664




Actual result:
--------------
-

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-22 10:46 UTC] felipe@php.net
If you have a string '0664', you must to use octdec() function.

 [2009-10-23 06:08 UTC] contact at ireallyhost dot com
i'm sorry misunderstanding and ignorance,
thank you very much for take care.
...
 [2019-04-13 21:12 UTC]
The following pull request has been associated:

Patch Name: Update php_mysql.c
On GitHub:  https://github.com/php/pecl-database-mysql/pull/1
Patch:      https://github.com/php/pecl-database-mysql/pull/1.patch
 [2019-04-14 00:32 UTC]
The following pull request has been associated:

Patch Name: protect master branches except for the pecl repos against force pushes
On GitHub:  https://github.com/php/karma/pull/4
Patch:      https://github.com/php/karma/pull/4.patch
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 13:01:33 2025 UTC