In most cases the generated file will not even be valid. Example:
systemd-run --setenv 'a=b c' true
This will yield the following file:
Invalid environment assignment, ignoring: a=b c
@@ -842,7 +842,7 @@
c->environment = e;
- joined = strv_join(c->environment, " ");
+ joined = strv_join_quoted(c->environment);
Please submit patches to the mailing list, not to Bugzilla.
Please ignore the patch and fix the bug.
I'm not convinced this is a bug. systemd-run's --setenv option is documented to correspond to setting Environment= in the transient unit file. This means it uses the same syntax , too.
Given that you're trying to assign a value with spaces, I believe you want this:
systemd-run --setenv '"a=b c"' true
Your suggestion would change the effect of multiple settings, which we support in cases like this:
systemd-run --setenv 'a=b c=d' true
With strv_join(), it would be:
With strv_join_quoted(), it would be:
So, strv_join_quoted() would result in, I think, $a being set to "b c=d".
If I'm wrong about breaking multiple environment settings, please re-open, and I'll take another look.
David, it's actually OK to submit patches via fdo bugzilla. We support both ways.
I think Hristo has a point, this is a bug. Reopening.
Applied to git! Thanks!