summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2018-02-20 14:28:23 +0100
committerSebastian Pipping <sping@gentoo.org>2018-02-20 14:28:27 +0100
commit21826684ea951274c2d63efc89b2b28f9d6395bc (patch)
tree11abcc0bdbbd1e1a101952858271790f47491af3 /app-crypt
parentapp-crypt/josepy: Revert addition, use dev-python/josepy (diff)
downloadbetagarden-21826684ea951274c2d63efc89b2b28f9d6395bc.tar.gz
betagarden-21826684ea951274c2d63efc89b2b28f9d6395bc.tar.bz2
betagarden-21826684ea951274c2d63efc89b2b28f9d6395bc.zip
app-crypt/wile: 1.0.0-r1 with webroot fixed
Related issue: https://github.com/costela/wile/issues/32
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/wile/files/wile-1.0.0-fix-webroot.patch39
-rw-r--r--app-crypt/wile/wile-1.0.0-r1.ebuild (renamed from app-crypt/wile/wile-1.0.0.ebuild)5
2 files changed, 43 insertions, 1 deletions
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 <sebastian@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
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
+)