]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/execute-serialize: do not gracefully skip unknown image policies in executor 40062/head
authorMike Yuan <me@yhndnzj.com>
Thu, 11 Dec 2025 15:26:34 +0000 (16:26 +0100)
committerMike Yuan <me@yhndnzj.com>
Thu, 11 Dec 2025 15:32:35 +0000 (16:32 +0100)
Follow-up for 7c0afcdde22d3d94fd23bfd0e473c263aaf54e8a

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.

src/core/execute-serialize.c

index bed2776889ab839768c20f474c477ddbd7c277df..9671899796fd4fc21c231e6d8ab554a17b2775ae 100644 (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