summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-03-29 20:59:49 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-03-29 22:25:58 +0100
commit129a5d133927ff8fa4b3f941f83c022d2daf18f3 (patch)
tree9d08dadc0a4176e5bc5147ab6cf744025b76a531 /src
parentd447dbd160a0fb503ed1e763f3f23d28744b6ddd (diff)
Dsearch: require absolute dirname
Diffstat (limited to 'src')
-rw-r--r--src/src/lookups/dsearch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/src/lookups/dsearch.c b/src/src/lookups/dsearch.c
index dba8422cc..07931ae4a 100644
--- a/src/src/lookups/dsearch.c
+++ b/src/src/lookups/dsearch.c
@@ -52,8 +52,11 @@ dsearch_check(void * handle, const uschar * filename, int modemask,
uid_t * owners, gid_t * owngroups, uschar ** errmsg)
{
handle = handle;
-return lf_check_file(-1, filename, S_IFDIR, modemask, owners, owngroups,
- "dsearch", errmsg) == 0;
+if (*filename == '/')
+ return lf_check_file(-1, filename, S_IFDIR, modemask, owners, owngroups,
+ "dsearch", errmsg) == 0;
+*errmsg = string_sprintf("dirname '%s' for dsearch is not absolute", filename);
+return FALSE;
}