Blame SOURCES/BZ-1293378-ftp-disable-epsv.patch

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