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
a2ba0c03
Commit
a2ba0c03
authored
Nov 06, 2014
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added error handling on private key stat in case it is saved in agent
but not in filesystem
parent
394ebe79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
lib/ansible/runner/connection.py
+8
-1
No files found.
lib/ansible/runner/connection.py
View file @
a2ba0c03
...
@@ -36,7 +36,14 @@ class Connector(object):
...
@@ -36,7 +36,14 @@ class Connector(object):
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
if
private_key_file
:
if
private_key_file
:
# If private key is readable by user other than owner, flag an error
# If private key is readable by user other than owner, flag an error
st
=
os
.
stat
(
private_key_file
)
try
:
st
=
os
.
stat
(
private_key_file
)
except
IOError
,
e
:
if
e
.
errno
==
errno
.
ENOENT
:
# file is missing, might be agent
st
=
{
'st_mode'
:
False
}
else
:
raise
(
e
)
if
st
.
st_mode
&
(
stat
.
S_IRGRP
|
stat
.
S_IROTH
):
if
st
.
st_mode
&
(
stat
.
S_IRGRP
|
stat
.
S_IROTH
):
raise
AnsibleError
(
"private_key_file (
%
s) is group-readable or world-readable and thus insecure - "
raise
AnsibleError
(
"private_key_file (
%
s) is group-readable or world-readable and thus insecure - "
"you will probably get an SSH failure"
"you will probably get an SSH failure"
...
...
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