Commit afffa89
authored
ssh: Fix environment variable parsing (#177503)
From systemctl(1)'s `show-environment`:
[...] If no special characters or
whitespace is present in the variable values, no escaping is
performed, and the assignments have the form "VARIABLE=value". If
whitespace or characters which have special meaning to the shell
are present, dollar-single-quote escaping is used, and assignments
have the form "VARIABLE=$'value'". [...]
`DISPLAY` is unlikely to require such escaping, but is still broken and
overly complicated.
Just rely on the fact that systemctl outputs line that are safe to be
interpreted by the shell.
Filter for `DISPLAY` and `eval` the output instead of trying to parse
just the value part and reassign it again.1 parent d361bb4 commit afffa89
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
0 commit comments