.next
.cindex "lookup" "dsearch"
.cindex "dsearch lookup type"
-&(dsearch)&: The given file must be a directory; this is searched for an entry
-whose name is the key by calling the &[lstat()]& function. The key may not
+&(dsearch)&: The given file must be an
+.new
+absolute
+.wen
+directory path; this is searched for an entry
+whose name is the key by calling the &[lstat()]& function.
+The key may not
contain any forward slash characters. If &[lstat()]& succeeds, the result of
the lookup is the name of the entry, which may be a file, directory,
symbolic link, or any other kind of directory entry.
- the autoreply transport file, log and once options
- file names used by the redirect router (including filter files)
- named-queue names
+ - paths used by single-key lookups
Previously this was permitted.
JH/21 Bug 2501: Fix init call in the heimdal authenticator. Previously it
JH/34 Fix the readsocket expansion to not segfault when an empty "options"
argument is supplied.
+JH/35 The dsearch lookup now requires that the directory is an absolute path.
+ Previously this was not checked, and nonempty relative paths made an
+ access under Exim's current working directory.
+
Exim version 4.93
-----------------
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;
}
fail: ${lookup{TESTNUM.tst} dsearch{DIR/dir_not_here}{$value}{FAIL}}
fail(case): ${lookup{TESTNUM.TST} dsearch{DIR/aux-fixed}{$value}{FAIL}}
fail(case): ${lookup{TESTNUM.TST} dsearch{DIR/AUX-fixed}{$value}{FAIL}}
+fail(path): ${lookup{TESTNUM.tst} dsearch{.}{$value}{OTHER}}
****
#
1
> Failed: failed to open TESTSUITE/dir_not_here for directory search: No such file or directory
> fail(case): FAIL
> Failed: failed to open TESTSUITE/AUX-fixed for directory search: No such file or directory
+> Failed: dirname '.' for dsearch is not absolute
>