From cced2139509099064a916b3ed188edbbc87f4df4 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 3 Mar 2024 13:16:49 +0100 Subject: Clarify the map option in the manual page This tries to make it a little clearer how expressions in the map statement may be used. --- man/nslcd.conf.5.xml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/man/nslcd.conf.5.xml b/man/nslcd.conf.5.xml index 54d2f11..d26ae27 100644 --- a/man/nslcd.conf.5.xml +++ b/man/nslcd.conf.5.xml @@ -442,12 +442,15 @@ The ATTRIBUTE is the one as used in RFC 2307 (e.g. userPassword, ipProtocolNumber, macAddress, etc.). - The NEWATTRIBUTE may be any attribute + + + The NEWATTRIBUTE may be the name of any attribute as it is available in the directory. - If the NEWATTRIBUTE is presented in - quotes (") it is treated as an expression which will be evaluated + If the NEWATTRIBUTE is quoted (") + as "EXPRESSION" + it is treated as an expression which will be evaluated to build up the actual value used. See the section on attribute mapping expressions below for more details. @@ -1118,27 +1121,27 @@ - ${attr} (or $attr for short) + "${attr}" (or "$attr" for short) will substitute the value of the attribute - ${attr:-word} + "${attr:-word}" (use default) will substitute the value of the attribute or, if the attribute is not set or empty substitute the word - ${attr:+word} + "${attr:+word}" (use alternative) will substitute word if attribute is set, otherwise substitute the empty string - ${attr:offset:length} + "${attr:offset:length}" will substitute length characters (actually bytes) starting from position offset (which @@ -1149,28 +1152,28 @@ - ${attr#word} + "${attr#word}" remove the shortest possible match of word from the left of the attribute value - ${attr##word} + "${attr##word}" remove the longest possible match of word from the left of the attribute value (pynslcd only) - ${attr%word} + "${attr%word}" remove the shortest possible match of word from the right of the attribute value (pynslcd only) - ${attr%%word} + "${attr%%word}" remove the longest possible match of word from the right of the attribute value (pynslcd only) @@ -1195,28 +1198,28 @@ - "${shadowFlag:-0}" + map shadow shadowFlag "${shadowFlag:-0}" use the shadowFlag attribute, using the value 0 as default - "${homeDirectory:-/home/$uid}" + map passd homeDirectory "${homeDirectory:-/home/$uid}" use the uid attribute to build a homeDirectory value if that attribute is missing - "${isDisabled:+100}" + map shadow shadowExpire "${isDisabled:+100}" if the isDisabled attribute is set, return 100, otherwise leave value empty - "${userPassword#{crypt\}}" + map shadow userPassword "${userPassword#{crypt\}}" strip the {crypt} prefix from the userPassword attribute, returning the raw hash value -- cgit v1.2.3