systemctl: strings returned by sd_bus_message_read_basic() are immutable
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Feb 2022 16:38:23 +0000 (17:38 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Feb 2022 04:46:46 +0000 (13:46 +0900)
commit92b29166e11950d22c580ac40e459fba48773e67
tree72c3565ec6bf64d7f948eac82aa5af19fe6ab6ad
parent99839c7ebd4b83a5b0d5982d669cfe10d1252e1f
systemctl: strings returned by sd_bus_message_read_basic() are immutable

It's totally not OK to write to the strings returned by it, the data is
shared by all code that references the message.

While we are at it, simplify the code via
json_variant_set_field_string().

Follow-up for: 5ef599b324efbcb7af317c102b59c662df068500
src/systemctl/systemctl-set-environment.c