Skip to content

Commit d995e81

Browse files
committed
Adjust dsearch documentation
1 parent 56af238 commit d995e81

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

doc/doc-docbook/spec.xfpt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6778,20 +6778,28 @@ each element starting with a tag name and an equals.
67786778

67796779
Two options are supported, for the return value and for filtering match
67806780
candidates.
6781-
The "ret" option requests an alternate result value of
6782-
the entire path for the entry. Example:
6781+
The "ret=" options request alternative result values: "ret=key" is the default,
6782+
and just returns the key (filename), "ret=full" requests the entire path for
6783+
the entry, and "ret=dir" requests the directory alone.
6784+
Example:
67836785
.code
6786+
${lookup {passwd} dsearch,ret=key {/etc}}
67846787
${lookup {passwd} dsearch,ret=full {/etc}}
6788+
${lookup {passwd} dsearch,ret=dir {/etc}}
67856789
.endd
6786-
The default result is just the requested entry.
6787-
The "filter" option requests that only directory entries of a given type
6788-
are matched. The match value is one of "file", "dir" or "subdir" (the latter
6789-
not matching "." or ".."). Example:
6790-
.code
6791-
${lookup {passwd} dsearch,filter=file {/etc}}
6792-
.endd
6793-
The default matching is for any entry type, including directories
6794-
and symlinks.
6790+
gives "passwd", "/etc/passwd" and "/etc".
6791+
6792+
By default all directory entries are matched, regardless of type. The "filter"
6793+
option requests that only directory entries of the given type(s) are matched:
6794+
"file", "dir", "symlink", "pipe", "socket", "tty", "bdev". The filter option
6795+
may be repeated to allow multiple types.
6796+
6797+
In addition, "filter=nodots" excludes "." and "..", and "filter=subdir" is
6798+
shorthand for "filter=dir,filter=nodots".
6799+
6800+
The "follow" option follows any symlinks before applies other checks, and
6801+
dangling symlinks will report as nonexistent; otherwise symlinks are rejected
6802+
if any other file-type filter is applied.
67956803

67966804
An example of how this
67976805
lookup can be used to support virtual domains is given in section

doc/doc-txt/ChangeLog

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ JH/08 Bug 2915: Fix use-after-free for $regex<n> variables. Previously when
3636
These variables were introduced in Exim 4.87.
3737
Debug help from Graeme Fowler.
3838

39-
MK/08 Numerous changes to dsearch lookups: (a) now performs taint check before
40-
other validations to prevent an attacker from making inferences from the
41-
varying error messages; (b) no longer require "read" permission on the
42-
directory (so you can now chmod a-r the dir to improve system security);
43-
(c) uses fstatat on systems that support it (reducing the syscall count);
44-
(d) additional filter options to support matching all inode types; (e)
45-
new ret=dir option. See documentation for full list.
39+
MK/09 Bug 2916: dsearch lookups no longer requires "read" permission on the
40+
directory.
41+
42+
MK/10 New dsearch lookup features: (a) ret=dir option; (b) filter options for
43+
all inode types; (c) can use fstatat(2) where supported.
4644

4745
Exim version 4.96
4846
-----------------

0 commit comments

Comments
 (0)