[fusioninventory-agent] update to 2.1.12
Remi Collet
remi at fedoraproject.org
Mon Nov 28 22:26:08 UTC 2011
commit 17d4b16d54fab0487a37518ff9a66af57c52c25a
Author: remi <fedora at famillecollet.com>
Date: Mon Nov 28 23:26:00 2011 +0100
update to 2.1.12
.gitignore | 2 +
fusioninventory-agent-git.patch | 112 +++++++++++++++++++++++++++++++++++++++
fusioninventory-agent.spec | 27 ++++++++--
sources | 2 +-
4 files changed, 137 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2f433ad..bfb8c90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
+*spec~
/FusionInventory-Agent-2.1.9.tar.gz
+/FusionInventory-Agent-2.1.12.tar.gz
diff --git a/fusioninventory-agent-git.patch b/fusioninventory-agent-git.patch
new file mode 100644
index 0000000..9b131dc
--- /dev/null
+++ b/fusioninventory-agent-git.patch
@@ -0,0 +1,112 @@
+commit a291e4d5d73c13fc8076211b004e7349cd4bbf7d
+Author: Gonéri Le Bouder <goneri at rulezlan.org>
+Date: Mon Nov 28 21:37:48 2011 +0100
+
+ try to use ssl_opts on LWP<6 too
+
+ previously this block was only for LWP6. For some modern
+ LWP5/Crypt::SSLeay also need it, I use an eval here to avoid
+ failure on ancient LWP::UserAgent with no ssl_opts()
+
+ closes: #1161
+
+ Reported-by: Remi Collet <fedora at famillecollet.com>
+
+diff --git a/lib/FusionInventory/Agent/Network.pm b/lib/FusionInventory/Agent/Network.pm
+index b349de5..6bc6fbf 100644
+--- a/lib/FusionInventory/Agent/Network.pm
++++ b/lib/FusionInventory/Agent/Network.pm
+@@ -107,8 +107,11 @@ sub createUA {
+
+ my $ua = LWP::UserAgent->new(keep_alive => 1, requests_redirectable => ['POST', 'GET', 'HEAD']);
+
+-
+- if ($LWP::VERSION >= 6) {
++ # previously this block was only for LWP6.
++ # For some modern LWP5/Crypt::SSLeay also need it, I use
++ # an eval here to avoid failure on ancient LWP::UserAgent with
++ # no ssl_opts()
++ eval {
+ # LWP6 default behavior is to check the SSL hostname
+ if ($config->{'no-ssl-check'}) {
+ $ua->ssl_opts(verify_hostname => 0);
+@@ -119,7 +122,7 @@ sub createUA {
+ if ($config->{'ca-cert-dir'}) {
+ $ua->ssl_opts(SSL_ca_path => $config->{'ca-cert-dir'});
+ }
+- }
++ };
+
+ if ($noProxy) {
+
+commit 5001036e8eabac54a5058306c44793df325109a2
+Author: Gonéri Le Bouder <goneri at rulezlan.org>
+Date: Mon Nov 28 21:39:21 2011 +0100
+
+ improve the regex used to parse the SSL-Cert
+
+ - Drop the port from the hostname
+ - Use a wildcare only if there is a domain
+
+diff --git a/lib/FusionInventory/Agent/Network.pm b/lib/FusionInventory/Agent/Network.pm
+index 6bc6fbf..96d7513 100644
+--- a/lib/FusionInventory/Agent/Network.pm
++++ b/lib/FusionInventory/Agent/Network.pm
+@@ -362,9 +362,10 @@ sub setSslRemoteHost {
+ # Check server name against provided SSL certificate
+ if ( $self->{URI} =~ /^https:\/\/([^\/]+).*$/i ) {
+ my $re = $1;
++ $re =~ s/:\d+//;
+ # Accept SSL cert will hostname with wild-card
+ # http://forge.fusioninventory.org/issues/542
+- $re =~ s/^([^\.]+)/($1|\\*)/;
++ $re =~ s/^([^\.]+)\.(.+)/($1|\\*)/;
+ # protect some characters, $re will be evaluated as a regex
+ $re =~ s/([\-\.])/\\$1/g;
+ $ua->default_header('If-SSL-Cert-Subject' => '/CN='.$re.'($|\/)');
+commit 8035bde109d9684dac5fd9369ce6a7a641c54f99
+Author: Gonéri Le Bouder <goneri at rulezlan.org>
+Date: Mon Nov 28 21:48:52 2011 +0100
+
+ SSL: skip some test on LWP<6
+
+ Those cases are just unsupported.
+
+ closes: #1161
+
+ Reported-by: Remi Collet <fedora at famillecollet.com>
+
+diff --git a/t/ssl.t b/t/ssl.t
+index ff8c25e..d8b384f 100644
+--- a/t/ssl.t
++++ b/t/ssl.t
+@@ -107,10 +107,14 @@ $server->set_dispatch({
+ });
+ $server->background();
+
++
++SKIP: {
++skip "Too all LWP for alternate hostname", 1 unless $LWP::VERSION >= 6;
+ ok(
+ $secure_client->send({message => $message}),
+ 'trusted certificate, alternate hostname: connection success'
+ );
++}
+
+ $server->stop();
+
+@@ -161,10 +165,14 @@ ok(
+ 'untrusted certificate, correct hostname: connection failure'
+ );
+
++SKIP: {
++skip "Check disabled on LWP<6", 1 unless $LWP::VERSION >= 6;
++# Unless you wan to fix this
+ ok(
+ $unsafe_client->send({message => $message}),
+ 'untrusted certificate, correct hostname, no check: connection success'
+ );
++}
+
+ $server->stop();
+
diff --git a/fusioninventory-agent.spec b/fusioninventory-agent.spec
index 517a63e..3cc0702 100644
--- a/fusioninventory-agent.spec
+++ b/fusioninventory-agent.spec
@@ -8,26 +8,34 @@ Group: Applications/System
License: GPLv2+
URL: http://fusioninventory.org/
-Version: 2.1.9
+Version: 2.1.12
%if 0%{?gitver:1}
Release: 0.1.git%{gitver}%{?dist}
# From http://github.com/fusinv/fusioninventory-agent/tarball/master
Source0: fusinv-fusioninventory-agent-2.1.8-95-g9bd1238.tar.gz
%else
-Release: 3%{?dist}
+Release: 1%{?dist}
Source0: http://search.cpan.org/CPAN/authors/id/F/FU/FUSINV/FusionInventory-Agent-%{version}%{?prever}.tar.gz
%endif
Source1: %{name}.cron
Source2: %{name}.init
+Patch0: %{name}-git.patch
+
+
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: perl(Module::Install)
# For tests
BuildRequires: perl(Time::HiRes) perl(XML::Simple) perl(UNIVERSAL::require) perl(Test::More)
+BuildRequires: perl(Class::Accessor::Fast) perl(Class::Data::Inheritable) perl(Test::Exception)
+%if 0%{?fedora} >= 14
+BuildRequires: perl(LWP::Protocol::https) perl(IO::Socket::SSL)
+BuildRequires: perl(HTTP::Server::Simple::Authen) perl(CGI)
+%endif
%if 0%{?fedora}>= 12 || 0%{?rhel} >= 5
BuildRequires: perl(XML::TreePP)
%endif
@@ -128,6 +136,8 @@ Le service doit être actif et lancé avec l'option --rpc-trust-localhost.
%setup -q -n FusionInventory-Agent-%{version}%{?prever}
%endif
+%patch0 -p1
+
# This work only on older version, and is ignored on recent
cat <<EOF | tee %{name}-req
#!/bin/sh
@@ -220,6 +230,11 @@ install -m 644 -D contrib/yum-plugin/%{name}.conf %{buildroot}%{_sysconfdir}/yum
%check
+%if 0%{?rhel} || 0%{?fedora} < 14
+# requires perl(HTTP::Server::Simple::Authen) not yet available
+rm t/ssl.t
+%endif
+
make test
@@ -249,9 +264,6 @@ exit 0
%files
%defattr(-, root, root, -)
%doc AUTHORS Changes LICENSE THANKS
-%if ! 0%{?gitver:1}
-%doc README*
-%endif
%dir %{_sysconfdir}/fusioninventory
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
@@ -276,6 +288,11 @@ exit 0
%changelog
+* Mon Nov 28 2011 Remi Collet <remi at fedoraproject.org> - 2.1.12-1
+- update to 2.1.12
+ http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.12/Changes
+- upstream patch for http://forge.fusioninventory.org/issues/1161
+
* Sat Aug 06 2011 Remi Collet <remi at fedoraproject.org> - 2.1.9-3
- adapt filter
diff --git a/sources b/sources
index 7675b82..27bbf1d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4e7f5dd004e6ca4edfcab0fc3dcbe422 FusionInventory-Agent-2.1.9.tar.gz
+5ef5237d3504c0651fcbdb1a04d1cd26 FusionInventory-Agent-2.1.12.tar.gz
More information about the scm-commits
mailing list