From a5dc727afcc92deab722a84ae5cf3d00ae74c5f6 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 3 Apr 2020 14:36:17 +0100 Subject: dsearch: full-path return option --- doc/doc-docbook/spec.xfpt | 20 ++++++++++++++++---- doc/doc-txt/NewStuff | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index bfe59fccc..295835dbb 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -6777,12 +6777,24 @@ absolute 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. +contain any forward slash characters. +If &[lstat()]& succeeds then so does the lookup. .new +Options for the lookup can be given by appending them after the word "dsearch", +separated by a comma. Options, if present, are a comma-separated list with +each element starting with a tag name and an equals. + +The only option currently supported requests an alternate output value of +the entire path for the entry. Example: +.code +${lookup {passwd} dsearch,ret=full {/etc}} +.endd +The default result is just the requested entry. + +The matching entry may be a file, directory, +symbolic link, or any other kind of directory entry. .cindex "tainted data" "dsearch result" -It is regarded as untainted. +The result is regarded as untainted. .wen An example of how this lookup can be used to support virtual domains is given in section diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 62763e2ac..9a06feab7 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -47,6 +47,7 @@ Version 4.94 lookup string. The older method fails when tainted variables are used in the lookup, as the filename becomes tainted. The new method keeps the filename separate. +12. An option on the dsearch lookup, to return the full path. -- cgit v1.2.3