From 811854674ad7c3d5da54f8983b4f4b81657341d4 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 11 Mar 2019 10:33:05 +0100 Subject: [PATCH] core: Remove "." path components from required mount paths Fixes mount related failures when a user's home directory contains "/./" Closes: #923881 --- ...step-back-again-for-nspawn-we-actual.patch | 2 +- ...components-from-required-mount-paths.patch | 30 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 debian/patches/remove-.-path-components-from-required-mount-paths.patch diff --git a/debian/patches/debian/Revert-core-one-step-back-again-for-nspawn-we-actual.patch b/debian/patches/debian/Revert-core-one-step-back-again-for-nspawn-we-actual.patch index c8c61f4a8..7c1261e92 100644 --- a/debian/patches/debian/Revert-core-one-step-back-again-for-nspawn-we-actual.patch +++ b/debian/patches/debian/Revert-core-one-step-back-again-for-nspawn-we-actual.patch @@ -14,7 +14,7 @@ Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1141137 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c -index 24b14fb..694df72 100644 +index 2a7359a..d55aba8 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -4553,16 +4553,7 @@ int unit_kill_context( diff --git a/debian/patches/remove-.-path-components-from-required-mount-paths.patch b/debian/patches/remove-.-path-components-from-required-mount-paths.patch new file mode 100644 index 000000000..3cb5b6ac0 --- /dev/null +++ b/debian/patches/remove-.-path-components-from-required-mount-paths.patch @@ -0,0 +1,30 @@ +From: Stephane Chazelas +Date: Wed, 6 Mar 2019 22:16:55 +0000 +Subject: remove "." path components from required mount paths + +unit_require_mounts_for may be passed path arguments that contain "." +components like for user's home directories where "." is sometimes used +to specify some form of anchor point. + +This change stops considering such path as an error and removes the "." +components instead. + +Closes: #11910 +(cherry picked from commit 106bf8e445a797f9d9c88b827ed42193f2f6b838) +--- + src/core/unit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/unit.c b/src/core/unit.c +index 24b14fb..2a7359a 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -4607,7 +4607,7 @@ int unit_require_mounts_for(Unit *u, const char *path, UnitDependencyMask mask) + if (!p) + return -ENOMEM; + +- path = path_simplify(p, false); ++ path = path_simplify(p, true); + + if (!path_is_normalized(path)) + return -EPERM; diff --git a/debian/patches/series b/debian/patches/series index 636f37e5c..f90bdacae 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,6 +8,7 @@ networkd-test-ignore-failures-of-test_route_only_dns-in-c.patch timedate-fix-emitted-value-when-ntp-client-is-enabled-dis.patch cgtop-Fix-processing-of-controllers-other-than-CPU.patch udev-restore-debug-level-when-logging-a-failure-in-the-ex.patch +remove-.-path-components-from-required-mount-paths.patch debian/Use-Debian-specific-config-files.patch debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch debian/Make-run-lock-tmpfs-an-API-fs.patch -- 2.39.5