From: Lennart Poettering Date: Wed, 26 May 2021 11:55:37 +0000 (+0200) Subject: man: fix list of escaped characters in unit names X-Git-Tag: v249-rc1~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa6dc3ec337b04308a5dfe3b962fa88088b2c82e;p=thirdparty%2Fsystemd.git 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 --- diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 0b5e8693219..552ede51f5f 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -273,10 +273,11 @@ objects in the file system hierarchy. Example: a device unit dev-sda.device refers to a device with the device node /dev/sda in the file system. - The escaping algorithm operates as follows: given a string, any / character is replaced by - -, and all other characters which are not ASCII alphanumerics or _ are - replaced by C-style \x2d escapes. In addition, . is replaced with such a - C-style escape when it would appear as the first character in the escaped string. + The escaping algorithm operates as follows: given a string, any / character is + replaced by -, and all other characters which are not ASCII alphanumerics, + :, _ or . are replaced by C-style + \x2d escapes. In addition, . is replaced with such a C-style escape + when it would appear as the first character in the escaped string. When the input qualifies as absolute file system path, this algorithm is extended slightly: the path to the root directory / is encoded as single dash -. In addition, any leading,