Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
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
pyfs
Commits
b6c21954
Commit
b6c21954
authored
Dec 19, 2010
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sftpfs authentication tweaks
parent
c5d09ac3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
fs/sftpfs.py
+15
-8
No files found.
fs/sftpfs.py
View file @
b6c21954
...
@@ -133,7 +133,7 @@ class SFTPFS(FS):
...
@@ -133,7 +133,7 @@ class SFTPFS(FS):
connection
.
start_client
()
connection
.
start_client
()
if
not
connection
.
is_active
():
if
not
connection
.
is_active
():
raise
RemoteConnectionError
(
'Unable to connect'
)
raise
RemoteConnectionError
(
msg
=
'Unable to connect'
)
if
no_auth
:
if
no_auth
:
try
:
try
:
...
@@ -141,27 +141,34 @@ class SFTPFS(FS):
...
@@ -141,27 +141,34 @@ class SFTPFS(FS):
except
paramiko
.
SSHException
:
except
paramiko
.
SSHException
:
pass
pass
if
not
connection
.
is_authenticated
():
if
not
connection
.
is_authenticated
():
if
not
username
:
username
=
getuser
()
try
:
try
:
if
pkey
:
if
pkey
:
connection
.
auth_publickey
(
username
,
pkey
)
connection
.
auth_publickey
(
username
,
pkey
)
if
not
connection
.
is_authenticated
()
and
password
:
if
not
connection
.
is_authenticated
()
and
password
:
connection
.
auth_password
(
username
,
password
)
connection
.
auth_password
(
username
,
password
)
if
agent_auth
and
not
connection
.
is_authenticated
():
if
agent_auth
and
not
connection
.
is_authenticated
():
self
.
_agent_auth
(
connection
,
username
)
self
.
_agent_auth
(
connection
,
username
)
if
not
connection
.
is_authenticated
():
if
not
connection
.
is_authenticated
():
connection
.
auth_none
(
''
)
try
:
connection
.
auth_none
(
username
)
except
paramiko
.
BadAuthenticationType
,
e
:
connection
.
close
()
allowed
=
', '
.
join
(
e
.
allowed_types
)
raise
RemoteConnectionError
(
msg
=
'no auth - server requires one of the following:
%
s'
%
allowed
,
details
=
e
)
if
not
connection
.
is_authenticated
():
if
not
connection
.
is_authenticated
():
connection
.
close
()
connection
.
close
()
raise
RemoteConnectionError
(
'no auth'
)
raise
RemoteConnectionError
(
msg
=
'no auth'
)
except
paramiko
.
SSHException
,
e
:
except
paramiko
.
SSHException
,
e
:
connection
.
close
()
connection
.
close
()
raise
RemoteConnectionError
(
'SSH exception (
%
s)'
%
str
(
e
),
details
=
e
)
raise
RemoteConnectionError
(
msg
=
'SSH exception (
%
s)'
%
str
(
e
),
details
=
e
)
self
.
_transport
=
connection
self
.
_transport
=
connection
...
...
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