diff options
author | Krzesimir Nowak <knowak@microsoft.com> | 2024-02-28 16:34:05 +0100 |
---|---|---|
committer | Krzesimir Nowak <knowak@microsoft.com> | 2024-03-25 08:33:31 +0100 |
commit | f94da307f91e4f3346dca62c7c50a7816a2d946a (patch) | |
tree | d59b264549e171b2bd77103dd7562a6411edf85f | |
parent | test, sysext: Actually fail the whole operation if sd-merge worker failed (diff) | |
download | systemd-f94da307f91e4f3346dca62c7c50a7816a2d946a.tar.xz systemd-f94da307f91e4f3346dca62c7c50a7816a2d946a.zip |
sysext: Fail when trying to import mutable layer that's a symlink to hierarchy
-rw-r--r-- | src/sysext/sysext.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 267c90f976..b984e9b9a0 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -880,10 +880,8 @@ static int maybe_import_mutable_directory(OverlayFSPaths *op) { r = resolved_paths_equal(op->resolved_hierarchy, op->resolved_mutable_directory); if (r < 0) return log_error_errno(r, "Failed to check equality of hierarchy %s and its mutable directory %s: %m", op->resolved_hierarchy, op->resolved_mutable_directory); - if (r > 0) { - log_debug("Not importing mutable directory for hierarchy %s as a lower dir, because it points to the hierarchy itself", op->hierarchy); - return 0; - } + if (r > 0) + return log_error_errno(SYNTHETIC_ERRNO(ELOOP), "Not importing mutable directory for hierarchy %s as a lower dir, because it points to the hierarchy itself", op->hierarchy); r = strv_extend(&op->lower_dirs, op->resolved_mutable_directory); if (r < 0) @@ -919,10 +917,8 @@ static int maybe_import_ignored_mutable_directory(OverlayFSPaths *op) { if (r < 0) return log_error_errno(r, "Failed to check equality of hierarchy %s and its mutable directory %s: %m", op->resolved_hierarchy, op->resolved_mutable_directory); - if (r > 0) { - log_debug("Not importing mutable directory for hierarchy %s as a lower dir, because it points to the hierarchy itself", op->hierarchy); - return 0; - } + if (r > 0) + return log_error_errno(SYNTHETIC_ERRNO(ELOOP), "Not importing mutable directory for hierarchy %s as a lower dir, because it points to the hierarchy itself", op->hierarchy); r = strv_consume(&op->lower_dirs, TAKE_PTR(resolved_path)); if (r < 0) |