Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/betagarden:master commit in: app-crypt/wile/files/, app-crypt/wile/
Date: Tue, 20 Feb 2018 13:30:15
Message-Id: 1519133307.21826684ea951274c2d63efc89b2b28f9d6395bc.sping@gentoo
1 commit: 21826684ea951274c2d63efc89b2b28f9d6395bc
2 Author: Sebastian Pipping <sping <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 20 13:28:23 2018 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 20 13:28:27 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/betagarden.git/commit/?id=21826684
7
8 app-crypt/wile: 1.0.0-r1 with webroot fixed
9
10 Related issue:
11 https://github.com/costela/wile/issues/32
12
13 app-crypt/wile/files/wile-1.0.0-fix-webroot.patch | 39 ++++++++++++++++++++++
14 .../{wile-1.0.0.ebuild => wile-1.0.0-r1.ebuild} | 5 ++-
15 2 files changed, 43 insertions(+), 1 deletion(-)
16
17 diff --git a/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch b/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch
18 new file mode 100644
19 index 0000000..39c9d30
20 --- /dev/null
21 +++ b/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch
22 @@ -0,0 +1,39 @@
23 +From f6d355f14363ed3ce6bf44d4d9ab3140bc0ec247 Mon Sep 17 00:00:00 2001
24 +From: Sebastian Pipping <sebastian@×××××××.org>
25 +Date: Mon, 19 Feb 2018 20:21:24 +0100
26 +Subject: [PATCH] Fix storing of webroot validation for local folders (issue
27 + #32)
28 +
29 +Function os.open was used with the signature of __builtin__.open.
30 +So string mode "wb" ended up as the flags parameter to os.open,
31 +resulting in "TypeError: an integer is required".
32 +---
33 + wile/cert.py | 4 +++-
34 + 1 file changed, 3 insertions(+), 1 deletion(-)
35 +
36 +diff --git a/wile/cert.py b/wile/cert.py
37 +index c9fc33b..f8b85aa 100644
38 +--- a/wile/cert.py
39 ++++ b/wile/cert.py
40 +@@ -262,6 +262,7 @@ def _store_webroot_validation(ctx, webroot, ssh_private_key, challb, val):
41 + raise
42 +
43 + chall_mod = os
44 ++ chall_open = open
45 + else:
46 + sftp = sftp_helper.cachedSFTPfactory(user=webroot.remote_user, host=webroot.remote_host,
47 + port=webroot.remote_port, private_key=ssh_private_key)
48 +@@ -269,8 +270,9 @@ def _store_webroot_validation(ctx, webroot, ssh_private_key, challb, val):
49 + sftp.makedirs(os.path.join(webroot.path, challb.URI_ROOT_PATH))
50 +
51 + chall_mod = sftp
52 ++ chall_open = chall_mod.open
53 +
54 +- with chall_mod.open(chall_path, 'wb') as outf:
55 ++ with chall_open(chall_path, 'wb') as outf:
56 + logger.info('storing validation to %s', os.path.basename(chall_path))
57 + outf.write(b(val))
58 + # TODO: this may cause a race-condition with paramiko teardown code.
59 +--
60 +2.16.1
61 +
62
63 diff --git a/app-crypt/wile/wile-1.0.0.ebuild b/app-crypt/wile/wile-1.0.0-r1.ebuild
64 similarity index 90%
65 rename from app-crypt/wile/wile-1.0.0.ebuild
66 rename to app-crypt/wile/wile-1.0.0-r1.ebuild
67 index b579a01..aabfe2c 100644
68 --- a/app-crypt/wile/wile-1.0.0.ebuild
69 +++ b/app-crypt/wile/wile-1.0.0-r1.ebuild
70 @@ -30,4 +30,7 @@ RDEPEND="
71
72 DOCS=( README.md )
73
74 -PATCHES=( "${FILESDIR}"/${P}-josepy.patch )
75 +PATCHES=(
76 + "${FILESDIR}"/${P}-josepy.patch
77 + "${FILESDIR}"/${P}-fix-webroot.patch
78 +)