33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
From cfb234e332fe820ef843fb817598ebbbdffdd05f Mon Sep 17 00:00:00 2001
|
|
From: Luca Boccassi <luca.boccassi@gmail.com>
|
|
Date: Wed, 11 Mar 2026 13:27:14 +0000
|
|
Subject: [PATCH] nspawn: normalize pivot_root paths
|
|
|
|
Originally reported on yeswehack.com as:
|
|
YWH-PGM9780-116
|
|
|
|
Follow-up for b53ede699cdc5233041a22591f18863fb3fe2672
|
|
|
|
(cherry picked from commit 7b85f5498a958e5bb660c703b8f4a71cceed3373)
|
|
|
|
Resolves: RHEL-163871
|
|
---
|
|
src/nspawn/nspawn-mount.c | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c
|
|
index a54f1464ba..af96d2d1d7 100644
|
|
--- a/src/nspawn/nspawn-mount.c
|
|
+++ b/src/nspawn/nspawn-mount.c
|
|
@@ -1244,7 +1244,9 @@ int pivot_root_parse(char **pivot_root_new, char **pivot_root_old, const char *s
|
|
|
|
if (!path_is_absolute(root_new))
|
|
return -EINVAL;
|
|
- if (root_old && !path_is_absolute(root_old))
|
|
+ if (!path_is_normalized(root_new))
|
|
+ return -EINVAL;
|
|
+ if (root_old && (!path_is_absolute(root_old) || !path_is_normalized(root_old)))
|
|
return -EINVAL;
|
|
|
|
free_and_replace(*pivot_root_new, root_new);
|