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
03d150de
Commit
03d150de
authored
Aug 08, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8020 from msabramo/error_when_private_key_file_permissions_incorrect
Error if private_key_file is group/world readable
parents
8c4161d4
5b783e0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lib/ansible/runner/connection.py
+10
-0
No files found.
lib/ansible/runner/connection.py
View file @
03d150de
...
...
@@ -18,6 +18,9 @@
################################################
import
os
import
stat
from
ansible
import
utils
from
ansible.errors
import
AnsibleError
...
...
@@ -31,5 +34,12 @@ class Connector(object):
conn
=
utils
.
plugins
.
connection_loader
.
get
(
transport
,
self
.
runner
,
host
,
port
,
user
=
user
,
password
=
password
,
private_key_file
=
private_key_file
)
if
conn
is
None
:
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
if
private_key_file
:
# If private key is readable by user other than owner, flag an error
st
=
os
.
stat
(
private_key_file
)
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 - "
"you will probably get an SSH failure"
%
(
private_key_file
,))
self
.
active
=
conn
.
connect
()
return
self
.
active
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