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
b9385543
Commit
b9385543
authored
Nov 25, 2013
by
James Tanner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5032 escape and safely split key options in authorized_keys module
parent
d1870663
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
library/system/authorized_key
+10
-2
No files found.
library/system/authorized_key
View file @
b9385543
...
...
@@ -177,7 +177,14 @@ def parseoptions(options):
'''
options_dict
=
{}
if
options
:
options_list
=
options
.
strip
()
.
split
(
","
)
lex
=
shlex
.
shlex
(
options
)
lex
.
quotes
=
[
"'"
,
'"'
]
lex
.
whitespace_split
=
True
opt_parts
=
list
(
lex
)
open
(
"/tmp/awx.log"
,
"a"
)
.
write
(
"opt_parts:
%
s
\n
"
%
opt_parts
)
#options_list = options.strip().split(",")
options_list
=
opt_parts
for
option
in
options_list
:
# happen when there is comma at the end
if
option
==
''
:
...
...
@@ -187,7 +194,8 @@ def parseoptions(options):
else
:
arg
=
option
val
=
None
options_dict
[
arg
]
=
val
options_dict
[
arg
]
=
val
.
replace
(
'"'
,
''
)
.
replace
(
"'"
,
""
)
open
(
"/tmp/awx.log"
,
"a"
)
.
write
(
"options_dict:
%
s
\n
"
%
options_dict
)
return
options_dict
def
parsekey
(
raw_key
):
...
...
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