path: root/src/test/test-escape.c
Commit message (Collapse)AuthorAge
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Prep v236 : Add missing SPDX-License-Identifier (8/9) src/testSven Eden2018-03-26
* tests: add tests for environment serializationZbigniew Jędrzejewski-Szmek2017-07-25
* Use "dollar-single-quotes" to escape shell-sensitive stringsZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | Also called "ANSI-C Quoting" in info:(bash) ANSI-C Quoting. The escaping rules are a POSIX proposal, and are described in There's a lot of back-and-forth on the details of escaping of control characters, but we'll be only using a small subset of the syntax that is common to all proposals and is widely supported. Unfortunately dash and fish and maybe some other shells do not support it (see the man page patch for a list). This allows environment variables to be safely exported using show-environment and imported into the shell. Shells which do not support this syntax will have to do something like export $(systemctl show-environment|grep -v '=\$') or whatever is appropriate in their case. I think csh and fish do not support the A=B syntax anyway, so the change is moot for them. Fixes #5536. v2: - also escape newlines (which currently disallowed in shell values, so this doesn't really matter), and tabs (as $'\t'), and ! (as $'!'). This way quoted output can be included directly in both interactive and noninteractive bash.
* Prep v233.3: Add all possible coverage tests for elogindSven Eden2017-07-20