~ubuntu-branches/ubuntu/vivid/fex/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/03_fexget_search_ca.patch

  • Committer: Package Import Robot
  • Author(s): Kilian Krause
  • Date: 2015-01-21 10:20:03 UTC
  • mfrom: (13.1.28 sid)
  • Revision ID: package-import@ubuntu.com-20150121102003-c1r8jz5s2f6de2dm
Tags: 20150120-2
Fix fexget perl warning with upstream fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Backported from http://fex.rus.uni-stuttgart.de:8080/download/fexget to avoid perl warning
 
2
--- a/bin/fexget
 
3
+++ b/bin/fexget
 
4
@@ -30,7 +30,7 @@ our $SH;
 
5
 our ($fexhome,$idf,$tmpdir,$windoof,$useragent);
 
6
 our ($xv,%autoview);
 
7
 our $bs = 2**16; # blocksize for tcp-reading and writing file
 
8
-our $version = 20150120;
 
9
+our $version = 20150121;
 
10
 our $CTYPE = 'ISO-8859-1';
 
11
 our $fexsend = $ENV{FEXSEND} || 'fexsend';
 
12
 
 
13
@@ -157,48 +157,7 @@ if ($opt_H) {
 
14
   exit;
 
15
 }
 
16
 
 
17
-# set SSL/TLS options
 
18
-$SSL{SSL_verify_mode} = $ENV{SSLVERIFY} if defined($ENV{SSLVERIFY});
 
19
-foreach my $opt (qw(
 
20
-  SSL_version
 
21
-  SSL_cipher_list 
 
22
-  SSL_verify_mode 
 
23
-  SSL_ca_path 
 
24
-  SSL_ca_file)
 
25
-) {
 
26
-  my $env = uc($opt);
 
27
-  $env =~ s/_//g;
 
28
-  $SSL{$opt} = $ENV{$env} if defined($ENV{$env});
 
29
-}
 
30
-
 
31
-if ($SSL{SSL_verify_mode}) {
 
32
-  &search_ca;
 
33
-  unless ($SSL{SSL_ca_path} or $SSL{SSL_ca_file}) {
 
34
-    die "$0: \$SSLVERIFYMODE, but not valid \$SSLCAPATH or \$SSLCAFILE\n";
 
35
-  }
 
36
-} elsif (defined($SSL{SSL_verify_mode})) {
 
37
-  # user has set SSLVERIFY=0 !
 
38
-} else {
 
39
-  &search_ca;
 
40
-  $SSL{SSL_verify_mode} = 1 if $SSL{SSL_ca_path} or $SSL{SSL_ca_file};
 
41
-}
 
42
-
 
43
-sub search_ca {
 
44
-  local $_;
 
45
-  return if $SSL{SSL_ca_file} or $SSL{SSL_ca_path};
 
46
-  foreach (qw(/etc/ssl/certs/ca-certificates.crt)) {
 
47
-    if (-f) {
 
48
-      $SSL{SSL_ca_file} = $_;
 
49
-      return;
 
50
-    }
 
51
-  }
 
52
-  foreach (qw(/etc/ssl/certs /etc/pki/tls/certs)) {
 
53
-    if (-f) {
 
54
-      $SSL{SSL_ca_path} = $_;
 
55
-      return;
 
56
-    }
 
57
-  }
 
58
-}
 
59
+&get_ssl_env;
 
60
 
 
61
 my $ffl = "$tmpdir/fexget";            # F*EX files list (cache)
 
62
 
 
63
--- a/htdocs/download/fexget
 
64
+++ b/htdocs/download/fexget
 
65
@@ -30,7 +30,7 @@ our $SH;
 
66
 our ($fexhome,$idf,$tmpdir,$windoof,$useragent);
 
67
 our ($xv,%autoview);
 
68
 our $bs = 2**16; # blocksize for tcp-reading and writing file
 
69
-our $version = 20150120;
 
70
+our $version = 20150121;
 
71
 our $CTYPE = 'ISO-8859-1';
 
72
 our $fexsend = $ENV{FEXSEND} || 'fexsend';
 
73
 
 
74
@@ -157,48 +157,7 @@ if ($opt_H) {
 
75
   exit;
 
76
 }
 
77
 
 
78
-# set SSL/TLS options
 
79
-$SSL{SSL_verify_mode} = $ENV{SSLVERIFY} if defined($ENV{SSLVERIFY});
 
80
-foreach my $opt (qw(
 
81
-  SSL_version
 
82
-  SSL_cipher_list 
 
83
-  SSL_verify_mode 
 
84
-  SSL_ca_path 
 
85
-  SSL_ca_file)
 
86
-) {
 
87
-  my $env = uc($opt);
 
88
-  $env =~ s/_//g;
 
89
-  $SSL{$opt} = $ENV{$env} if defined($ENV{$env});
 
90
-}
 
91
-
 
92
-if ($SSL{SSL_verify_mode}) {
 
93
-  &search_ca;
 
94
-  unless ($SSL{SSL_ca_path} or $SSL{SSL_ca_file}) {
 
95
-    die "$0: \$SSLVERIFYMODE, but not valid \$SSLCAPATH or \$SSLCAFILE\n";
 
96
-  }
 
97
-} elsif (defined($SSL{SSL_verify_mode})) {
 
98
-  # user has set SSLVERIFY=0 !
 
99
-} else {
 
100
-  &search_ca;
 
101
-  $SSL{SSL_verify_mode} = 1 if $SSL{SSL_ca_path} or $SSL{SSL_ca_file};
 
102
-}
 
103
-
 
104
-sub search_ca {
 
105
-  local $_;
 
106
-  return if $SSL{SSL_ca_file} or $SSL{SSL_ca_path};
 
107
-  foreach (qw(/etc/ssl/certs/ca-certificates.crt)) {
 
108
-    if (-f) {
 
109
-      $SSL{SSL_ca_file} = $_;
 
110
-      return;
 
111
-    }
 
112
-  }
 
113
-  foreach (qw(/etc/ssl/certs /etc/pki/tls/certs)) {
 
114
-    if (-f) {
 
115
-      $SSL{SSL_ca_path} = $_;
 
116
-      return;
 
117
-    }
 
118
-  }
 
119
-}
 
120
+&get_ssl_env;
 
121
 
 
122
 my $ffl = "$tmpdir/fexget";            # F*EX files list (cache)
 
123