archrelease: copy trunk to extra-x86_64
[arch-packages.git] / cyrus-sasl / trunk / gdbm-errno.patch
blobdd9147d9f532e7c26caa70ee0a7c459562aa7a82
1 From af48f6fec9a7b6374d4153c5db894d4a1f349645 Mon Sep 17 00:00:00 2001
2 From: Jonas Jelten <jj@sft.mx>
3 Date: Sat, 2 Feb 2019 20:53:37 +0100
4 Subject: [PATCH] db_gdbm: fix gdbm_errno overlay from gdbm_close
6 `gdbm_close` also sets gdbm_errno since version 1.17.
7 This leads to a problem in `libsasl` as the `gdbm_close` incovation overlays
8 the `gdbm_errno` value which is then later used for the error handling.
9 ---
10 sasldb/db_gdbm.c | 4 +++-
11 1 file changed, 3 insertions(+), 1 deletion(-)
13 diff --git a/sasldb/db_gdbm.c b/sasldb/db_gdbm.c
14 index ee56a6bf..c908808e 100644
15 --- a/sasldb/db_gdbm.c
16 +++ b/sasldb/db_gdbm.c
17 @@ -107,9 +107,11 @@ int _sasldb_getdata(const sasl_utils_t *utils,
18 gkey.dptr = key;
19 gkey.dsize = key_len;
20 gvalue = gdbm_fetch(db, gkey);
21 + int fetch_errno = gdbm_errno;
23 gdbm_close(db);
24 if (! gvalue.dptr) {
25 - if (gdbm_errno == GDBM_ITEM_NOT_FOUND) {
26 + if (fetch_errno == GDBM_ITEM_NOT_FOUND) {
27 utils->seterror(conn, SASL_NOLOG,
28 "user: %s@%s property: %s not found in %s",
29 authid, realm, propName, path);