[exim-dev] [Bug 2884] dbmjz lookup in sasldb2 fails with 4.9…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: admin
Data:  
Para: exim-dev
Asunto: [exim-dev] [Bug 2884] dbmjz lookup in sasldb2 fails with 4.96RC0
https://bugs.exim.org/show_bug.cgi?id=2884

Git Commit <git@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |git@???


--- Comment #2 from Git Commit <git@???> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/225c84f0f35d3aea1f0845eedde7632c371e1f99

commit 225c84f0f35d3aea1f0845eedde7632c371e1f99
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu May 5 16:22:54 2022 +0100
Commit:     Jeremy Harris <jgh146exb@???>
CommitDate: Fri May 6 12:47:03 2022 +0100


    Fix dbmjz lookup.  Bug 2884


    Broken-by: 0cc804c877
---
 src/src/lookups/dbmdb.c        |   6 ++++--
 test/aux-fixed/2301.testsasldb | Bin 0 -> 12288 bytes
 test/confs/2301                |   4 ++++
 test/scripts/2300-DBM/2301     |   5 +++++
 test/stdout/2301               |   2 ++
 5 files changed, 15 insertions(+), 2 deletions(-)


diff --git a/src/src/lookups/dbmdb.c b/src/src/lookups/dbmdb.c
index edc49e5..32514af 100644
--- a/src/src/lookups/dbmdb.c
+++ b/src/src/lookups/dbmdb.c
@@ -94,8 +94,10 @@ EXIM_DATUM key, data;

 exim_datum_init(&key);               /* Some DBM libraries require datums to
*/
 exim_datum_init(&data);              /* be cleared before use. */
-exim_datum_data_set(&key, string_copyn(keystring, length));
-exim_datum_size_set(&key, length + 1);
+length++;
+exim_datum_data_set(&key,
+  memcpy(store_get(length, keystring), keystring, length)); /* key can have
embedded NUL */
+exim_datum_size_set(&key, length);


if (exim_dbget(d, &key, &data))
{
diff --git a/test/aux-fixed/2301.testsasldb b/test/aux-fixed/2301.testsasldb
new file mode 100644
index 0000000..50a0596
Binary files /dev/null and b/test/aux-fixed/2301.testsasldb differ
diff --git a/test/confs/2301 b/test/confs/2301
new file mode 100644
index 0000000..3e88df7
--- /dev/null
+++ b/test/confs/2301
@@ -0,0 +1,4 @@
+# Exim test configuration 2301
+.include DIR/aux-var/std_conf_prefix
+primary_hostname = myhost.test.ex
+# End
diff --git a/test/scripts/2300-DBM/2301 b/test/scripts/2300-DBM/2301
new file mode 100644
index 0000000..9ba0c50
--- /dev/null
+++ b/test/scripts/2300-DBM/2301
@@ -0,0 +1,5 @@
+# lookup dbmjz
+#
+exim -be
+${lookup{testid:test.example.invalid:userPassword}dbmjz{DIR/aux-fixed/TESTNUM.testsasldb}{$value}fail}
+****
diff --git a/test/stdout/2301 b/test/stdout/2301
new file mode 100644
index 0000000..ca59bf0
--- /dev/null
+++ b/test/stdout/2301
@@ -0,0 +1,2 @@
+> testpw
+>

--
You are receiving this mail because:
You are on the CC list for the bug.