summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2024-09-12 18:46:04 +0200
committerLennart Poettering <lennart@poettering.net>2024-09-13 17:32:00 +0200
commit00f546e25e8e46e5e289e1f2fc2ed3dcc6999223 (patch)
treeab063fbf84837223929e389a426b5d2ce19b542d /src/core
parentMerge pull request #34402 from keszybz/notes-readme (diff)
downloadsystemd-00f546e25e8e46e5e289e1f2fc2ed3dcc6999223.tar.xz
systemd-00f546e25e8e46e5e289e1f2fc2ed3dcc6999223.zip
core: do not fail if ignorable img.v/ vpick dir is empty
If the vpick directory is configured to be ignored if missing, do not fail and just skip ahead. Follow-up for 5e79dd96a88 Follow-up for 622efc544dc
Diffstat (limited to 'src/core')
-rw-r--r--src/core/namespace.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c
index bd4bd6205c..c04ddedf5d 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -528,11 +528,15 @@ static int append_extensions(
&result);
if (r < 0)
return r;
- if (!result.path)
+ if (!result.path) {
+ if (m->ignore_enoent)
+ continue;
+
return log_debug_errno(
SYNTHETIC_ERRNO(ENOENT),
"No matching entry in .v/ directory %s found.",
m->source);
+ }
r = verity_settings_load(&verity, result.path, /* root_hash_path= */ NULL, /* root_hash_sig_path= */ NULL);
if (r < 0)
@@ -575,10 +579,6 @@ static int append_extensions(
const char *e = *extension_directory;
bool ignore_enoent = false;
- /* Pick up the counter where the ExtensionImages left it. */
- if (asprintf(&mount_point, "%s/unit-extensions/%zu", private_namespace_dir, n_mount_images++) < 0)
- return -ENOMEM;
-
/* Look for any prefixes */
if (startswith(e, "-")) {
e++;
@@ -596,11 +596,19 @@ static int append_extensions(
&result);
if (r < 0)
return r;
- if (!result.path)
+ if (!result.path) {
+ if (ignore_enoent)
+ continue;
+
return log_debug_errno(
SYNTHETIC_ERRNO(ENOENT),
"No matching entry in .v/ directory %s found.",
e);
+ }
+
+ /* Pick up the counter where the ExtensionImages left it. */
+ if (asprintf(&mount_point, "%s/unit-extensions/%zu", private_namespace_dir, n_mount_images++) < 0)
+ return -ENOMEM;
for (size_t j = 0; hierarchies && hierarchies[j]; ++j) {
char *prefixed_hierarchy = path_join(mount_point, hierarchies[j]);