commit:     aa053bca0804c086700570dec17cd10c4169f70d
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 15 17:16:54 2017 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Tue Aug 15 17:16:54 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa053bca

app-admin/salt: Apply fix for bug #627928 to 2015.8.13 as well

Package-Manager: Portage-2.3.7, Repoman-2.3.3

 .../salt-2015.8.13-sanitize-minion-name.patch      |  36 ++++++
 app-admin/salt/salt-2015.8.13-r1.ebuild            | 141 +++++++++++++++++++++
 2 files changed, 177 insertions(+)

diff --git a/app-admin/salt/files/salt-2015.8.13-sanitize-minion-name.patch 
b/app-admin/salt/files/salt-2015.8.13-sanitize-minion-name.patch
new file mode 100644
index 00000000000..6ede1399072
--- /dev/null
+++ b/app-admin/salt/files/salt-2015.8.13-sanitize-minion-name.patch
@@ -0,0 +1,36 @@
+From aa87d67258a5b6742fc53d06c7bdac0f643bc9f1 Mon Sep 17 00:00:00 2001
+From: Ch3LL <megan.wilh...@gmail.com>
+Date: Tue, 1 Aug 2017 13:44:32 -0400
+Subject: [PATCH] Add clean_id function to salt.utils.verify.py
+
+---
+ salt/utils/verify.py | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/salt/utils/verify.py b/salt/utils/verify.py
+index 5cac0fa651b..a3dc67db336 100644
+--- a/salt/utils/verify.py
++++ b/salt/utils/verify.py
+@@ -480,12 +480,21 @@ def clean_path(root, path, subdir=False):
+     return ''
+ 
+ 
++def clean_id(id_):
++    '''
++    Returns if the passed id is clean.
++    '''
++    if re.search(r'\.\.{sep}'.format(sep=os.sep), id_):
++        return False
++    return True
++
++
+ def valid_id(opts, id_):
+     '''
+     Returns if the passed id is valid
+     '''
+     try:
+-        return bool(clean_path(opts['pki_dir'], id_))
++        return bool(clean_path(opts['pki_dir'], id_)) and clean_id(id_)
+     except (AttributeError, KeyError, TypeError) as e:
+         return False
+ 

diff --git a/app-admin/salt/salt-2015.8.13-r1.ebuild 
b/app-admin/salt/salt-2015.8.13-r1.ebuild
new file mode 100644
index 00000000000..ed02341af26
--- /dev/null
+++ b/app-admin/salt/salt-2015.8.13-r1.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+
+inherit eutils systemd distutils-r1
+
+DESCRIPTION="Salt is a remote execution and configuration manager"
+HOMEPAGE="https://saltstack.com/community/";
+
+if [[ ${PV} == 9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git";
+       EGIT_BRANCH="develop"
+       SRC_URI=""
+       KEYWORDS=""
+else
+       SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+       KEYWORDS="~x86 ~amd64"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="cherrypy ldap libcloud libvirt gnupg keyring mako mongodb mysql neutron 
nova"
+IUSE+=" openssl portage profile redis selinux test timelib raet +zeromq 
vim-syntax"
+
+RDEPEND="sys-apps/pciutils
+       dev-python/jinja[${PYTHON_USEDEP}]
+       >=dev-python/msgpack-0.3[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/markupsafe[${PYTHON_USEDEP}]
+       >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       >=www-servers/tornado-4.2.1[${PYTHON_USEDEP}]
+       virtual/python-futures[${PYTHON_USEDEP}]
+       libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] )
+       mako? ( dev-python/mako[${PYTHON_USEDEP}] )
+       ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
+       libvirt? ( dev-python/libvirt-python[${PYTHON_USEDEP}] )
+       openssl? (
+               dev-libs/openssl:*[-bindist]
+               dev-python/pyopenssl[${PYTHON_USEDEP}]
+       )
+       raet? (
+               >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
+               >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
+               >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
+       )
+       zeromq? (
+               >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}]
+               >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
+       )
+       cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
+       mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
+       portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
+       keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
+       mysql? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
+       redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
+       selinux? ( sec-policy/selinux-salt )
+       timelib? ( dev-python/timelib[${PYTHON_USEDEP}] )
+       nova? ( >=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}] )
+       neutron? ( >=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}] )
+       gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
+       profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
+       vim-syntax? ( app-vim/salt-vim )"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+       test? (
+               dev-python/psutil[${PYTHON_USEDEP}]
+               dev-python/pip[${PYTHON_USEDEP}]
+               dev-python/virtualenv[${PYTHON_USEDEP}]
+               dev-python/mock[${PYTHON_USEDEP}]
+               dev-python/timelib[${PYTHON_USEDEP}]
+               >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
+               >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
+               >=dev-python/SaltTesting-2015.2.16[${PYTHON_USEDEP}]
+               ${RDEPEND}
+       )"
+
+DOCS=(README.rst AUTHORS)
+
+REQUIRED_USE="|| ( raet zeromq )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-2015.8.0-remove-buggy-tests.patch"
+       "${FILESDIR}/${PN}-2015.5.5-auth-tests.patch"
+       "${FILESDIR}/${PN}-2015.5.5-cron-tests.patch"
+       "${FILESDIR}/${PN}-2015.5.5-remove-buggy-tests.patch"
+       "${FILESDIR}/${PN}-2015.8.2-tmpdir.patch"
+       "${FILESDIR}/${PN}-2015.8.10-remove-failing-boto-test.patch"
+       "${FILESDIR}/${PN}-2015.8.13-failing-gateway-tests.patch"
+       "${FILESDIR}/${PN}-2015.8.13-sanitize-minion-name.patch"
+)
+
+python_prepare() {
+       # this test fails because it trys to "pip install distribute"
+       rm tests/unit/{modules,states}/zcbuildout_test.py \
+               tests/unit/modules/{rh_ip,win_network,random_org}_test.py
+}
+
+python_install_all() {
+       local svc
+       USE_SETUPTOOLS=1 distutils-r1_python_install_all
+
+       for svc in minion master syndic api; do
+               newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc}
+               newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
+               if [[ -e pkg/salt-${svc}.service ]]; then
+                       sed -i -r 's/After=(.*)/After=syslog.target \1/' 
pkg/salt-${svc}.service || die
+                       systemd_dounit pkg/salt-${svc}.service
+               elif [[ -e "${FILESDIR}"/salt-${svc}.service ]]; then
+                       systemd_dounit "${FILESDIR}"/salt-${svc}.service
+               fi
+       done
+
+       insinto /etc/${PN}
+       doins -r conf/*
+}
+
+python_test() {
+       local tempdir
+       # testsuite likes lots of files
+       ulimit -n 3072
+
+       # ${T} is too long a path for the tests to work
+       tempdir="$(mktemp -dup /tmp salt-XXX)"
+       mkdir "${T}/$(basename "${tempdir}")"
+
+       (
+               cleanup() { rm -f "${tempdir}"; }
+               trap cleanup EXIT
+
+               addwrite "${tempdir}"
+               ln -s "$(realpath --relative-to=/tmp "${T}/$(basename 
"${tempdir}")")" "${tempdir}"
+
+               USE_SETUPTOOLS=1 SHELL="/bin/bash" TMPDIR="${tempdir}" \
+                       ${EPYTHON} tests/runtests.py \
+                       --unit-tests --no-report --verbose
+
+       ) || die "testing failed"
+}

Reply via email to