man: fix list of escaped characters in unit names

The code works differently than the docs, and the code is right here.
Fix the doc hence.

See VALID_CHARS in unit-name.c for details about allowed chars in unit
names, but keep in mind that "-" and "\" are special, since generated by
the escaping logic: they are OK to show up in unit names, but need to be
escaped when converting foreign strings to unit names to make sure
things remain reversible.

Fixes: #19623
This commit is contained in:
Lennart Poettering 2021-05-26 13:55:37 +02:00
parent 36c357b486
commit aa6dc3ec33

View file

@ -273,10 +273,11 @@
objects in the file system hierarchy. Example: a device unit <filename>dev-sda.device</filename> refers to a device
with the device node <filename index="false">/dev/sda</filename> in the file system.</para>
<para>The escaping algorithm operates as follows: given a string, any <literal>/</literal> character is replaced by
<literal>-</literal>, and all other characters which are not ASCII alphanumerics or <literal>_</literal> are
replaced by C-style <literal>\x2d</literal> escapes. In addition, <literal>.</literal> is replaced with such a
C-style escape when it would appear as the first character in the escaped string.</para>
<para>The escaping algorithm operates as follows: given a string, any <literal>/</literal> character is
replaced by <literal>-</literal>, and all other characters which are not ASCII alphanumerics,
<literal>:</literal>, <literal>_</literal> or <literal>.</literal> are replaced by C-style
<literal>\x2d</literal> escapes. In addition, <literal>.</literal> is replaced with such a C-style escape
when it would appear as the first character in the escaped string.</para>
<para>When the input qualifies as absolute file system path, this algorithm is extended slightly: the path to the
root directory <literal>/</literal> is encoded as single dash <literal>-</literal>. In addition, any leading,