From 9c0928d7a6c4c449e7291dfc8341dcb472fdef25 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Apr 19 2017 20:53:37 +0000 Subject: update backport patch to the one actually merged upstream --- diff --git a/ansible-pr-23633.patch b/ansible-pr-23633.patch deleted file mode 100644 index 71682de..0000000 --- a/ansible-pr-23633.patch +++ /dev/null @@ -1,23 +0,0 @@ -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-pr-23703.patch b/ansible-pr-23703.patch new file mode 100644 index 0000000..9426e22 --- /dev/null +++ b/ansible-pr-23703.patch @@ -0,0 +1,33 @@ +From b9ee0c547797f253771489542f0f5ac08bf04bf6 Mon Sep 17 00:00:00 2001 +From: Timo Benk +Date: Wed, 19 Apr 2017 20:15:20 +0200 +Subject: [PATCH] fix ansible galaxy file mangling (#23703) + +without this patch, ansible-galaxy will mangle files containing +the archive parent directory name, eg 'owncloud/files/owncloud.cron' +will become 'owncloud/files/.cron'. + +The previous code could affect the entire path and even filenames. +If a file path has the top level dir name as a substring, galaxy +replaces it with ''. In one example, the archive top level dir +is 'go', so 'files/go-bin.sh' becomes 'files/-bin.sh'. + +Fixes #22572, #23694, #23623 +(cherry picked from commit 79943b86a1ee9338049149824bbb12f99d8186ee) +--- + 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..3b89176 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.replace(archive_parent_dir, "", 1).split(os.sep) + 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 26dcee3..5b9112d 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: 2%{?dist} +Release: 3%{?dist} Group: Development/Libraries License: GPLv3+ @@ -29,7 +29,7 @@ Source0: http://releases.ansible.com/ansible/%{name}-%{version}.tar.gz Source1: .coveragerc # Fixes a regression in 2.3.0 - see https://github.com/ansible/ansible/issues/22572 -Patch0: ansible-pr-23633.patch +Patch0: ansible-pr-23703.patch # Patch to utilize a newer jinja2 package on epel6 # Non-upstreamable as it creates a dependency on a specific version of jinja. @@ -331,6 +331,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Apr 19 2017 James Hogarth - 2.3.0.0-3 +- Update backported patch to the one actually merged upstream + * 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