[dev] [patch] Adding a 'pasv' parameter to the ftp VFS driver.

Etienne Goyer etienne.goyer at linuxquebec.com
Mon Nov 24 06:18:23 PST 2003


Hi,

I sent this patch to the list last friday, but somehow it did'nt get
thru to the list.  Here it is again.

Here is a trivial patch that add a 'pasv' parameter to the VFS ftp
driver.  I am in a situation where trying to use passive mode hang the
connection (don't ask, SSL + weird fierwall/port forwarding issue).  In
this case, I would like not to use passive mode with Gollem.

I suppose a lot of application may make use of this VFS drivers, thus
many config dist file may need to be edited to make mention of this new
parameter.  I attached a patch to gollem/config/backends.php.dist as it
is the only application that I use that make use of VFS.

Thanks for considering this addition.

-- 
Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com
-------------- next part --------------
--- backends.php.dist.orig      Fri Nov 21 15:41:55 2003
+++ backends.php.dist   Tue Apr 29 10:58:17 2003
@@ -43,8 +43,7 @@
     'preferred' => '',
     'driver' => 'ftp',
     'params' => array('hostspec' => 'ftp.example.com',
-                      'port' => 21,
-                      'pasv' => true),
+                      'port' => 21),
     'attributes' => array('type', 'name', 'download', 'modified', 'size',
'permission', 'owner', 'group')
 );

@@ -55,8 +54,7 @@
     'preferred' => '',
     'hordeauth' => true,
     'params' => array('hostspec' => 'ftp.example.com',
-                      'port' => 21,
-                      'pasv' => true),
+                      'port' => 21),
     'attributes' => array('type', 'name', 'download', 'modified', 'size',
'permission', 'owner', 'group')
 );

-------------- next part --------------
--- ftp.php.orig        Fri Nov 21 15:32:41 2003
+++ ftp.php     Fri Nov 21 15:36:16 2003
@@ -726,8 +726,9 @@
                 return PEAR::raiseError(_("Authentication to FTP server
failed."));
             }

-
-            @ftp_pasv($this->_stream, true);
+            if (!empty($this->_params['pasv'])) {
+                @ftp_pasv($this->_stream, true);
+            }
         }
         return true;
     }


More information about the dev mailing list