From 32c63cd3392e4f0499d32efdf0b5b16f0cea07b1 Mon Sep 17 00:00:00 2001 From: WangFengTu Date: Sat, 20 Aug 2022 15:20:28 +0800 Subject: [PATCH] do not check rootfs.path, it may be null if rootfs is "/" Signed-off-by: WangFengTu --- ...l-if-no-args-or-no-rootfs-path-found.patch | 6 ++--- ...tfs.path-it-may-be-null-if-rootfs-is.patch | 26 ------------------- lxc.spec | 1 - 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 0014-do-not-check-rootfs.path-it-may-be-null-if-rootfs-is.patch diff --git a/0013-return-fail-if-no-args-or-no-rootfs-path-found.patch b/0013-return-fail-if-no-args-or-no-rootfs-path-found.patch index ca06714..41a72e1 100644 --- a/0013-return-fail-if-no-args-or-no-rootfs-path-found.patch +++ b/0013-return-fail-if-no-args-or-no-rootfs-path-found.patch @@ -1,4 +1,4 @@ -From ee2a2242a009627fe6edd89f4624d8eb6dd1756c Mon Sep 17 00:00:00 2001 +From a2aff3425a6f35bdb9f83880a1545b89606bf7c9 Mon Sep 17 00:00:00 2001 From: WangFengTu Date: Fri, 19 Aug 2022 14:32:22 +0800 Subject: [PATCH] return fail if no args or no rootfs path found @@ -9,7 +9,7 @@ Signed-off-by: WangFengTu 1 file changed, 14 insertions(+) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 3f75184..2133782 100644 +index 3f75184..4b669bb 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1030,6 +1030,20 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a @@ -17,7 +17,7 @@ index 3f75184..2133782 100644 } + // do not allow using default rootfs path when isulad -+ if (conf->rootfs.mount == NULL || conf->rootfs.path == NULL) { ++ if (conf->rootfs.mount == NULL) { + ERROR("Empty rootfs path detected"); + lxc_put_handler(handler); + return false; diff --git a/0014-do-not-check-rootfs.path-it-may-be-null-if-rootfs-is.patch b/0014-do-not-check-rootfs.path-it-may-be-null-if-rootfs-is.patch deleted file mode 100644 index 84ba9e4..0000000 --- a/0014-do-not-check-rootfs.path-it-may-be-null-if-rootfs-is.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 781ccccd4074b3b998e7085729409ed1beacf828 Mon Sep 17 00:00:00 2001 -From: WangFengTu -Date: Sat, 20 Aug 2022 14:46:36 +0800 -Subject: [PATCH] do not check rootfs.path, it may be null if rootfs is "/" - -Signed-off-by: WangFengTu ---- - src/lxc/lxccontainer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c -index 2133782..4b669bb 100644 ---- a/src/lxc/lxccontainer.c -+++ b/src/lxc/lxccontainer.c -@@ -1031,7 +1031,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a - } - - // do not allow using default rootfs path when isulad -- if (conf->rootfs.mount == NULL || conf->rootfs.path == NULL) { -+ if (conf->rootfs.mount == NULL) { - ERROR("Empty rootfs path detected"); - lxc_put_handler(handler); - return false; --- -2.25.1 - diff --git a/lxc.spec b/lxc.spec index e632a5f..085be9e 100644 --- a/lxc.spec +++ b/lxc.spec @@ -21,7 +21,6 @@ Patch0010: 0010-check-yajl-only-when-have-isulad.patch Patch0011: 0011-drop-security_context_t.patch Patch0012: 0012-only-set-user-or-image-set-non-empty-HOME.patch Patch0013: 0013-return-fail-if-no-args-or-no-rootfs-path-found.patch -Patch0014: 0014-do-not-check-rootfs.path-it-may-be-null-if-rootfs-is.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) -- Gitee