Bug #63509 [Opn]: ftp_chmod returns false for response "250 Changed."

From: Date: Mon, 19 Mar 2018 16:59:27 +0000
Subject: Bug #63509 [Opn]: ftp_chmod returns false for response "250 Changed."
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214411@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63509&edit=1

 ID:                 63509
 Updated by:         cmb@php.net
 Reported by:        egor dot chernodarov at gmail dot com
 Summary:            ftp_chmod returns false for response "250 Changed."
 Status:             Open
 Type:               Bug
 Package:            FTP related
 Operating System:   Debian GNU/Linux 6.0
 PHP Version:        5.3.18
 Block user comment: N
 Private report:     N

 New Comment:

> Code "250" looks as valid for such operations:

Well, it is not, according to RFC 959[1].

[1] <https://tools.ietf.org/html/rfc959#page-49>


Previous Comments:
------------------------------------------------------------------------
[2012-11-14 03:11:29] egor dot chernodarov at gmail dot com

Description:
------------
NcFTPd server returns "250 Changed." (not 200 as many other servers):

[root@vps ~]# ftp ****.com
Connected to ****.com (64.***.***.***).
220 ****.com NcFTPd Server (licensed copy) ready.
Name (*****.com:root): ****
331 User test okay, need password.
Password:
230-You are user #1 of 20 simultaneous users allowed.
230-
230 Restricted user logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd public_html/test345
250 "/public_html/test345" is new cwd.
ftp> ls page9.php
227 Entering Passive Mode (***,***,**,***,***,**)
150 Data connection accepted from ***.***.***.**:****; transfer starting.
-rwxr-xr-x   1 test   test       14637 Jul 28 00:06 page9.php
226 Listing completed.
ftp> chmod 777 page9.php
250 Changed.
ftp> ls page9.php
227 Entering Passive Mode (*****)
150 Data connection accepted from ****:46124; transfer starting.
-rwxrwxrwx   1 test   test       14637 Jul 28 00:06 page9.php
226 Listing completed.

Code "250" looks as valid for such operations:
250 - Requested file action okay, completed.

But ftp_chmode returns "true" only for code 200.

Test script:
---------------
Just try ftp_chmod for any file on NcFTPd server. Permissions successfully changed but result is
"false".
Not sure if any other servers returns 250, but I've tested on
ncftpd-2.8.3-freebsd6.0-i386-export.tar.gz.

Expected result:
----------------
Expect "true" for successful ftp_chmod on NcFTPd server.

Actual result:
--------------
ftp_chmod always returns false.

As workaround:
ftp_site($connectHandler, sprintf('CHMOD %o %s', $mode, $absolutePath));


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=63509&edit=1


Thread (4 messages)

« previous php.bugs (#214411) next »