View | Details | Raw Unified | Return to bug 207490
Collapse All | Expand All

(-)Makefile (-5 / +1 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	ansible
4
PORTNAME=	ansible
5
PORTVERSION?=	2.0.0.2
5
PORTVERSION?=	2.0.1.0
6
PORTREVISION?=	3
7
CATEGORIES=	sysutils python
6
CATEGORIES=	sysutils python
8
MASTER_SITES=	http://releases.ansible.com/ansible/
7
MASTER_SITES=	http://releases.ansible.com/ansible/
9
8
Lines 18-26 Link Here
18
		${PYTHON_PKGNAMEPREFIX}paramiko>0:${PORTSDIR}/security/py-paramiko \
17
		${PYTHON_PKGNAMEPREFIX}paramiko>0:${PORTSDIR}/security/py-paramiko \
19
		${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2
18
		${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2
20
19
21
EXTRA_PATCHES?=	${FILESDIR}/extra-patch-8647fdc \
22
		${FILESDIR}/extra-patch-6bf2f45
23
24
NO_ARCH=	yes
20
NO_ARCH=	yes
25
USES=		cpe python:2 shebangfix
21
USES=		cpe python:2 shebangfix
26
USE_PYTHON=	autoplist distutils
22
USE_PYTHON=	autoplist distutils
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (ansible-2.0.0.2.tar.gz) = 27db0b99113fab85b1430c361c7790a0aa7f5c614c9af13362e2adbba07e5828
1
SHA256 (ansible-2.0.1.0.tar.gz) = cddc4fa6af4c1be6cd1d6634de1bd0397abad921c76b32cab6722c042744ee5d
2
SIZE (ansible-2.0.0.2.tar.gz) = 1497944
2
SIZE (ansible-2.0.1.0.tar.gz) = 1510155
(-)files/extra-patch-6bf2f45 (-31 lines)
Lines 1-31 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
 
(-)files/extra-patch-8647fdc (-21 lines)
Lines 1-21 Link Here
1
--- lib/ansible/plugins/action/__init__.py.orig	2016-01-14 22:33:27 UTC
2
+++ lib/ansible/plugins/action/__init__.py
3
@@ -475,8 +475,7 @@ class ActionBase(with_metaclass(ABCMeta,
4
         display.debug("done with _execute_module (%s, %s)" % (module_name, module_args))
5
         return data
6
 
7
-    def _low_level_execute_command(self, cmd, sudoable=True, in_data=None,
8
-            executable=None, encoding_errors='replace'):
9
+    def _low_level_execute_command(self, cmd, sudoable=True, in_data=None, executable=C.DEFAULT_EXECUTABLE, encoding_errors='replace'):
10
         '''
11
         This is the function which executes the low level shell command, which
12
         may be commands to create/remove directories for temporary files, or to
13
@@ -492,7 +491,7 @@ class ActionBase(with_metaclass(ABCMeta,
14
         '''
15
 
16
         if executable is not None:
17
-            cmd = executable + ' -c ' + cmd
18
+            cmd = executable + ' -c ' + pipes.quote(cmd)
19
 
20
         display.debug("_low_level_execute_command(): starting")
21
         if not cmd:

Return to bug 207490