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
Fix exim_dbmbuild to permit directoryless filenames. Bug 2242
[exim.git]
/
src
/
src
/
exim_dbmbuild.c
diff --git
a/src/src/exim_dbmbuild.c
b/src/src/exim_dbmbuild.c
index 85ae9012bc73ff1968be99b82843b02b30529d25..afd5095db0e4165eba8653d515651ba7ab918e1c 100644
(file)
--- a/
src/src/exim_dbmbuild.c
+++ b/
src/src/exim_dbmbuild.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. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-30,6
+30,7
@@
characters. */
#include "exim.h"
#include "exim.h"
+uschar * spool_directory = NULL; /* dummy for dbstuff.h */
#define max_insize 20000
#define max_outsize 100000
#define max_insize 20000
#define max_outsize 100000
@@
-151,6
+152,7
@@
uschar *bptr;
uschar keybuffer[256];
uschar temp_dbmname[512];
uschar real_dbmname[512];
uschar keybuffer[256];
uschar temp_dbmname[512];
uschar real_dbmname[512];
+uschar dirname[512];
uschar *buffer = malloc(max_outsize);
uschar *line = malloc(max_insize);
uschar *buffer = malloc(max_outsize);
uschar *line = malloc(max_insize);
@@
-205,10
+207,16
@@
if (strlen(argv[arg+1]) > sizeof(temp_dbmname) - 20)
Ustrcpy(temp_dbmname, argv[arg+1]);
Ustrcat(temp_dbmname, ".dbmbuild_temp");
Ustrcpy(temp_dbmname, argv[arg+1]);
Ustrcat(temp_dbmname, ".dbmbuild_temp");
+Ustrcpy(dirname, temp_dbmname);
+if ((bptr = Ustrrchr(dirname, '/')))
+ *bptr = '\0';
+else
+ Ustrcpy(dirname, ".");
+
/* It is apparently necessary to open with O_RDWR for this to work
with gdbm-1.7.3, though no reading is actually going to be done. */
/* It is apparently necessary to open with O_RDWR for this to work
with gdbm-1.7.3, though no reading is actually going to be done. */
-EXIM_DBOPEN(temp_dbmname, O_RDWR|O_CREAT|O_EXCL, 0644, &d);
+EXIM_DBOPEN(temp_dbmname,
dirname,
O_RDWR|O_CREAT|O_EXCL, 0644, &d);
if (d == NULL)
{
if (d == NULL)
{