From:             
Operating system: 
PHP version:      5.4.3
Package:          FTP related
Bug Type:         Bug
Bug description:Problem with ProFTPd hard quotas

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 bug report at https://bugs.php.net/bug.php?id=62035&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62035&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62035&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62035&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62035&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62035&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62035&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62035&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62035&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62035&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62035&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62035&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62035&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62035&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62035&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62035&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62035&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62035&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62035&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62035&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62035&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62035&r=mysqlcfg

Reply via email to