From ddd41714ba739d7ef77ef4b2cb5c0bfeb5386cf3 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Tue, 6 Apr 2021 22:47:08 +0000
Subject: net-misc/sks: add upstream patch for DB hang

Bug: https://bugs.gentoo.org/780141
Signed-off-by: Sam James <sam@gentoo.org>
---
 .../sks/files/sks-1.1.6_p20200624-r1-db-hang.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch

(limited to 'net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch')

diff --git a/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch b/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch
new file mode 100644
index 000000000000..a09d55c1bb89
--- /dev/null
+++ b/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/780141
+https://github.com/SKS-Keyserver/sks-keyserver/commit/c3ba6d5abb525dcb84745245631c410c11c07ec1.patch
+
+From c3ba6d5abb525dcb84745245631c410c11c07ec1 Mon Sep 17 00:00:00 2001
+From: ygrek <ygrek@autistici.org>
+Date: Thu, 4 Feb 2021 15:31:02 -0500
+Subject: [PATCH] do not set DB_DBT_READONLY (fix #82)
+
+it is allowed only on keys, but sks is not using any bdb functions that
+might mutate keys, so it is easier to just avoid using it altogether
+---
+ bdb/bdb_stubs.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/bdb/bdb_stubs.c b/bdb/bdb_stubs.c
+index 864f0b2..959ee27 100644
+--- a/bdb/bdb_stubs.c
++++ b/bdb/bdb_stubs.c
+@@ -58,13 +58,8 @@ static void dbt_from_string(DBT *dbt, value v) {
+   // uninitialized stack-allocated DBT
+   zerob(dbt, sizeof(*dbt));
+ 
+-  // Cast away the lack of const: we set DB_DBT_READONLY to
+-  // indicate to bdb that it shouldn't modify this buffer
+   dbt->data = (void *)String_val(v);
+   dbt->size = string_length(v);
+-#ifdef DB_DBT_READONLY
+-  dbt->flags = DB_DBT_READONLY;
+-#endif
+ }
+ 
+ #if OCAML_VERSION < 40600
-- 
cgit v1.2.3-65-gdbad