Blob Blame History Raw
commit 8b41b097716abde0b4ad9af4e813da9e3ed6620b
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
Date:   Mon Dec 21 16:29:34 2015 +0100

    Add ftp_disable_epsv config option

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 27620b8..116829a 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -439,6 +439,11 @@ default of 5 connections.  Note that there are also implicit per-mirror limits
 and the downloader honors these too.
 
 .IP
+\fBftp_disable_epsv \fR
+This options disables Extended Passive Mode (the EPSV command) which does not
+work correctly on some buggy ftp servers. Default is `0' (EPSV enabled).
+
+.IP
 \fBdeltarpm\fR
 
 When non-zero, delta-RPM files are used if available.  The value specifies
@@ -1114,6 +1119,11 @@ Overrides the \fBip_resolve\fR option from the [main] section for this
 repository.
 
 .IP
+\fBftp_disable_epsv\fR
+Overrides the \fBftp_disable_epsv\fR option from the [main] section
+for this repository.
+
+.IP
 \fBdeltarpm_percentage\fR
 Overrides the \fBdeltarpm_percentage\fR option from the [main] section
 for this repository.
diff --git a/yum/config.py b/yum/config.py
index 77a1003..6bd8d24 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -811,6 +811,7 @@ class YumConf(StartupConf):
             allowed = ('ipv4', 'ipv6', 'whatever'),
             mapper  = {'4': 'ipv4', '6': 'ipv6'})
     max_connections = IntOption(0, range_min=0)
+    ftp_disable_epsv = BoolOption(False)
     deltarpm = IntOption(2, range_min=-16, range_max=128)
     deltarpm_percentage = IntOption(75, range_min=0, range_max=100)
     deltarpm_metadata_percentage = IntOption(100, range_min=0)
@@ -1003,6 +1004,7 @@ class RepoConf(BaseConfig):
     #  Rely on the above config. to do automatic disabling, and thus. no hack
     # needed here.
     deltarpm_metadata_percentage = Inherit(YumConf.deltarpm_metadata_percentage)
+    ftp_disable_epsv = Inherit(YumConf.ftp_disable_epsv)
 
     http_caching = Inherit(YumConf.http_caching)
     metadata_expire = Inherit(YumConf.metadata_expire)
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 3dd0646..fc5d538 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -675,6 +675,7 @@ class YumRepository(Repository, config.RepoConf):
                  'user_agent': default_grabber.opts.user_agent,
                  'username': self.username,
                  'password': self.password,
+                 'ftp_disable_epsv': self.ftp_disable_epsv,
                  }
         if self.proxy == 'libproxy':
             opts['libproxy'] = True