From a60ef43f4c0eba138a30a7238a253c759a4ed7e5 Mon Sep 17 00:00:00 2001 From: Tomas Jelinek Date: Wed, 22 Mar 2017 12:35:52 +0100 Subject: [PATCH] launch Python interpreter with "sane" options --- CHANGELOG.md | 3 +++ Makefile | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db0114fc4..3e12e93f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,10 +29,13 @@ [rhbz#1434111]) - Pcs no longer allows to create a stonith resource based on an agent whose name contains a colon ([rhbz#1415080]) +- Pcs command now launches Python interpreter with "sane" options (python -Es) + ([rhbz#1328882]) [CVE-2017-2661]: https://access.redhat.com/security/cve/CVE-2017-2661 [rhbz#1303969]: https://bugzilla.redhat.com/show_bug.cgi?id=1303969 [rhbz#1315627]: https://bugzilla.redhat.com/show_bug.cgi?id=1315627 +[rhbz#1328882]: https://bugzilla.redhat.com/show_bug.cgi?id=1328882 [rhbz#1334429]: https://bugzilla.redhat.com/show_bug.cgi?id=1334429 [rhbz#1362493]: https://bugzilla.redhat.com/show_bug.cgi?id=1362493 [rhbz#1378742]: https://bugzilla.redhat.com/show_bug.cgi?id=1378742 diff --git a/Makefile b/Makefile index 183986d25..0e4dff4bf 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ IS_DEBIAN=false DISTRO_DEBIAN_VER_8=false ifndef PYTHON - PYTHON=python + PYTHON := $(shell which python) endif ifeq ($(UNAME_OS_GNU),true) @@ -99,7 +99,14 @@ pcsd_fonts = \ install: + # make Python interpreter execution sane (via -Es flags) + echo -e "[build]\nexecutable = $(PYTHON) -Es\n" > setup.cfg $(PYTHON) setup.py install --root=$(or ${DESTDIR}, /) ${EXTRA_SETUP_OPTS} + # fix excessive script interpreting "executable" quoting with old setuptools: + # https://github.com/pypa/setuptools/issues/188 + # https://bugzilla.redhat.com/1353934 + sed -i '1s|^\(#!\)"\(.*\)"$$|\1\2|' ${DESTDIR}${PREFIX}/bin/pcs + rm setup.cfg mkdir -p ${DESTDIR}${PREFIX}/sbin/ mv ${DESTDIR}${PREFIX}/bin/pcs ${DESTDIR}${PREFIX}/sbin/pcs install -D -m644 pcs/bash_completion ${BASH_COMPLETION_DIR}/pcs