commit:     21826684ea951274c2d63efc89b2b28f9d6395bc
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 20 13:28:23 2018 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Tue Feb 20 13:28:27 2018 +0000
URL:        https://gitweb.gentoo.org/proj/betagarden.git/commit/?id=21826684

app-crypt/wile: 1.0.0-r1 with webroot fixed

Related issue:
https://github.com/costela/wile/issues/32

 app-crypt/wile/files/wile-1.0.0-fix-webroot.patch  | 39 ++++++++++++++++++++++
 .../{wile-1.0.0.ebuild => wile-1.0.0-r1.ebuild}    |  5 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)

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
new file mode 100644
index 0000000..39c9d30
--- /dev/null
+++ b/app-crypt/wile/files/wile-1.0.0-fix-webroot.patch
@@ -0,0 +1,39 @@
+From f6d355f14363ed3ce6bf44d4d9ab3140bc0ec247 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebast...@pipping.org>
+Date: Mon, 19 Feb 2018 20:21:24 +0100
+Subject: [PATCH] Fix storing of webroot validation for local folders (issue
+ #32)
+
+Function os.open was used with the signature of __builtin__.open.
+So string mode "wb" ended up as the flags parameter to os.open,
+resulting in "TypeError: an integer is required".
+---
+ wile/cert.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/wile/cert.py b/wile/cert.py
+index c9fc33b..f8b85aa 100644
+--- a/wile/cert.py
++++ b/wile/cert.py
+@@ -262,6 +262,7 @@ def _store_webroot_validation(ctx, webroot, 
ssh_private_key, challb, val):
+                 raise
+ 
+         chall_mod = os
++        chall_open = open
+     else:
+         sftp = sftp_helper.cachedSFTPfactory(user=webroot.remote_user, 
host=webroot.remote_host,
+                                              port=webroot.remote_port, 
private_key=ssh_private_key)
+@@ -269,8 +270,9 @@ def _store_webroot_validation(ctx, webroot, 
ssh_private_key, challb, val):
+         sftp.makedirs(os.path.join(webroot.path, challb.URI_ROOT_PATH))
+ 
+         chall_mod = sftp
++        chall_open = chall_mod.open
+ 
+-    with chall_mod.open(chall_path, 'wb') as outf:
++    with chall_open(chall_path, 'wb') as outf:
+         logger.info('storing validation to %s', os.path.basename(chall_path))
+         outf.write(b(val))
+         # TODO: this may cause a race-condition with paramiko teardown code.
+-- 
+2.16.1
+

diff --git a/app-crypt/wile/wile-1.0.0.ebuild 
b/app-crypt/wile/wile-1.0.0-r1.ebuild
similarity index 90%
rename from app-crypt/wile/wile-1.0.0.ebuild
rename to app-crypt/wile/wile-1.0.0-r1.ebuild
index b579a01..aabfe2c 100644
--- a/app-crypt/wile/wile-1.0.0.ebuild
+++ b/app-crypt/wile/wile-1.0.0-r1.ebuild
@@ -30,4 +30,7 @@ RDEPEND="
 
 DOCS=( README.md )
 
-PATCHES=( "${FILESDIR}"/${P}-josepy.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-josepy.patch
+       "${FILESDIR}"/${P}-fix-webroot.patch
+)

Reply via email to