core/dbus-execute: respect write flags for empty assignments too

This commit is contained in:
Mike Yuan
2025-12-15 21:02:15 +01:00
parent 8619c65fcf
commit 16bae207c2

View File

@@ -3914,7 +3914,7 @@ int bus_exec_context_set_transient_property(
if (r < 0)
return r;
if (empty) {
if (!UNIT_WRITE_FLAGS_NOOP(flags) && empty) {
bind_mount_free_many(c->bind_mounts, c->n_bind_mounts);
c->bind_mounts = NULL;
c->n_bind_mounts = 0;
@@ -3959,7 +3959,7 @@ int bus_exec_context_set_transient_property(
if (r < 0)
return r;
if (empty) {
if (!UNIT_WRITE_FLAGS_NOOP(flags) && empty) {
temporary_filesystem_free_many(c->temporary_filesystems, c->n_temporary_filesystems);
c->temporary_filesystems = NULL;
c->n_temporary_filesystems = 0;