Bug #62035 [Opn]: Problem with ProFTPd hard quotas
| From: | incidencias at ultreia dot es | Date: | Tue, 15 May 2012 09:48:16 +0000 |
| Subject: | Bug #62035 [Opn]: Problem with ProFTPd hard quotas | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-170450@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62035&edit=1
ID: 62035
User updated by: incidencias at ultreia dot es
Reported by: incidencias at ultreia dot es
Summary: Problem with ProFTPd hard quotas
Status: Open
Type: Bug
Package: FTP related
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2012-05-15 09:39:23] 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:37:36] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62035&edit=1