View | Details | Raw Unified | Return to bug 206591 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-2 / +3 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	ansible
4
PORTNAME=	ansible
5
PORTVERSION?=	2.0.0.2
5
PORTVERSION?=	2.0.0.2
6
PORTREVISION?=	2
6
PORTREVISION?=	3
7
CATEGORIES=	sysutils python
7
CATEGORIES=	sysutils python
8
MASTER_SITES=	http://releases.ansible.com/ansible/
8
MASTER_SITES=	http://releases.ansible.com/ansible/
9
9
Lines 18-24 Link Here
18
		${PYTHON_PKGNAMEPREFIX}paramiko>0:${PORTSDIR}/security/py-paramiko \
18
		${PYTHON_PKGNAMEPREFIX}paramiko>0:${PORTSDIR}/security/py-paramiko \
19
		${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2
19
		${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2
20
20
21
EXTRA_PATCHES?=	${FILESDIR}/extra-patch-8647fdc
21
EXTRA_PATCHES?=	${FILESDIR}/extra-patch-8647fdc \
22
		${FILESDIR}/extra-patch-6bf2f45
22
23
23
NO_ARCH=	yes
24
NO_ARCH=	yes
24
USES=		cpe python:2 shebangfix
25
USES=		cpe python:2 shebangfix
(-)files/extra-patch-6bf2f45 (+31 lines)
Line 0 Link Here
1
--- lib/ansible/playbook/play_context.py.orig	2016-01-14 22:33:27 UTC
2
+++ lib/ansible/playbook/play_context.py
3
@@ -446,8 +446,10 @@ class PlayContext(Base):
4
 
5
             if self.become_method == 'sudo':
6
                 # If we have a password, we run sudo with a randomly-generated
7
-                # prompt set using -p. Otherwise we run it with -n, which makes
8
+                # prompt set using -p. Otherwise we run it with default -n, which makes
9
                 # it fail if it would have prompted for a password.
10
+                # Cannot rely on -n as it can be removed from defaults, which should be
11
+                # done for older versions of sudo that do not support the option.
12
                 #
13
                 # Passing a quoted compound command to sudo (or sudo -s)
14
                 # directly doesn't work, so we shellquote it with pipes.quote()
15
@@ -463,12 +465,14 @@ class PlayContext(Base):
16
 
17
             elif self.become_method == 'su':
18
 
19
+                # passing code ref to examine prompt as simple string comparisson isn't good enough with su
20
                 def detect_su_prompt(data):
21
                     SU_PROMPT_LOCALIZATIONS_RE = re.compile("|".join(['(\w+\'s )?' + x + ' ?: ?' for x in SU_PROMPT_LOCALIZATIONS]), flags=re.IGNORECASE)
22
                     return bool(SU_PROMPT_LOCALIZATIONS_RE.match(data))
23
-
24
                 prompt = detect_su_prompt
25
-                becomecmd = '%s %s %s -c "%s -c %s"' % (exe, flags, self.become_user, executable, success_cmd)
26
+
27
+                su_success_cmd =  '%s -c %s' % (executable, success_cmd) # this is here cause su too succeptible to overquoting
28
+                becomecmd = '%s %s %s -c %s' % (exe, flags, self.become_user, su_success_cmd) #works with sh
29
 
30
             elif self.become_method == 'pbrun':
31
 

Return to bug 206591