mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-31 10:58:21 -07:00
dev-python/paramiko: bump to 2.4.2
Also, disable the server feature by default for security reasons. It can be re-enabled with the 'server' USE flag, which is going to be hard-masked. Bug: https://bugs.gentoo.org/666619 Package-Manager: Portage-2.3.50, Repoman-2.3.11 Signed-off-by: Virgil Dupras <vdupras@gentoo.org>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
diff --git a/paramiko/transport.py b/paramiko/transport.py
|
||||
index f72eebaf..ec7a1445 100644
|
||||
--- a/paramiko/transport.py
|
||||
+++ b/paramiko/transport.py
|
||||
@@ -110,6 +110,8 @@ from paramiko.ssh_exception import (
|
||||
from paramiko.util import retry_on_signal, ClosingContextManager, clamp_value
|
||||
|
||||
|
||||
+SERVER_DISABLED_BY_GENTOO = True
|
||||
+
|
||||
# for thread cleanup
|
||||
_active_threads = []
|
||||
|
||||
@@ -633,6 +635,8 @@ class Transport(threading.Thread, ClosingContextManager):
|
||||
`.SSHException` -- if negotiation fails (and no ``event`` was
|
||||
passed in)
|
||||
"""
|
||||
+ if SERVER_DISABLED_BY_GENTOO:
|
||||
+ raise Exception("Disabled by Gentoo for security reasons. Enable with 'server' USE flag")
|
||||
if server is None:
|
||||
server = ServerInterface()
|
||||
self.server_mode = True
|
||||
diff --git a/tests/conftest.py b/tests/conftest.py
|
||||
index 2b509c5c..bb23ac74 100644
|
||||
--- a/tests/conftest.py
|
||||
+++ b/tests/conftest.py
|
||||
@@ -4,7 +4,7 @@ import shutil
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
-from paramiko import RSAKey, SFTPServer, SFTP, Transport
|
||||
+from paramiko import RSAKey, SFTPServer, SFTP, Transport, transport
|
||||
|
||||
from .loop import LoopSocket
|
||||
from .stub_sftp import StubServer, StubSFTPServer
|
||||
@@ -15,6 +15,10 @@ from .util import _support
|
||||
# 'nicer'.
|
||||
|
||||
|
||||
+# We need the server component for testing
|
||||
+transport.SERVER_DISABLED_BY_GENTOO = False
|
||||
+
|
||||
+
|
||||
# Perform logging by default; pytest will capture and thus hide it normally,
|
||||
# presenting it on error/failure. (But also allow turning it off when doing
|
||||
# very pinpoint debugging - e.g. using breakpoints, so you don't want output
|
||||
Reference in New Issue
Block a user