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
 [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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC