1 |
commit: 28e7e2b6ccd187aa7850b3a9201b6d8b43898905 |
2 |
Author: Virgil Dupras <vdupras <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 26 13:56:25 2018 +0000 |
4 |
Commit: Virgil Dupras <vdupras <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 26 14:00:47 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28e7e2b6 |
7 |
|
8 |
dev-python/paramiko: bump to 2.4.2 |
9 |
|
10 |
Also, disable the server feature by default for security reasons. It can |
11 |
be re-enabled with the 'server' USE flag, which is going to be |
12 |
hard-masked. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/666619 |
15 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
16 |
Signed-off-by: Virgil Dupras <vdupras <AT> gentoo.org> |
17 |
|
18 |
dev-python/paramiko/Manifest | 1 + |
19 |
.../files/paramiko-2.4.2-disable-server.patch | 46 ++++++++++++++++ |
20 |
dev-python/paramiko/metadata.xml | 3 ++ |
21 |
dev-python/paramiko/paramiko-2.4.2.ebuild | 62 ++++++++++++++++++++++ |
22 |
4 files changed, 112 insertions(+) |
23 |
|
24 |
diff --git a/dev-python/paramiko/Manifest b/dev-python/paramiko/Manifest |
25 |
index d90724711be..25fa5b44f4a 100644 |
26 |
--- a/dev-python/paramiko/Manifest |
27 |
+++ b/dev-python/paramiko/Manifest |
28 |
@@ -1,2 +1,3 @@ |
29 |
DIST paramiko-2.1.2.tar.gz 1196746 BLAKE2B c184e171fe550fc231d67473867db283b706a93aebbd13ffb2503e10d69e43b9ab712237e6698fccae13472f0cb8135b6c015381ac687c4c20d4d1cb1620ae00 SHA512 465c5381b1b0a472d2ad8e690f0916a5f51713880486c7b94cadcf85ea0a52569e18337ccfee5440869e4a0c76bd2b1bc15c414128c07326b40ecd36ea021466 |
30 |
DIST paramiko-2.4.1.tar.gz 285151 BLAKE2B 767c4ad11da77c5c6796165057715f318cab417c5bae72cd97b51af94ecbf233316fd4286e35b2f855027e05bcf195c869b45a87f66954bee3bb98ae9d0ef1a9 SHA512 5a580d25e7911937f228ef4a2b89b5a1efd771f576c6c68cf1c36e1abbc38adbc6ad5dc91400de7112238fcf7803f5f26c13fe10be4af8a2a86af9398da7a8de |
31 |
+DIST paramiko-2.4.2.tar.gz 289126 BLAKE2B 767f81a09b32762241eed6661e520e3b3a96acfe8e6e638ea7ae180a8b6866f8f4adeae0a0146d46ecbfccbe71334c5f5c14e2d049744258ca4808ac21365185 SHA512 894c2ebfcfb35a84fe74670d0eb67022a49b7bf165f31acd929045c17509d8a2be111e8319f20513b5034efd033edc6432b2ca2e7027dc7e3c6703166a96790f |
32 |
|
33 |
diff --git a/dev-python/paramiko/files/paramiko-2.4.2-disable-server.patch b/dev-python/paramiko/files/paramiko-2.4.2-disable-server.patch |
34 |
new file mode 100644 |
35 |
index 00000000000..19450cbee1b |
36 |
--- /dev/null |
37 |
+++ b/dev-python/paramiko/files/paramiko-2.4.2-disable-server.patch |
38 |
@@ -0,0 +1,46 @@ |
39 |
+diff --git a/paramiko/transport.py b/paramiko/transport.py |
40 |
+index f72eebaf..ec7a1445 100644 |
41 |
+--- a/paramiko/transport.py |
42 |
++++ b/paramiko/transport.py |
43 |
+@@ -110,6 +110,8 @@ from paramiko.ssh_exception import ( |
44 |
+ from paramiko.util import retry_on_signal, ClosingContextManager, clamp_value |
45 |
+ |
46 |
+ |
47 |
++SERVER_DISABLED_BY_GENTOO = True |
48 |
++ |
49 |
+ # for thread cleanup |
50 |
+ _active_threads = [] |
51 |
+ |
52 |
+@@ -633,6 +635,8 @@ class Transport(threading.Thread, ClosingContextManager): |
53 |
+ `.SSHException` -- if negotiation fails (and no ``event`` was |
54 |
+ passed in) |
55 |
+ """ |
56 |
++ if SERVER_DISABLED_BY_GENTOO: |
57 |
++ raise Exception("Disabled by Gentoo for security reasons. Enable with 'server' USE flag") |
58 |
+ if server is None: |
59 |
+ server = ServerInterface() |
60 |
+ self.server_mode = True |
61 |
+diff --git a/tests/conftest.py b/tests/conftest.py |
62 |
+index 2b509c5c..bb23ac74 100644 |
63 |
+--- a/tests/conftest.py |
64 |
++++ b/tests/conftest.py |
65 |
+@@ -4,7 +4,7 @@ import shutil |
66 |
+ import threading |
67 |
+ |
68 |
+ import pytest |
69 |
+-from paramiko import RSAKey, SFTPServer, SFTP, Transport |
70 |
++from paramiko import RSAKey, SFTPServer, SFTP, Transport, transport |
71 |
+ |
72 |
+ from .loop import LoopSocket |
73 |
+ from .stub_sftp import StubServer, StubSFTPServer |
74 |
+@@ -15,6 +15,10 @@ from .util import _support |
75 |
+ # 'nicer'. |
76 |
+ |
77 |
+ |
78 |
++# We need the server component for testing |
79 |
++transport.SERVER_DISABLED_BY_GENTOO = False |
80 |
++ |
81 |
++ |
82 |
+ # Perform logging by default; pytest will capture and thus hide it normally, |
83 |
+ # presenting it on error/failure. (But also allow turning it off when doing |
84 |
+ # very pinpoint debugging - e.g. using breakpoints, so you don't want output |
85 |
|
86 |
diff --git a/dev-python/paramiko/metadata.xml b/dev-python/paramiko/metadata.xml |
87 |
index 054a7be7a59..3624b844268 100644 |
88 |
--- a/dev-python/paramiko/metadata.xml |
89 |
+++ b/dev-python/paramiko/metadata.xml |
90 |
@@ -21,6 +21,9 @@ are supported. SFTP client mode is now supported too. |
91 |
用している所です。有名なCipherとHash処理の全てがサポートされています。SFTPクライ |
92 |
アントもサポートされています。 |
93 |
</longdescription> |
94 |
+ <use> |
95 |
+ <flag name="server">Enable server feature</flag> |
96 |
+ </use> |
97 |
<upstream> |
98 |
<remote-id type="pypi">paramiko</remote-id> |
99 |
<remote-id type="github">paramiko/paramiko</remote-id> |
100 |
|
101 |
diff --git a/dev-python/paramiko/paramiko-2.4.2.ebuild b/dev-python/paramiko/paramiko-2.4.2.ebuild |
102 |
new file mode 100644 |
103 |
index 00000000000..fb8e47b707d |
104 |
--- /dev/null |
105 |
+++ b/dev-python/paramiko/paramiko-2.4.2.ebuild |
106 |
@@ -0,0 +1,62 @@ |
107 |
+# Copyright 1999-2018 Gentoo Authors |
108 |
+# Distributed under the terms of the GNU General Public License v2 |
109 |
+ |
110 |
+EAPI=7 |
111 |
+ |
112 |
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
113 |
+PYTHON_REQ_USE="threads(+)" |
114 |
+ |
115 |
+inherit distutils-r1 |
116 |
+ |
117 |
+DESCRIPTION="SSH2 protocol library" |
118 |
+HOMEPAGE="http://www.paramiko.org/ https://github.com/paramiko/paramiko/ https://pypi.org/project/paramiko/" |
119 |
+# pypi tarballs are missing test data |
120 |
+#SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
121 |
+SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
122 |
+ |
123 |
+LICENSE="LGPL-2.1" |
124 |
+SLOT="0" |
125 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris" |
126 |
+IUSE="doc examples server test" |
127 |
+ |
128 |
+RDEPEND=" |
129 |
+ >=dev-python/bcrypt-3.1.3[${PYTHON_USEDEP}] |
130 |
+ >=dev-python/cryptography-1.5[${PYTHON_USEDEP}] |
131 |
+ >=dev-python/pynacl-1.0.1[${PYTHON_USEDEP}] |
132 |
+ >=dev-python/pyasn1-0.1.7[${PYTHON_USEDEP}] |
133 |
+" |
134 |
+BDEPEND=" |
135 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
136 |
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) |
137 |
+ test? ( |
138 |
+ dev-python/mock[${PYTHON_USEDEP}] |
139 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
140 |
+ dev-python/pytest-relaxed[${PYTHON_USEDEP}] |
141 |
+ ) |
142 |
+" |
143 |
+ |
144 |
+src_prepare() { |
145 |
+ if ! use server; then |
146 |
+ eapply "${FILESDIR}/${PN}-2.4.2-disable-server.patch" |
147 |
+ fi |
148 |
+ eapply_user |
149 |
+} |
150 |
+ |
151 |
+python_test() { |
152 |
+ py.test -v || die "Tests fail with ${EPYTHON}" |
153 |
+} |
154 |
+ |
155 |
+python_compile_all() { |
156 |
+ use doc && esetup.py build_sphinx -s sites/docs |
157 |
+} |
158 |
+ |
159 |
+python_install_all() { |
160 |
+ use doc && local HTML_DOCS=( "${BUILD_DIR}"/sphinx/html/. ) |
161 |
+ |
162 |
+ distutils-r1_python_install_all |
163 |
+ |
164 |
+ if use examples; then |
165 |
+ insinto /usr/share/doc/${PF}/examples |
166 |
+ doins demos/* |
167 |
+ fi |
168 |
+} |