php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62035 Problem with ProFTPd hard quotas
Submitted: 2012-05-15 09:37 UTC Modified: 2012-05-15 09:48 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: incidencias at ultreia dot es Assigned:
Status: Open Package: FTP related
PHP Version: 5.4.3 OS:
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: incidencias at ultreia dot es
New email:
PHP Version: OS:

 

 [2012-05-15 09:37 UTC] incidencias at ultreia dot es
Description:
------------
If you try to upload a file to an FTP account in a ProFTPD server with hard quotas and available space is less than file size, transfer will be accepted receiving a "150 Opening BINARY mode data connection for <file>" response. But as soon as used space reaches quota, ProFTPD will interrupt transfer sending a "552-Transfer aborted. Disk quota exceeded." message followed by "552 STOR: notice: quota reached: '<file>' removed".
PHP will know that transfer has failed but will return the first message ("Opening BINARY mode data connection") as error message instead of one of the 552 real error messages.
If there is no free disk space in FTP account (which can happen if, for example, you are using ProFTPD soft quotas), ProFTPD will no initially accept the transfer sending the 150 response, so it will directly send the 552 response and everything will work OK with PHP.

Test script:
---------------
<?php

$remote_file = $file = "myfile.bin";
$conn_id = ftp_connect("localhost");
$login_result = ftp_login($conn_id, "myuser", "mypass");

ftp_put($conn_id, $remote_file, $file, $file, FTP_BINARY);
ftp_close($conn_id);

Expected result:
----------------
PHP Warning:  ftp_put(): Opening BINARY mode data connection

Actual result:
--------------
PHP Warning:  ftp_put(): Transfer aborted. Disk quota exceeded.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-15 09:39 UTC] incidencias at ultreia dot es
Well, you may realize that I swapped expected result and actual result.
It should be:

Expected result:
----------------
PHP Warning:  ftp_put(): Transfer aborted. Disk quota exceeded.

Actual result:
--------------
PHP Warning:  ftp_put(): Opening BINARY mode data connection
 [2012-05-15 09:48 UTC] incidencias at ultreia dot es
Ah, and here is my compilation information:

PHP Version => 5.4.3--pl0-gentoo

System => Linux jperez 3.2.0-sabayon #1 SMP Sat Feb 11 08:52:29 UTC 2012 x86_64
Build Date => May 15 2012 10:51:31
Configure Command =>  './configure'  '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--prefix=/usr/lib64/php5.4' '--mandir=/usr/lib64/php5.4/man' '--infodir=/usr/lib64/php5.4/info' '--libdir=/usr/lib64/php5.4/lib' '--with-libdir=lib64' '--without-pear' '--disable-maintainer-zts' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl' '--without-curlwrappers' '--enable-dom' '--without-enchant' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-ftp' '--with-gettext' '--with-gmp' '--enable-hash' '--with-mhash' '--with-iconv' '--enable-intl' '--enable-ipv6' '--enable-json' '--with-kerberos=/usr' '--enable-libxml' '--enable-mbstring' '--with-mcrypt' '--without-mssql' '--with-onig=/usr' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--enable-phar' '--enable-pdo' '--without-pgsql' '--enable-posix' '--with-pspell' '--without-recode' '--enable-simplexml' '--disable-shmop' '--with-snmp' '--enable-soap' '--enable-sockets' '--with-sqlite3=/usr' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--with-tidy' '--enable-tokenizer' '--enable-wddx' '--enable-xml' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-mysql=mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysqli=mysqlnd' '--without-pdo-dblib' '--with-pdo-mysql=mysqlnd' '--without-pdo-pgsql' '--with-pdo-sqlite=/usr' '--without-pdo-odbc' '--with-readline' '--without-libedit' '--without-mm' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--with-config-file-path=/etc/php/cli-php5.4' '--with-config-file-scan-dir=/etc/php/cli-php5.4/ext-active' '--disable-embed' '--enable-cli' '--disable-cgi' '--disable-fpm' '--without-apxs2'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/cli-php5.4
Loaded Configuration File => /etc/php/cli-php5.4/php.ini
Scan this dir for additional .ini files => /etc/php/cli-php5.4/ext-active
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,NTS
PHP Extension Build => API20100525,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

I've also tried with latest snapshot with the same result:

PHP Version => 5.5.0-dev

System => Linux jperez 3.2.0-sabayon #1 SMP Sat Feb 11 08:52:29 UTC 2012 x86_64
Build Date => May 15 2012 11:18:19
Configure Command =>  './configure'  '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--prefix=/usr/lib64/php5.4' '--mandir=/usr/lib64/php5.4/man' '--infodir=/usr/lib64/php5.4/info' '--libdir=/usr/lib64/php5.4/lib' '--with-libdir=lib64' '--without-pear' '--disable-maintainer-zts' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl' '--without-curlwrappers' '--enable-dom' '--without-enchant' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-ftp' '--with-gettext' '--with-gmp' '--enable-hash' '--with-mhash' '--with-iconv' '--enable-intl' '--enable-ipv6' '--enable-json' '--with-kerberos=/usr' '--enable-libxml' '--enable-mbstring' '--with-mcrypt' '--without-mssql' '--with-onig=/usr' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--enable-phar' '--enable-pdo' '--without-pgsql' '--enable-posix' '--with-pspell' '--without-recode' '--enable-simplexml' '--disable-shmop' '--with-snmp' '--enable-soap' '--enable-sockets' '--with-sqlite3=/usr' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--with-tidy' '--enable-tokenizer' '--enable-wddx' '--enable-xml' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-mysql=mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysqli=mysqlnd' '--without-pdo-dblib' '--with-pdo-mysql=mysqlnd' '--without-pdo-pgsql' '--with-pdo-sqlite=/usr' '--without-pdo-odbc' '--with-readline' '--without-libedit' '--without-mm' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--with-config-file-path=/etc/php/cli-php5.4' '--with-config-file-scan-dir=/etc/php/cli-php5.4/ext-active' '--disable-embed' '--enable-cli' '--disable-cgi' '--disable-fpm' '--without-apxs2'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/cli-php5.4
Loaded Configuration File => /etc/php/cli-php5.4/php.ini
Scan this dir for additional .ini files => /etc/php/cli-php5.4/ext-active
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,NTS
PHP Extension Build => API20100525,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:21 2019 UTC