From 14c0fa95b580bec5a71669e6134a3e81bfff2178 Mon Sep 17 00:00:00 2001 From: "Neil.wrz" Date: Tue, 20 Sep 2022 02:13:49 -0700 Subject: [PATCH] fix do mask paths after parent mounted Signed-off-by: Neil.wrz (cherry picked from commit fc6467c52155f775a3738712ef2315943c098c7f) --- ...x-do-mask-paths-after-parent-mounted.patch | 45 +++++++++++++++++++ lxc.spec | 9 +++- series.conf | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 0048-fix-do-mask-paths-after-parent-mounted.patch diff --git a/0048-fix-do-mask-paths-after-parent-mounted.patch b/0048-fix-do-mask-paths-after-parent-mounted.patch new file mode 100644 index 0000000..0f1e3d8 --- /dev/null +++ b/0048-fix-do-mask-paths-after-parent-mounted.patch @@ -0,0 +1,45 @@ +From d349251fa2e05b111b230a78f782c2552095adf5 Mon Sep 17 00:00:00 2001 +From: "Neil.wrz" +Date: Tue, 20 Sep 2022 02:09:16 -0700 +Subject: [PATCH] fix do mask paths after parent mounted + +Signed-off-by: Neil.wrz +--- + src/lxc/conf.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/lxc/conf.c b/src/lxc/conf.c +index cd9e818..7f98811 100644 +--- a/src/lxc/conf.c ++++ b/src/lxc/conf.c +@@ -5164,13 +5164,6 @@ int lxc_setup(struct lxc_handler *handler) + } + + #ifdef HAVE_ISULAD +- // isulad: setup rootfs masked paths +- if (!lxc_list_empty(&lxc_conf->rootfs.maskedpaths)) { +- if (setup_rootfs_maskedpaths(&lxc_conf->rootfs.maskedpaths)) { +- return log_error(-1, "failed to setup maskedpaths"); +- } +- } +- + // isulad: setup rootfs ro paths + if (!lxc_list_empty(&lxc_conf->rootfs.ropaths)) { + if (setup_rootfs_ropaths(&lxc_conf->rootfs.ropaths)) { +@@ -5178,6 +5171,13 @@ int lxc_setup(struct lxc_handler *handler) + } + } + ++ // isulad: setup rootfs masked paths ++ if (!lxc_list_empty(&lxc_conf->rootfs.maskedpaths)) { ++ if (setup_rootfs_maskedpaths(&lxc_conf->rootfs.maskedpaths)) { ++ return log_error(-1, "failed to setup maskedpaths"); ++ } ++ } ++ + //isulad: system container, remount /proc/sys/xxx by mount_list + if (lxc_conf->systemd != NULL && strcmp(lxc_conf->systemd, "true") == 0) { + if (!lxc_list_empty(&lxc_conf->mount_list)) { +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 463c543..04f6683 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022090201 +%global _release 2022092001 Name: lxc Version: 4.0.3 @@ -55,6 +55,7 @@ Patch0044: 0044-fix-HOME-env-unset-error.patch Patch0045: 0045-only-set-user-or-image-set-non-empty-HOME.patch Patch0046: 0046-return-fail-if-no-args-or-no-rootfs-path-found.patch Patch0047: 0047-fix-tools-with-option-give-error-message.patch +Patch0048: 0048-fix-do-mask-paths-after-parent-mounted.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -226,6 +227,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Tue Sep 20 2022 Neil.wrz - 4.0.3-2022092001 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: do mask paths after parent mounted + * Fri Sep 02 2022 Neil.wrz - 4.0.3-2022090201 - Type:bugfix - ID:NA diff --git a/series.conf b/series.conf index 8a8ec18..4b4e5c0 100644 --- a/series.conf +++ b/series.conf @@ -45,3 +45,4 @@ 0045-only-set-user-or-image-set-non-empty-HOME.patch 0046-return-fail-if-no-args-or-no-rootfs-path-found.patch 0047-fix-tools-with-option-give-error-message.patch +0048-fix-do-mask-paths-after-parent-mounted.patch -- Gitee