From 1535cd952817d55239bed8eba5ededbb850c6a84 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Apr 19 2017 14:49:00 +0000 Subject: backport fix for GH upstream issue 22572 until it is in a release --- diff --git a/ansible-pr-23633.patch b/ansible-pr-23633.patch new file mode 100644 index 0000000..71682de --- /dev/null +++ b/ansible-pr-23633.patch @@ -0,0 +1,23 @@ +From 8a2ca28f73d9e5f64dab0bdbdd445a2ea3caef30 Mon Sep 17 00:00:00 2001 +From: Pat Lathem +Date: Sat, 15 Apr 2017 09:40:54 -0500 +Subject: [PATCH] Make sure to only remove the first directory in the path. The + previous code could affect the entire path and even filenames. + +--- + lib/ansible/galaxy/role.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py +index 67bdc95..2a4783f 100644 +--- a/lib/ansible/galaxy/role.py ++++ b/lib/ansible/galaxy/role.py +@@ -316,7 +316,7 @@ def install(self): + # bits that might be in the file for security purposes + # and drop any containing directory, as mentioned above + if member.isreg() or member.issym(): +- parts = member.name.replace(archive_parent_dir, "").split(os.sep) ++ parts = member.name.split(os.sep)[1:] + final_parts = [] + for part in parts: + if part != '..' and '~' not in part and '$' not in part: diff --git a/ansible.spec b/ansible.spec index 67122ee..26dcee3 100644 --- a/ansible.spec +++ b/ansible.spec @@ -20,7 +20,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Name: ansible Summary: SSH-based configuration management, deployment, and task execution system Version: 2.3.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Group: Development/Libraries License: GPLv3+ @@ -28,6 +28,9 @@ Source0: http://releases.ansible.com/ansible/%{name}-%{version}.tar.gz # Needed for unittests to run. Will be in future upstream tarballs. Source1: .coveragerc +# Fixes a regression in 2.3.0 - see https://github.com/ansible/ansible/issues/22572 +Patch0: ansible-pr-23633.patch + # Patch to utilize a newer jinja2 package on epel6 # Non-upstreamable as it creates a dependency on a specific version of jinja. # This is desirable for us as we have packages for that version but not for @@ -208,6 +211,7 @@ This package installs extensive documentation for ansible %prep %setup -q +%patch0 -p1 # Unittests #tar -xJvf %{SOURCE1} @@ -327,6 +331,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Apr 19 2017 James Hogarth - 2.3.0.0-2 +- Backport hotfix to fix ansible-galaxy regression https://github.com/ansible/ansible/issues/22572 + * Wed Apr 12 2017 Toshio Kuratomi - 2.3.0.0-1 - Update to 2.3.0 - Remove upstreamed patches