From 9fa9c699373d6797858110213d883c5f0aba8fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= Date: Thu, 10 Oct 2013 12:08:33 +0200 Subject: [PATCH 01/17] Add BR: systemd for systemd.macros (RHBZ #1017665). --- awstats.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index 65a3d73..6d03dc3 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.1.1 -Release: 2%{?dist} +Release: 5%{?dist} Summary: Advanced Web Statistics License: GPLv2 Group: Applications/Internet @@ -13,6 +13,8 @@ Patch1: awstats-7.0-httpd-2.4.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# For systemd.macros +BuildRequires: systemd BuildRequires: recode Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl-Net-IP, perl-Net-DNS, perl-Geo-IP @@ -149,6 +151,9 @@ fi %changelog +* Thu Oct 10 2013 Ralf Corsépius - 7.1.1-5 +- Add BR: systemd for systemd.macros (RHBZ #1017665). + * Tue Apr 02 2013 Petr Lautrbach 7.1.1-2 - add a missing requirement on crontab and fix (#947040) - add missing requirements (#908981) From 4dc3baa505d337789df4bb4b21dc5a9dbfb65c47 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mon, 9 Jun 2014 15:42:06 +0200 Subject: [PATCH 02/17] awstats-7.2-1 --- .gitignore | 1 + awstats.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cf08795..fdccc91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ awstats-7.0.tar.gz /awstats-7.1.tar.gz /awstats-7.1.1.tar.gz +/awstats-7.2.tar.gz diff --git a/awstats.spec b/awstats.spec index 6d03dc3..4b5fcc6 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,8 +1,8 @@ Name: awstats -Version: 7.1.1 -Release: 5%{?dist} +Version: 7.2 +Release: 1%{?dist} Summary: Advanced Web Statistics -License: GPLv2 +License: GPLv3+ Group: Applications/Internet URL: http://awstats.sourceforge.net Source0: http://downloads.sourceforge.net/project/awstats/AWStats/%{version}/awstats-%{version}.tar.gz @@ -151,6 +151,9 @@ fi %changelog +* Mon Jun 09 2014 Petr Lautrbach 7.2-1 +- version 7.2 + * Thu Oct 10 2013 Ralf Corsépius - 7.1.1-5 - Add BR: systemd for systemd.macros (RHBZ #1017665). diff --git a/sources b/sources index abc2f0b..76da7a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bbec0233a83cf6ac1eebcf91b555aae7 awstats-7.1.1.tar.gz +0608ee882bc4a7088e9d588e887846c5 awstats-7.2.tar.gz From baf3fea21f6338f6decdc47ea2259a5e6b2c1789 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 3 Sep 2014 23:31:07 +0200 Subject: [PATCH 03/17] temporary remove Requires: perl-Geo-IP --- awstats.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index 4b5fcc6..32e5444 100644 --- a/awstats.spec +++ b/awstats.spec @@ -17,7 +17,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: systemd BuildRequires: recode Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) -Requires: perl-Net-IP, perl-Net-DNS, perl-Geo-IP +Requires: perl-Net-IP, perl-Net-DNS +# Requires: perl-Geo-IP Requires: crontabs Requires(post): perl Requires(postun): systemd From 826a627bfc1d5bd5d09e2706aea882931c1e5818 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 3 Sep 2014 23:25:24 +0200 Subject: [PATCH 04/17] awstats-7.3-1 --- .gitignore | 1 + awstats.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fdccc91..964b750 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ awstats-7.0.tar.gz /awstats-7.1.tar.gz /awstats-7.1.1.tar.gz /awstats-7.2.tar.gz +/awstats-7.3.tar.gz diff --git a/awstats.spec b/awstats.spec index 32e5444..f4bef31 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,5 +1,5 @@ Name: awstats -Version: 7.2 +Version: 7.3 Release: 1%{?dist} Summary: Advanced Web Statistics License: GPLv3+ @@ -152,6 +152,9 @@ fi %changelog +* Wed Sep 03 2014 Petr Lautrbach 7.3-1 +- version 7.3 + * Mon Jun 09 2014 Petr Lautrbach 7.2-1 - version 7.2 diff --git a/sources b/sources index 76da7a8..938187f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0608ee882bc4a7088e9d588e887846c5 awstats-7.2.tar.gz +a76bf324d8836a8ba97f13a3c20ec6bc awstats-7.3.tar.gz From dcfad47f520b43a99c0e4289e2fe7410032f3534 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Fri, 5 Sep 2014 14:03:32 +0200 Subject: [PATCH 05/17] bring back Requires: perl-Geo-IP --- awstats.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awstats.spec b/awstats.spec index f4bef31..daa9dc5 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -17,8 +17,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: systemd BuildRequires: recode Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) -Requires: perl-Net-IP, perl-Net-DNS -# Requires: perl-Geo-IP +Requires: perl-Net-IP, perl-Net-DNS, perl-Geo-IP Requires: crontabs Requires(post): perl Requires(postun): systemd @@ -152,6 +151,9 @@ fi %changelog +* Fri Sep 05 2014 Petr Lautrbach 7.3-2 +- bring back Requires: perl-Geo-IP + * Wed Sep 03 2014 Petr Lautrbach 7.3-1 - version 7.3 From 7cadd9bef3dab08326e699e8e4e7fab4a5cd99a5 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 1 Mar 2016 21:47:10 +0100 Subject: [PATCH 06/17] awstats-7.4-1 --- .gitignore | 1 + awstats.spec | 17 ++++++++++++++--- sources | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 964b750..f0aeb1f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ awstats-7.0.tar.gz /awstats-7.1.1.tar.gz /awstats-7.2.tar.gz /awstats-7.3.tar.gz +/awstats-7.4.tar.gz diff --git a/awstats.spec b/awstats.spec index daa9dc5..423670b 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats -Version: 7.3 -Release: 2%{?dist} +Version: 7.4 +Release: 1%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -108,6 +108,13 @@ install -p -m 644 tools/httpd_conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/% # Cron job install -m 0750 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/%{name} +# replace logos with Copyright and Trademark problem by unknown.png +# https://bugzilla.redhat.com/show_bug.cgi?id=1196549 +cd $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/icon +for i in browser/adobe.png browser/seamonkey.png os/win*.png os/macos*.png cpu/intel.png cpu/ibm.png; do + cp -v os/unknown.png $i +done +cd - %clean rm -rf $RPM_BUILD_ROOT @@ -140,7 +147,7 @@ fi %{_datadir}/%{name}/wwwroot/cgi-bin # Different defattr to fix lots of files which should not be +x. %defattr(644,root,root,755) -%doc README.TXT docs/* +%doc README.md docs/* %{_datadir}/%{name}/lang %{_datadir}/%{name}/lib %{_datadir}/%{name}/plugins @@ -151,6 +158,10 @@ fi %changelog +* Tue Mar 01 2016 Petr Lautrbach 7.4-1 +- version 7.4 +- replace logos with Copyright and Trademark problem by unknown.png (#1196549) + * Fri Sep 05 2014 Petr Lautrbach 7.3-2 - bring back Requires: perl-Geo-IP diff --git a/sources b/sources index 938187f..c9fba2e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a76bf324d8836a8ba97f13a3c20ec6bc awstats-7.3.tar.gz +2ff8854a471947578ba98f43e9d0db95 awstats-7.4.tar.gz From 86d86780f08aa95bbd6559408b366b91c6020604 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 12 Apr 2017 13:30:34 +0200 Subject: [PATCH 07/17] awstats-7.6-1 --- .gitignore | 1 + awstats.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f0aeb1f..452eb0a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ awstats-7.0.tar.gz /awstats-7.2.tar.gz /awstats-7.3.tar.gz /awstats-7.4.tar.gz +/awstats-7.6.tar.gz diff --git a/awstats.spec b/awstats.spec index 423670b..a73cc75 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,5 +1,5 @@ Name: awstats -Version: 7.4 +Version: 7.6 Release: 1%{?dist} Summary: Advanced Web Statistics License: GPLv3+ @@ -158,6 +158,9 @@ fi %changelog +* Wed Apr 12 2017 Petr Lautrbach - 7.6-1 +- version 7.6 + * Tue Mar 01 2016 Petr Lautrbach 7.4-1 - version 7.4 - replace logos with Copyright and Trademark problem by unknown.png (#1196549) diff --git a/sources b/sources index c9fba2e..fb6bcc0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2ff8854a471947578ba98f43e9d0db95 awstats-7.4.tar.gz +SHA512 (awstats-7.6.tar.gz) = ebce29dcbdc1f0eef68f1faf6a511212daba3e3621db682dce692dffa584e0c456fb260b9f8e1b7ac25a2a7d5d2bea5034692d2395d4e56a16fa5a36844c79d5 From 7ccb4daed53bba89283c5229d8e03e3c427fde39 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Tue, 23 May 2017 13:55:13 +0200 Subject: [PATCH 08/17] Update spec file so it can be built on el6, el7 and Fedora --- awstats.spec | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/awstats.spec b/awstats.spec index a73cc75..ccdc0e6 100644 --- a/awstats.spec +++ b/awstats.spec @@ -8,19 +8,34 @@ URL: http://awstats.sourceforge.net Source0: http://downloads.sourceforge.net/project/awstats/AWStats/%{version}/awstats-%{version}.tar.gz Source1: %{name}.cron Patch0: awstats-awredir.pl-sanitize-parameters.patch + +%if 0%{?rhel} == 7 || 0%{?fedora} # fix configuration for httpd 2.4 (#871366) Patch1: awstats-7.0-httpd-2.4.patch +%endif + +# distribution specific definitions +%define use_systemd (0%{?fedora} || 0%{?rhel} >= 7) BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# For systemd.macros -BuildRequires: systemd +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: perl +BuildRequires: perl-generators BuildRequires: recode Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl-Net-IP, perl-Net-DNS, perl-Geo-IP Requires: crontabs Requires(post): perl + +%if %use_systemd +# For systemd.macros +BuildRequires: systemd Requires(postun): systemd +%else +Requires(postun): /sbin/service +%endif ## SELinux policy is now included upstream Obsoletes: awstats-selinux < 6.8-1 @@ -47,7 +62,9 @@ http://localhost/awstats/awstats.pl %prep %setup -q %patch0 -p 1 +%if 0%{?rhel} == 7 || 0%{?fedora} %patch1 -p 1 +%endif # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* @@ -131,7 +148,13 @@ if [ $1 -eq 1 ]; then fi %postun +%if %use_systemd %systemd_postun_with_restart httpd.service +%else +if [ $1 -ne 0 ]; then + /sbin/service httpd condrestart >/dev/null 2>&1 +fi +%endif %files From d99270e099cda67656411285c2073b34e4346f20 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Tue, 23 May 2017 14:02:15 +0200 Subject: [PATCH 09/17] Move the cron file to awstats-cron --- awstats.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index ccdc0e6..e855fb9 100644 --- a/awstats.spec +++ b/awstats.spec @@ -59,6 +59,17 @@ With the default configuration, the statistics are available: http://localhost/awstats/awstats.pl +%package cron +Group: Applications/System +Summary: Provides cron entry for awstats +Requires: %{name} +Obsoletes: awstats <= 7.6-1 + +%description cron +awstats comes with a cron entry that is set to run hourly. +This is very useful for system admins who don't run any +out of the ordinary configuration. + %prep %setup -q %patch0 -p 1 @@ -156,12 +167,14 @@ if [ $1 -ne 0 ]; then fi %endif +%files cron +%defattr(-,root,root,755) +%config(noreplace) %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name} %files %defattr(-,root,root,755) # Apache configuration file %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf -%config(noreplace) %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name} %config(noreplace) %{_sysconfdir}/%{name}/ %{_localstatedir}/lib/%{name} %dir %{_datadir}/%{name} From d5b473ba98a2ebc1e8134b6063996adfd2d622cf Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Tue, 23 May 2017 14:03:10 +0200 Subject: [PATCH 10/17] Update default path to be more compatible with Linux distro --- awstats-awstats_path.patch | 38 ++++++++++++++++++++++++++++++++++++++ awstats.spec | 3 +++ 2 files changed, 41 insertions(+) create mode 100644 awstats-awstats_path.patch diff --git a/awstats-awstats_path.patch b/awstats-awstats_path.patch new file mode 100644 index 0000000..ba708d6 --- /dev/null +++ b/awstats-awstats_path.patch @@ -0,0 +1,38 @@ +From: Chris Caron +Date: Tue, 29 Nov 2016 20:33:53 -0500 +Subject: update default path to be more compatible with Linux distro +Website: http://nuxref.com + +Make it so you don't have to pass in the -awstats=/path/to/awstats.pl +every time any script is called. + +--- + +diff -Naur awstats-7.4/tools/awstats_buildstaticpages.pl awstats-7.4.patched/tools/awstats_buildstaticpages.pl +--- awstats-7.4/tools/awstats_buildstaticpages.pl 2014-09-23 03:16:09.000000000 -0400 ++++ awstats-7.4.patched/tools/awstats_buildstaticpages.pl 2016-11-29 20:33:53.203777945 -0500 +@@ -299,6 +299,10 @@ + # Check if AWSTATS prog is found + my $AwstatsFound=0; + if (-s "$Awstats") { $AwstatsFound=1; } ++elsif (-s "/usr/share/awstats/wwwroot/cgi-bin/awstats.pl") { ++ $Awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"; ++ $AwstatsFound=1; ++} + elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") { + $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"; + $AwstatsFound=1; +diff -Naur awstats-7.4/tools/awstats_updateall.pl awstats-7.4.patched/tools/awstats_updateall.pl +--- awstats-7.4/tools/awstats_updateall.pl 2014-09-23 03:16:09.000000000 -0400 ++++ awstats-7.4.patched/tools/awstats_updateall.pl 2016-11-29 20:34:58.026745752 -0500 +@@ -129,6 +129,10 @@ + # Check if AWSTATS prog is found + my $AwstatsFound=0; + if (-s "$Awstats") { $AwstatsFound=1; } ++ elsif (-s "/usr/share/awstats/wwwroot/cgi-bin/awstats.pl") { ++ $Awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"; ++ $AwstatsFound=1; ++ } + elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") { + $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"; + $AwstatsFound=1; diff --git a/awstats.spec b/awstats.spec index e855fb9..3532494 100644 --- a/awstats.spec +++ b/awstats.spec @@ -14,6 +14,8 @@ Patch0: awstats-awredir.pl-sanitize-parameters.patch Patch1: awstats-7.0-httpd-2.4.patch %endif +Patch2: awstats-awstats_path.patch + # distribution specific definitions %define use_systemd (0%{?fedora} || 0%{?rhel} >= 7) @@ -76,6 +78,7 @@ out of the ordinary configuration. %if 0%{?rhel} == 7 || 0%{?fedora} %patch1 -p 1 %endif +%patch2 -p 1 # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* From 57e1482ad3ff373f128ef55aafd0f352e0837c87 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 24 May 2017 07:46:39 +0200 Subject: [PATCH 11/17] awstats-7.6-2 - Move cron file to awstats-cron - Update default path to be more compatible with Linux distro --- awstats.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index 3532494..40e0295 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -197,6 +197,10 @@ fi %changelog +* Tue May 23 2017 Petr Lautrbach - 7.6-2 +- Move cron file to awstats-cron +- Update default path to be more compatible with Linux distro + * Wed Apr 12 2017 Petr Lautrbach - 7.6-1 - version 7.6 From 6017b8fd9ad37364f2a411a974e69f116c71ea09 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 30 May 2017 08:59:23 +0200 Subject: [PATCH 12/17] awstats-7.6-3 - Revert "Move cron file to awstats-cron" --- awstats.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index 40e0295..0d89472 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -197,6 +197,9 @@ fi %changelog +* Tue May 30 2017 Petr Lautrbach - 7.6-3 +- Revert "Move cron file to awstats-cron" + * Tue May 23 2017 Petr Lautrbach - 7.6-2 - Move cron file to awstats-cron - Update default path to be more compatible with Linux distro From 363123735edc322a3455c01e79165e2d531f5332 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 30 May 2017 08:54:41 +0200 Subject: [PATCH 13/17] Revert "Move the cron file to awstats-cron" This reverts commit 8b0cb1db93da782683d488199bbabc75f6998b26. We need to solve upgrade path for current users of the cron file first. --- awstats.spec | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/awstats.spec b/awstats.spec index 0d89472..c7a919a 100644 --- a/awstats.spec +++ b/awstats.spec @@ -61,17 +61,6 @@ With the default configuration, the statistics are available: http://localhost/awstats/awstats.pl -%package cron -Group: Applications/System -Summary: Provides cron entry for awstats -Requires: %{name} -Obsoletes: awstats <= 7.6-1 - -%description cron -awstats comes with a cron entry that is set to run hourly. -This is very useful for system admins who don't run any -out of the ordinary configuration. - %prep %setup -q %patch0 -p 1 @@ -170,14 +159,12 @@ if [ $1 -ne 0 ]; then fi %endif -%files cron -%defattr(-,root,root,755) -%config(noreplace) %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name} %files %defattr(-,root,root,755) # Apache configuration file %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%config(noreplace) %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name} %config(noreplace) %{_sysconfdir}/%{name}/ %{_localstatedir}/lib/%{name} %dir %{_datadir}/%{name} From b94553ec9e660aa5645b10127dcd53ad954c5af2 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 31 May 2017 15:52:21 +0200 Subject: [PATCH 14/17] awstats-7.6-3.1.el7 - Revert "Move cron file to awstats-cron" again --- awstats.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awstats.spec b/awstats.spec index c7a919a..3de5d84 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.6 -Release: 3%{?dist} +Release: 3.1%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -184,7 +184,7 @@ fi %changelog -* Tue May 30 2017 Petr Lautrbach - 7.6-3 +* Tue May 30 2017 Petr Lautrbach - 7.6-3.1 - Revert "Move cron file to awstats-cron" * Tue May 23 2017 Petr Lautrbach - 7.6-2 From c231b20b1a46c876ed17b97234947d061fffd6de Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 2 Jan 2018 15:26:46 +0100 Subject: [PATCH 15/17] Fix two path traversal flaws were discovered in awstats Fixes: CVE-2017-1000501 https://bugzilla.redhat.com/show_bug.cgi?id=1529349 --- ...orted-by-cPanel-Security-Team-can-ex.patch | 71 +++++++++++++++++++ ...erability-reported-by-cPanel-Securit.patch | 70 ++++++++++++++++++ awstats.spec | 4 ++ 3 files changed, 145 insertions(+) create mode 100644 FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch create mode 100644 Fix-another-vulnerability-reported-by-cPanel-Securit.patch diff --git a/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch b/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch new file mode 100644 index 0000000..1233b64 --- /dev/null +++ b/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch @@ -0,0 +1,71 @@ +From cf219843a74c951bf5986f3a7fffa3dcf99c3899 Mon Sep 17 00:00:00 2001 +From: Laurent Destailleur +Date: Sun, 17 Dec 2017 12:55:48 +0100 +Subject: [PATCH] FIX Security reported by cPanel Security Team (can execute + arbitraty code) + +--- + wwwroot/cgi-bin/awstats.pl | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl +index 091d6823..fca4900f 100755 +--- a/wwwroot/cgi-bin/awstats.pl ++++ b/wwwroot/cgi-bin/awstats.pl +@@ -1780,7 +1780,7 @@ sub Read_Config { + }else{if ($Debug){debug("Unable to open config file: $searchdir$SiteConfig", 2);}} + } + +- #CL - Added to open config if full path is passed to awstats ++ #CL - Added to open config if full path is passed to awstats + if ( !$FileConfig ) { + + my $SiteConfigBis = File::Spec->rel2abs($SiteConfig); +@@ -2205,7 +2205,10 @@ sub Parse_Config { + } + + # Plugins +- if ( $param =~ /^LoadPlugin/ ) { push @PluginsToLoad, $value; next; } ++ if ( $param =~ /^LoadPlugin/ ) { ++ $value =~ s/[^a-zA-Z0-9_\/\.\+:=\?\s%\-]//g; # Sanitize plugin name and string param because it is used later in an eval. ++ push @PluginsToLoad, $value; next; ++ } + + # Other parameter checks we need to put after MaxNbOfExtra and MinHitExtra + if ( $param =~ /^MaxNbOf(\w+)/ ) { $MaxNbOf{$1} = $value; next; } +@@ -3251,7 +3254,7 @@ sub Read_Plugins { + } + my $ret; # To get init return + my $initfunction = +- "\$ret=Init_$pluginname('$pluginparam')"; ++ "\$ret=Init_$pluginname('$pluginparam')"; # Note that pluginname and pluginparam were sanitized when reading cong file entry 'LoadPlugin' + my $initret = eval("$initfunction"); + if ( $initret && $initret eq 'xxx' ) { + $initret = +@@ -17140,7 +17143,10 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI + # No update but report by default when run from a browser + $UpdateStats = ( $QueryString =~ /update=1/i ? 1 : 0 ); + +- if ( $QueryString =~ /config=([^&]+)/i ) { $SiteConfig = &Sanitize("$1"); } ++ if ( $QueryString =~ /config=([^&]+)/i ) { ++ $SiteConfig = &Sanitize("$1"); ++ $SiteConfig =~ s/\.\.//g; # Avoid directory transversal ++ } + if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } + if ( $QueryString =~ /pluginmode=([^&]+)/i ) { + $PluginMode = &Sanitize( "$1", 1 ); +@@ -17227,7 +17233,10 @@ else { # Run from command line + # Update with no report by default when run from command line + $UpdateStats = 1; + +- if ( $QueryString =~ /config=([^&]+)/i ) { $SiteConfig = &Sanitize("$1"); } ++ if ( $QueryString =~ /config=([^&]+)/i ) { ++ $SiteConfig = &Sanitize("$1"); ++ $SiteConfig =~ s/\.\.//g; ++ } + if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } + if ( $QueryString =~ /pluginmode=([^&]+)/i ) { + $PluginMode = &Sanitize( "$1", 1 ); +-- +2.15.1 + diff --git a/Fix-another-vulnerability-reported-by-cPanel-Securit.patch b/Fix-another-vulnerability-reported-by-cPanel-Securit.patch new file mode 100644 index 0000000..3a3e588 --- /dev/null +++ b/Fix-another-vulnerability-reported-by-cPanel-Securit.patch @@ -0,0 +1,70 @@ +From 06c0ab29c1e5059d9e0279c6b64d573d619e1651 Mon Sep 17 00:00:00 2001 +From: Laurent Destailleur +Date: Wed, 27 Dec 2017 13:39:57 +0100 +Subject: [PATCH] Fix another vulnerability reported by cPanel Security Team + (can execute arbitraty code) + +--- + wwwroot/cgi-bin/awstats.pl | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl +index fca4900f..4f14c6ee 100755 +--- a/wwwroot/cgi-bin/awstats.pl ++++ b/wwwroot/cgi-bin/awstats.pl +@@ -17145,7 +17145,6 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI + + if ( $QueryString =~ /config=([^&]+)/i ) { + $SiteConfig = &Sanitize("$1"); +- $SiteConfig =~ s/\.\.//g; # Avoid directory transversal + } + if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } + if ( $QueryString =~ /pluginmode=([^&]+)/i ) { +@@ -17191,10 +17190,13 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI + # If migrate + if ( $QueryString =~ /(^|-|&|&)migrate=([^&]+)/i ) { + $MigrateStats = &Sanitize("$2"); ++ + $MigrateStats =~ /^(.*)$PROG(\d{0,2})(\d\d)(\d\d\d\d)(.*)\.txt$/; +- $SiteConfig = $5 ? $5 : 'xxx'; ++ $SiteConfig = &Sanitize($5 ? $5 : 'xxx'); + $SiteConfig =~ s/^\.//; # SiteConfig is used to find config file + } ++ ++ $SiteConfig =~ s/\.\.//g; # Avoid directory transversal + } + else { # Run from command line + $DebugMessages = 1; +@@ -17204,9 +17206,10 @@ else { # Run from command line + + # If migrate + if ( $ARGV[$_] =~ /(^|-|&|&)migrate=([^&]+)/i ) { +- $MigrateStats = "$2"; ++ $MigrateStats = &Sanitize("$2"); ++ + $MigrateStats =~ /^(.*)$PROG(\d{0,2})(\d\d)(\d\d\d\d)(.*)\.txt$/; +- $SiteConfig = $5 ? $5 : 'xxx'; ++ $SiteConfig = &Sanitize($5 ? $5 : 'xxx'); + $SiteConfig =~ s/^\.//; # SiteConfig is used to find config file + next; + } +@@ -17235,7 +17238,6 @@ else { # Run from command line + + if ( $QueryString =~ /config=([^&]+)/i ) { + $SiteConfig = &Sanitize("$1"); +- $SiteConfig =~ s/\.\.//g; + } + if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } + if ( $QueryString =~ /pluginmode=([^&]+)/i ) { +@@ -17301,6 +17303,8 @@ else { # Run from command line + $ShowDirectOrigin = 1; + $QueryString =~ s/showdirectorigin[^&]*//i; + } ++ ++ $SiteConfig =~ s/\.\.//g; + } + if ( $QueryString =~ /(^|&|&)staticlinks/i ) { + $StaticLinks = "$PROG.$SiteConfig"; +-- +2.15.1 + diff --git a/awstats.spec b/awstats.spec index 3de5d84..53c1782 100644 --- a/awstats.spec +++ b/awstats.spec @@ -15,6 +15,8 @@ Patch1: awstats-7.0-httpd-2.4.patch %endif Patch2: awstats-awstats_path.patch +Patch3: FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch +Patch4: Fix-another-vulnerability-reported-by-cPanel-Securit.patch # distribution specific definitions %define use_systemd (0%{?fedora} || 0%{?rhel} >= 7) @@ -68,6 +70,8 @@ http://localhost/awstats/awstats.pl %patch1 -p 1 %endif %patch2 -p 1 +%patch3 -p 1 +%patch4 -p 1 # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* From 10904698c25f6051237252995de154d30606cf9b Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 2 Jan 2018 17:09:15 +0100 Subject: [PATCH 16/17] awstats-7.6-4 - Fix two path traversal issues in awstat.pl - CVE-2017-1000501 (#1529349) --- awstats.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awstats.spec b/awstats.spec index 53c1782..6baa2e3 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats Version: 7.6 -Release: 3.1%{?dist} +Release: 4%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -188,6 +188,9 @@ fi %changelog +* Tue Jan 02 2018 Petr Lautrbach - 7.6-4 +- Fix two path traversal issues in awstat.pl - CVE-2017-1000501 (#1529349) + * Tue May 30 2017 Petr Lautrbach - 7.6-3.1 - Revert "Move cron file to awstats-cron" From b6ea8817ff0b2418f1b9fa1cc362fbf5ff0f03e1 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mon, 8 Jan 2018 14:06:10 +0100 Subject: [PATCH 17/17] awstats-7.7-1 --- .gitignore | 1 + ...orted-by-cPanel-Security-Team-can-ex.patch | 71 ------------------- ...erability-reported-by-cPanel-Securit.patch | 70 ------------------ awstats.spec | 11 ++- sources | 2 +- 5 files changed, 7 insertions(+), 148 deletions(-) delete mode 100644 FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch delete mode 100644 Fix-another-vulnerability-reported-by-cPanel-Securit.patch diff --git a/.gitignore b/.gitignore index 452eb0a..ed55366 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ awstats-7.0.tar.gz /awstats-7.3.tar.gz /awstats-7.4.tar.gz /awstats-7.6.tar.gz +/awstats-7.7.tar.gz diff --git a/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch b/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch deleted file mode 100644 index 1233b64..0000000 --- a/FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch +++ /dev/null @@ -1,71 +0,0 @@ -From cf219843a74c951bf5986f3a7fffa3dcf99c3899 Mon Sep 17 00:00:00 2001 -From: Laurent Destailleur -Date: Sun, 17 Dec 2017 12:55:48 +0100 -Subject: [PATCH] FIX Security reported by cPanel Security Team (can execute - arbitraty code) - ---- - wwwroot/cgi-bin/awstats.pl | 19 ++++++++++++++----- - 1 file changed, 14 insertions(+), 5 deletions(-) - -diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl -index 091d6823..fca4900f 100755 ---- a/wwwroot/cgi-bin/awstats.pl -+++ b/wwwroot/cgi-bin/awstats.pl -@@ -1780,7 +1780,7 @@ sub Read_Config { - }else{if ($Debug){debug("Unable to open config file: $searchdir$SiteConfig", 2);}} - } - -- #CL - Added to open config if full path is passed to awstats -+ #CL - Added to open config if full path is passed to awstats - if ( !$FileConfig ) { - - my $SiteConfigBis = File::Spec->rel2abs($SiteConfig); -@@ -2205,7 +2205,10 @@ sub Parse_Config { - } - - # Plugins -- if ( $param =~ /^LoadPlugin/ ) { push @PluginsToLoad, $value; next; } -+ if ( $param =~ /^LoadPlugin/ ) { -+ $value =~ s/[^a-zA-Z0-9_\/\.\+:=\?\s%\-]//g; # Sanitize plugin name and string param because it is used later in an eval. -+ push @PluginsToLoad, $value; next; -+ } - - # Other parameter checks we need to put after MaxNbOfExtra and MinHitExtra - if ( $param =~ /^MaxNbOf(\w+)/ ) { $MaxNbOf{$1} = $value; next; } -@@ -3251,7 +3254,7 @@ sub Read_Plugins { - } - my $ret; # To get init return - my $initfunction = -- "\$ret=Init_$pluginname('$pluginparam')"; -+ "\$ret=Init_$pluginname('$pluginparam')"; # Note that pluginname and pluginparam were sanitized when reading cong file entry 'LoadPlugin' - my $initret = eval("$initfunction"); - if ( $initret && $initret eq 'xxx' ) { - $initret = -@@ -17140,7 +17143,10 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI - # No update but report by default when run from a browser - $UpdateStats = ( $QueryString =~ /update=1/i ? 1 : 0 ); - -- if ( $QueryString =~ /config=([^&]+)/i ) { $SiteConfig = &Sanitize("$1"); } -+ if ( $QueryString =~ /config=([^&]+)/i ) { -+ $SiteConfig = &Sanitize("$1"); -+ $SiteConfig =~ s/\.\.//g; # Avoid directory transversal -+ } - if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } - if ( $QueryString =~ /pluginmode=([^&]+)/i ) { - $PluginMode = &Sanitize( "$1", 1 ); -@@ -17227,7 +17233,10 @@ else { # Run from command line - # Update with no report by default when run from command line - $UpdateStats = 1; - -- if ( $QueryString =~ /config=([^&]+)/i ) { $SiteConfig = &Sanitize("$1"); } -+ if ( $QueryString =~ /config=([^&]+)/i ) { -+ $SiteConfig = &Sanitize("$1"); -+ $SiteConfig =~ s/\.\.//g; -+ } - if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } - if ( $QueryString =~ /pluginmode=([^&]+)/i ) { - $PluginMode = &Sanitize( "$1", 1 ); --- -2.15.1 - diff --git a/Fix-another-vulnerability-reported-by-cPanel-Securit.patch b/Fix-another-vulnerability-reported-by-cPanel-Securit.patch deleted file mode 100644 index 3a3e588..0000000 --- a/Fix-another-vulnerability-reported-by-cPanel-Securit.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 06c0ab29c1e5059d9e0279c6b64d573d619e1651 Mon Sep 17 00:00:00 2001 -From: Laurent Destailleur -Date: Wed, 27 Dec 2017 13:39:57 +0100 -Subject: [PATCH] Fix another vulnerability reported by cPanel Security Team - (can execute arbitraty code) - ---- - wwwroot/cgi-bin/awstats.pl | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl -index fca4900f..4f14c6ee 100755 ---- a/wwwroot/cgi-bin/awstats.pl -+++ b/wwwroot/cgi-bin/awstats.pl -@@ -17145,7 +17145,6 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI - - if ( $QueryString =~ /config=([^&]+)/i ) { - $SiteConfig = &Sanitize("$1"); -- $SiteConfig =~ s/\.\.//g; # Avoid directory transversal - } - if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } - if ( $QueryString =~ /pluginmode=([^&]+)/i ) { -@@ -17191,10 +17190,13 @@ if ( $ENV{'GATEWAY_INTERFACE'} ) { # Run from a browser as CGI - # If migrate - if ( $QueryString =~ /(^|-|&|&)migrate=([^&]+)/i ) { - $MigrateStats = &Sanitize("$2"); -+ - $MigrateStats =~ /^(.*)$PROG(\d{0,2})(\d\d)(\d\d\d\d)(.*)\.txt$/; -- $SiteConfig = $5 ? $5 : 'xxx'; -+ $SiteConfig = &Sanitize($5 ? $5 : 'xxx'); - $SiteConfig =~ s/^\.//; # SiteConfig is used to find config file - } -+ -+ $SiteConfig =~ s/\.\.//g; # Avoid directory transversal - } - else { # Run from command line - $DebugMessages = 1; -@@ -17204,9 +17206,10 @@ else { # Run from command line - - # If migrate - if ( $ARGV[$_] =~ /(^|-|&|&)migrate=([^&]+)/i ) { -- $MigrateStats = "$2"; -+ $MigrateStats = &Sanitize("$2"); -+ - $MigrateStats =~ /^(.*)$PROG(\d{0,2})(\d\d)(\d\d\d\d)(.*)\.txt$/; -- $SiteConfig = $5 ? $5 : 'xxx'; -+ $SiteConfig = &Sanitize($5 ? $5 : 'xxx'); - $SiteConfig =~ s/^\.//; # SiteConfig is used to find config file - next; - } -@@ -17235,7 +17238,6 @@ else { # Run from command line - - if ( $QueryString =~ /config=([^&]+)/i ) { - $SiteConfig = &Sanitize("$1"); -- $SiteConfig =~ s/\.\.//g; - } - if ( $QueryString =~ /diricons=([^&]+)/i ) { $DirIcons = "$1"; } - if ( $QueryString =~ /pluginmode=([^&]+)/i ) { -@@ -17301,6 +17303,8 @@ else { # Run from command line - $ShowDirectOrigin = 1; - $QueryString =~ s/showdirectorigin[^&]*//i; - } -+ -+ $SiteConfig =~ s/\.\.//g; - } - if ( $QueryString =~ /(^|&|&)staticlinks/i ) { - $StaticLinks = "$PROG.$SiteConfig"; --- -2.15.1 - diff --git a/awstats.spec b/awstats.spec index 6baa2e3..8d10ab0 100644 --- a/awstats.spec +++ b/awstats.spec @@ -1,6 +1,6 @@ Name: awstats -Version: 7.6 -Release: 4%{?dist} +Version: 7.7 +Release: 1%{?dist} Summary: Advanced Web Statistics License: GPLv3+ Group: Applications/Internet @@ -15,8 +15,6 @@ Patch1: awstats-7.0-httpd-2.4.patch %endif Patch2: awstats-awstats_path.patch -Patch3: FIX-Security-reported-by-cPanel-Security-Team-can-ex.patch -Patch4: Fix-another-vulnerability-reported-by-cPanel-Securit.patch # distribution specific definitions %define use_systemd (0%{?fedora} || 0%{?rhel} >= 7) @@ -70,8 +68,6 @@ http://localhost/awstats/awstats.pl %patch1 -p 1 %endif %patch2 -p 1 -%patch3 -p 1 -%patch4 -p 1 # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* @@ -188,6 +184,9 @@ fi %changelog +* Mon Jan 08 2018 Petr Lautrbach - 7.7-1 +- Version 7.7 + * Tue Jan 02 2018 Petr Lautrbach - 7.6-4 - Fix two path traversal issues in awstat.pl - CVE-2017-1000501 (#1529349) diff --git a/sources b/sources index fb6bcc0..a8fba76 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (awstats-7.6.tar.gz) = ebce29dcbdc1f0eef68f1faf6a511212daba3e3621db682dce692dffa584e0c456fb260b9f8e1b7ac25a2a7d5d2bea5034692d2395d4e56a16fa5a36844c79d5 +SHA512 (awstats-7.7.tar.gz) = 8bf32b0650ef0cc900a16eead866da3847d81c2696e7a90fb49833679c958768833d781e5b4becd9b4f6748c7266e2887ff7ff33d98293ce3a0296a810fbe899