X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/3386088d5af4d4c61faa12ae29560e2c5bd43304..d22c942c4ba0a4e5ace2dfb856a43a19f8ed8b6d:/src/src/lookups/dsearch.c diff --git a/src/src/lookups/dsearch.c b/src/src/lookups/dsearch.c index f8c592adb..c27f5d6e6 100644 --- a/src/src/lookups/dsearch.c +++ b/src/src/lookups/dsearch.c @@ -65,13 +65,13 @@ return lf_check_file(-1, filename, S_IFDIR, modemask, owners, owngroups, scanning the directory, as it is hopefully faster to let the OS do the scanning for us. */ -int -static dsearch_find(void *handle, uschar *dirname, const uschar *keystring, int length, - uschar **result, uschar **errmsg, BOOL *do_cache) +static int +dsearch_find(void *handle, uschar *dirname, const uschar *keystring, int length, + uschar **result, uschar **errmsg, uint *do_cache) { struct stat statbuf; int save_errno; -uschar filename[PATH_MAX]; +uschar * filename; handle = handle; /* Keep picky compilers happy */ length = length; @@ -84,12 +84,7 @@ if (Ustrchr(keystring, '/') != 0) return DEFER; } -if (!string_format(filename, sizeof(filename), "%s/%s", dirname, keystring)) - { - *errmsg = US"path name too long"; - return DEFER; - } - +filename = string_sprintf("%s/%s", dirname, keystring); if (Ulstat(filename, &statbuf) >= 0) { *result = string_copy(keystring);