mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
basic/env-util: Allow newlines in values of environment variables
They are allowed by the shell and the EnvironmentFile parsing passes them through, so we should just accept them, same as we accept tabs.
This commit is contained in:
@@ -84,9 +84,9 @@ bool env_value_is_valid(const char *e) {
|
||||
if (!utf8_is_valid(e))
|
||||
return false;
|
||||
|
||||
/* bash allows tabs in environment variables, and so should
|
||||
* we */
|
||||
if (string_has_cc(e, "\t"))
|
||||
/* bash allows tabs and newlines in environment variables, and so
|
||||
* should we */
|
||||
if (string_has_cc(e, "\t\n"))
|
||||
return false;
|
||||
|
||||
/* POSIX says the overall size of the environment block cannot
|
||||
|
||||
Reference in New Issue
Block a user