X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/81344b40e3de597f60758926e5e1ae7a81dd5457..d4c9963ace2b653f657c74abecfecb7546c722b1:/src/src/dbstuff.h diff --git a/src/src/dbstuff.h b/src/src/dbstuff.h index bf5fa3f6e..5a8441d6a 100644 --- a/src/src/dbstuff.h +++ b/src/src/dbstuff.h @@ -3,6 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ /* This header file contains macro definitions so that a variety of DBM @@ -435,9 +436,8 @@ before been able to pass successfully. */ #define EXIM_DBSCAN(db, key, data, first, cursor) \ ((db)->seq(db, &key, &data, (first? R_FIRST : R_NEXT)) == 0) -/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). Make it -refer to cursor, to keep picky compilers happy. */ -#define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } +/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). */ +#define EXIM_DBDELETE_CURSOR(cursor) { } /* EXIM_DBCLOSE */ #define EXIM_DBCLOSE__(db) (db)->close(db) @@ -523,9 +523,8 @@ typedef struct { (((db)->lkey.dptr != NULL)? (free((db)->lkey.dptr),1) : 1),\ db->lkey = key, key.dptr != NULL) -/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). Make it -refer to cursor, to keep picky compilers happy. */ -#define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } +/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). */ +#define EXIM_DBDELETE_CURSOR(cursor) { } /* EXIM_DBCLOSE */ #define EXIM_DBCLOSE__(db) \ @@ -601,9 +600,8 @@ interface */ #define EXIM_DBSCAN(db, key, data, first, cursor) \ (key = (first? dbm_firstkey(db) : dbm_nextkey(db)), key.dptr != NULL) -/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). Make it -refer to cursor, to keep picky compilers happy. */ -#define EXIM_DBDELETE_CURSOR(cursor) { cursor = cursor; } +/* EXIM_DBDELETE_CURSOR - terminate scanning operation (null). */ +#define EXIM_DBDELETE_CURSOR(cursor) { } /* EXIM_DBCLOSE */ #define EXIM_DBCLOSE__(db) dbm_close(db) @@ -642,7 +640,13 @@ after reading data. */ : (flags) == O_RDWR ? "O_RDWR" \ : (flags) == (O_RDWR|O_CREAT) ? "O_RDWR|O_CREAT" \ : "??"); \ - EXIM_DBOPEN__(name, dirname, flags, mode, dbpp); \ + if (is_tainted(name) || is_tainted(dirname)) \ + { \ + log_write(0, LOG_MAIN|LOG_PANIC, "Tainted name for DB file not permitted"); \ + *dbpp = NULL; \ + } \ + else \ + { EXIM_DBOPEN__(name, dirname, flags, mode, dbpp); } \ DEBUG(D_hints_lookup) debug_printf_indent("returned from EXIM_DBOPEN: %p\n", *dbpp); \ } while(0) # define EXIM_DBCLOSE(db) \