[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] [RAQ550] Php ftp upload problem



A few months ago, i have noticed a problem with one of my PHP scripts but 
unfortunately didn't had much time to take care of. But now it's a very 
shitting problem for sites hosted on the RaQ. Here it comes : 
The PHP script was designed to allow files upload through an admin interface. 
It use chdir to explore the repertories :
 	function ftp_Cd($dir) 
		{
    		if(!@ftp_chdir($this->_con_id,$dir)) {$this->_errors
(3);return False;}
    		$this->cwd=@ftp_pwd($this->_con_id);
    		return True;
  		}		
and ftpput to upload the files :
	function ftp_Send($from,$to) 
		{
		@ftp_pasv($this->_con_id, $this->PASV);
		if(!ftp_put($this->_con_id,$to,$from,$this->FTP_MODE)) {$this-
>_errors(12);return False;}
		return True;
		}	
Like that the script have work a few months whithout any problems. But as i 
think, since the last proftpd SUN update, this is what happens : instead of 
uploading files in the good directory, the script upload it on the root dir 
(/web). So i think the chdir function is not working anymore. In front of 
this fact, i wondering one thing : am i exploiting a bug before the SUN 
proftpd update ? 

Your help will be appreciated. And, sorry for my poor english!

My server is a RaQ550 Cobalt Linux 7.0, PHP 4.2.3

--
Open WebMail Project (http://openwebmail.org)