Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e0b07400
Commit
e0b07400
authored
Aug 11, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11764 from lpirl/devel_v2
fixes remote code execution for su/sudo with strict remote umasks
parents
38eb53de
d9aa14fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
lib/ansible/plugins/action/__init__.py
+1
-1
lib/ansible/plugins/shell/sh.py
+7
-2
No files found.
lib/ansible/plugins/action/__init__.py
View file @
e0b07400
...
...
@@ -164,7 +164,7 @@ class ActionBase:
tmp_mode
=
None
if
self
.
_play_context
.
remote_user
!=
'root'
or
self
.
_play_context
.
become
and
self
.
_play_context
.
become_user
!=
'root'
:
tmp_mode
=
'a+rx'
tmp_mode
=
0755
cmd
=
self
.
_connection
.
_shell
.
mkdtemp
(
basefile
,
use_system_tmp
,
tmp_mode
)
self
.
_display
.
debug
(
"executing _low_level_execute_command to create the tmp path"
)
...
...
lib/ansible/plugins/shell/sh.py
View file @
e0b07400
...
...
@@ -65,9 +65,14 @@ class ShellModule(object):
if
system
and
(
basetmp
.
startswith
(
'$HOME'
)
or
basetmp
.
startswith
(
'~/'
)):
basetmp
=
self
.
join_path
(
'/tmp'
,
basefile
)
cmd
=
'mkdir -p "
%
s"'
%
basetmp
if
mode
:
cmd
+=
' && chmod
%
s "
%
s"'
%
(
mode
,
basetmp
)
cmd
+=
' && echo "
%
s"'
%
basetmp
# change the umask in a subshell to achieve the desired mode
# also for directories created with `mkdir -p`
if
mode
:
tmp_umask
=
0777
&
~
mode
cmd
=
'(umask
%
o &&
%
s)'
%
(
tmp_umask
,
cmd
)
return
cmd
def
expand_user
(
self
,
user_home_path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment