core/execute-serialize: do not gracefully skip unknown image policies in executor

Follow-up for 7c0afcdde2

Addresses https://github.com/systemd/systemd/pull/40060#issuecomment-3641288267

As commented, the unknown values should have been filtered out
in pid1's initial parsing already, and the communication between
pid1 and executor is entirely internal which makes the graceful
practice counterproductive.
This commit is contained in:
Mike Yuan
2025-12-11 16:32:35 +01:00
parent f98520690c
commit cc317bb82f
+3 -3
View File
@@ -3740,21 +3740,21 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) {
if (c->root_image_policy)
return -EINVAL; /* duplicated */
r = image_policy_from_string(val, /* graceful= */ true, &c->root_image_policy);
r = image_policy_from_string(val, /* graceful= */ false, &c->root_image_policy);
if (r < 0)
return r;
} else if ((val = startswith(l, "exec-context-mount-image-policy="))) {
if (c->mount_image_policy)
return -EINVAL; /* duplicated */
r = image_policy_from_string(val, /* graceful= */ true, &c->mount_image_policy);
r = image_policy_from_string(val, /* graceful= */ false, &c->mount_image_policy);
if (r < 0)
return r;
} else if ((val = startswith(l, "exec-context-extension-image-policy="))) {
if (c->extension_image_policy)
return -EINVAL; /* duplicated */
r = image_policy_from_string(val, /* graceful= */ true, &c->extension_image_policy);
r = image_policy_from_string(val, /* graceful= */ false, &c->extension_image_policy);
if (r < 0)
return r;
} else