From owner-svn-ports-head@freebsd.org Thu Jan 28 10:11:33 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D244BA705AF; Thu, 28 Jan 2016 10:11:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B10751A92; Thu, 28 Jan 2016 10:11:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SABWtE023476; Thu, 28 Jan 2016 10:11:32 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SABWk1023474; Thu, 28 Jan 2016 10:11:32 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201601281011.u0SABWk1023474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Thu, 28 Jan 2016 10:11:32 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r407405 - in head/sysutils/ansible: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 10:11:34 -0000 Author: matthew Date: Thu Jan 28 10:11:32 2016 New Revision: 407405 URL: https://svnweb.freebsd.org/changeset/ports/407405 Log: Backport upstream patch to fix overquoting of commands run via su PR: 206591 Submitted by: leeb@ratnaling.org Approved by: lifanov@mail.lifanov.com (maintainer) Obtained from: https://github.com/ansible/ansible/commit/6bf2f45ff52d252dbada6a1860416fa603be56bd Added: head/sysutils/ansible/files/extra-patch-6bf2f45 (contents, props changed) Modified: head/sysutils/ansible/Makefile Modified: head/sysutils/ansible/Makefile ============================================================================== --- head/sysutils/ansible/Makefile Thu Jan 28 09:29:33 2016 (r407404) +++ head/sysutils/ansible/Makefile Thu Jan 28 10:11:32 2016 (r407405) @@ -3,7 +3,7 @@ PORTNAME= ansible PORTVERSION?= 2.0.0.2 -PORTREVISION?= 2 +PORTREVISION?= 3 CATEGORIES= sysutils python MASTER_SITES= http://releases.ansible.com/ansible/ @@ -18,7 +18,8 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml ${PYTHON_PKGNAMEPREFIX}paramiko>0:${PORTSDIR}/security/py-paramiko \ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2 -EXTRA_PATCHES?= ${FILESDIR}/extra-patch-8647fdc +EXTRA_PATCHES?= ${FILESDIR}/extra-patch-8647fdc \ + ${FILESDIR}/extra-patch-6bf2f45 NO_ARCH= yes USES= cpe python:2 shebangfix Added: head/sysutils/ansible/files/extra-patch-6bf2f45 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/ansible/files/extra-patch-6bf2f45 Thu Jan 28 10:11:32 2016 (r407405) @@ -0,0 +1,31 @@ +--- lib/ansible/playbook/play_context.py.orig 2016-01-14 22:33:27 UTC ++++ lib/ansible/playbook/play_context.py +@@ -446,8 +446,10 @@ class PlayContext(Base): + + if self.become_method == 'sudo': + # If we have a password, we run sudo with a randomly-generated +- # prompt set using -p. Otherwise we run it with -n, which makes ++ # prompt set using -p. Otherwise we run it with default -n, which makes + # it fail if it would have prompted for a password. ++ # Cannot rely on -n as it can be removed from defaults, which should be ++ # done for older versions of sudo that do not support the option. + # + # Passing a quoted compound command to sudo (or sudo -s) + # directly doesn't work, so we shellquote it with pipes.quote() +@@ -463,12 +465,14 @@ class PlayContext(Base): + + elif self.become_method == 'su': + ++ # passing code ref to examine prompt as simple string comparisson isn't good enough with su + def detect_su_prompt(data): + SU_PROMPT_LOCALIZATIONS_RE = re.compile("|".join(['(\w+\'s )?' + x + ' ?: ?' for x in SU_PROMPT_LOCALIZATIONS]), flags=re.IGNORECASE) + return bool(SU_PROMPT_LOCALIZATIONS_RE.match(data)) +- + prompt = detect_su_prompt +- becomecmd = '%s %s %s -c "%s -c %s"' % (exe, flags, self.become_user, executable, success_cmd) ++ ++ su_success_cmd = '%s -c %s' % (executable, success_cmd) # this is here cause su too succeptible to overquoting ++ becomecmd = '%s %s %s -c %s' % (exe, flags, self.become_user, su_success_cmd) #works with sh + + elif self.become_method == 'pbrun': +