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
f8845af1
Commit
f8845af1
authored
Aug 05, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add path checking for relative/escaped tar filenames in the ansible-galaxy command
parent
a45c3b84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
bin/ansible-galaxy
+10
-2
No files found.
bin/ansible-galaxy
View file @
f8845af1
...
...
@@ -445,6 +445,7 @@ def install_role(role_name, role_version, role_filename, options):
# verify the role's meta file
meta_file
=
None
members
=
role_tar_file
.
getmembers
()
# next find the metadata file
for
member
in
members
:
if
"/meta/main.yml"
in
member
.
name
:
meta_file
=
member
...
...
@@ -484,9 +485,16 @@ def install_role(role_name, role_version, role_filename, options):
# now we do the actual extraction to the role_path
for
member
in
members
:
# we only extract files
# we only extract files, and remove any relative path
# bits that might be in the file for security purposes
# and drop the leading directory, as mentioned above
if
member
.
isreg
():
member
.
name
=
"/"
.
join
(
member
.
name
.
split
(
"/"
)[
1
:])
parts
=
member
.
name
.
split
(
"/"
)[
1
:]
final_parts
=
[]
for
part
in
parts
:
if
part
!=
'..'
and
'~'
not
in
part
and
'$'
not
in
part
:
final_parts
.
append
(
part
)
member
.
name
=
os
.
path
.
join
(
*
final_parts
)
role_tar_file
.
extract
(
member
,
role_path
)
# write out the install info file for later use
...
...
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