git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tidying
[exim.git]
/
src
/
src
/
lookups
/
dbmdb.c
diff --git
a/src/src/lookups/dbmdb.c
b/src/src/lookups/dbmdb.c
index b8c42d59665f1ea77e718a962b5bdeda3404a847..5e97009ccae4c3d6a42aa7e32bb07d4a8b3da586 100644
(file)
--- a/
src/src/lookups/dbmdb.c
+++ b/
src/src/lookups/dbmdb.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
5
*/
+/* Copyright (c) University of Cambridge 1995 - 201
8
*/
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
@@
-18,8
+18,12
@@
static void *
dbmdb_open(uschar *filename, uschar **errmsg)
{
static void *
dbmdb_open(uschar *filename, uschar **errmsg)
{
+uschar * dirname = string_copy(filename);
+uschar * s;
EXIM_DB *yield = NULL;
EXIM_DB *yield = NULL;
-EXIM_DBOPEN(filename, O_RDONLY, 0, &yield);
+
+if ((s = Ustrrchr(dirname, '/'))) *s = '\0';
+EXIM_DBOPEN(filename, dirname, O_RDONLY, 0, &yield);
if (yield == NULL)
{
int save_errno = errno;
if (yield == NULL)
{
int save_errno = errno;
@@
-150,7
+154,7
@@
int buflen, bufleft, key_item_len, sep = 0;
or less than, the length of the delimited list passed in + 1. */
buflen = length + 3;
or less than, the length of the delimited list passed in + 1. */
buflen = length + 3;
-key_buffer = store_get(buflen);
+key_buffer = store_get(buflen
, is_tainted(keystring)
);
key_buffer[0] = '\0';
key_buffer[0] = '\0';
@@
-195,7
+199,7
@@
if (key_p == key_buffer)
empty element to put one in. Boundary: key length 1, is a NULL */
key_item_len = key_p - key_buffer - 1;
empty element to put one in. Boundary: key length 1, is a NULL */
key_item_len = key_p - key_buffer - 1;
-DEBUG(D_lookup) debug_printf("NUL-joined key length: %d\n", key_item_len);
+DEBUG(D_lookup) debug_printf
_indent
("NUL-joined key length: %d\n", key_item_len);
/* beware that dbmdb_find() adds 1 to length to get back terminating NUL, so
because we've calculated the real length, we need to subtract one more here */
/* beware that dbmdb_find() adds 1 to length to get back terminating NUL, so
because we've calculated the real length, we need to subtract one more here */