!67 update from master

From: @gaohuatao
Reviewed-by: @lifeng2221dd1
Signed-off-by: @lifeng2221dd1
This commit is contained in:
openeuler-ci-bot 2020-11-12 18:29:03 +08:00 committed by Gitee
commit 1f9bc2f264
11 changed files with 4485 additions and 31 deletions

View File

@ -1,7 +1,7 @@
From 8a62b519510080bb361cdd058d0e7a5edd955a95 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Wed, 15 Jul 2020 09:32:32 +0800
Subject: [PATCH] huawei: adapt to huawei 4.0.3
Subject: [PATCH 1/9] huawei: adapt to huawei 4.0.3
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---

View File

@ -1,7 +1,7 @@
From 0b8bc902c0c7acb54efb1fd4be5121dbf9a08598 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Wed, 15 Jul 2020 16:09:35 +0800
Subject: [PATCH 2/5] add mount label for rootfs
Subject: [PATCH 2/9] add mount label for rootfs
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -17,7 +17,7 @@ Signed-off-by: wujing <wujing50@huawei.com>
9 files changed, 591 insertions(+), 60 deletions(-)
diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 4a0961f1..1ff3d981 100644
index 4a0961f13..1ff3d9812 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -2133,7 +2133,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
@ -99,7 +99,7 @@ index 4a0961f1..1ff3d981 100644
return retval;
}
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 0744c19b..7e4af0a9 100644
index 0744c19b3..7e4af0a95 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -699,9 +699,15 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha
@ -639,7 +639,7 @@ index 0744c19b..7e4af0a9 100644
return log_error(-1, "Failed to setup console");
diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index 4b6409e3..c9265b65 100644
index 4b6409e3e..c9265b65e 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -442,31 +442,36 @@ struct lxc_conf {
@ -690,7 +690,7 @@ index 4b6409e3..c9265b65 100644
};
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index b1d101a9..f108b37b 100644
index b1d101a9d..f108b37b4 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -158,6 +158,7 @@ lxc_config_define(systemd);
@ -761,7 +761,7 @@ index b1d101a9..f108b37b 100644
+}
#endif
diff --git a/src/lxc/lsm/lsm.c b/src/lxc/lsm/lsm.c
index 553e0c99..2f87dd68 100644
index 553e0c99a..2f87dd68d 100644
--- a/src/lxc/lsm/lsm.c
+++ b/src/lxc/lsm/lsm.c
@@ -168,6 +168,26 @@ int lsm_process_label_set(const char *label, struct lxc_conf *conf,
@ -792,7 +792,7 @@ index 553e0c99..2f87dd68 100644
{
if (!drv) {
diff --git a/src/lxc/lsm/lsm.h b/src/lxc/lsm/lsm.h
index ee578bb0..4872f559 100644
index ee578bb03..4872f5598 100644
--- a/src/lxc/lsm/lsm.h
+++ b/src/lxc/lsm/lsm.h
@@ -17,6 +17,10 @@ struct lsm_drv {
@ -818,7 +818,7 @@ index ee578bb0..4872f559 100644
extern int lsm_keyring_label_set(char *label);
diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c
index dba0ab58..5bc9843e 100644
index dba0ab584..5bc9843e4 100644
--- a/src/lxc/lsm/selinux.c
+++ b/src/lxc/lsm/selinux.c
@@ -16,6 +16,10 @@
@ -1070,7 +1070,7 @@ index dba0ab58..5bc9843e 100644
struct lsm_drv *lsm_selinux_drv_init(void)
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 4e418fbb..032176b1 100644
index 4e418fbb9..032176b1b 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1097,6 +1097,37 @@ out:
@ -1190,7 +1190,7 @@ index 4e418fbb..032176b1 100644
return -1;
diff --git a/src/lxc/utils.h b/src/lxc/utils.h
index 39ef5792..4d1c49ba 100644
index 39ef5792f..4d1c49bab 100644
--- a/src/lxc/utils.h
+++ b/src/lxc/utils.h
@@ -220,9 +220,15 @@ extern char *choose_init(const char *rootfs);

View File

@ -1,7 +1,7 @@
From c0f37e083c49cfcb9441743a409fdee44d32d7c5 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Thu, 16 Jul 2020 16:39:35 +0800
Subject: [PATCH 3/5] format code and verify mount mode
Subject: [PATCH 3/9] format code and verify mount mode
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -12,7 +12,7 @@ Signed-off-by: wujing <wujing50@huawei.com>
4 files changed, 182 insertions(+), 118 deletions(-)
diff --git a/src/lxc/lsm/apparmor.c b/src/lxc/lsm/apparmor.c
index f251e5e7..591d37c2 100644
index f251e5e7e..591d37c27 100644
--- a/src/lxc/lsm/apparmor.c
+++ b/src/lxc/lsm/apparmor.c
@@ -1186,6 +1186,16 @@ static int apparmor_process_label_set(const char *inlabel, struct lxc_conf *conf
@ -44,7 +44,7 @@ index f251e5e7..591d37c2 100644
struct lsm_drv *lsm_apparmor_drv_init(void)
diff --git a/src/lxc/lsm/nop.c b/src/lxc/lsm/nop.c
index 5b345b9a..188945d5 100644
index 5b345b9a2..188945d51 100644
--- a/src/lxc/lsm/nop.c
+++ b/src/lxc/lsm/nop.c
@@ -24,11 +24,25 @@ static int nop_enabled(void)
@ -74,7 +74,7 @@ index 5b345b9a..188945d5 100644
struct lsm_drv *lsm_nop_drv_init(void)
diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c
index 5bc9843e..864b16be 100644
index 5bc9843e4..864b16be7 100644
--- a/src/lxc/lsm/selinux.c
+++ b/src/lxc/lsm/selinux.c
@@ -106,6 +106,10 @@ static int selinux_file_label_set(const char *path, const char *label)
@ -371,7 +371,7 @@ index 5bc9843e..864b16be 100644
#endif
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 032176b1..5ec6117f 100644
index 032176b1b..5ec6117f7 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1126,6 +1126,34 @@ static int receive_mount_options(const char *data, const char *mount_label,

View File

@ -1,7 +1,7 @@
From b1ef723b4f437aad3c0c0497174bc7d3444426cd Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Mon, 20 Jul 2020 15:30:42 +0800
Subject: [PATCH 4/5] Removes the definition of the thread attributes object
Subject: [PATCH 4/9] Removes the definition of the thread attributes object
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -12,7 +12,7 @@ Signed-off-by: wujing <wujing50@huawei.com>
4 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/src/lxc/attach.c b/src/lxc/attach.c
index 068cc5f8..b33ff632 100644
index 068cc5f8e..b33ff6325 100644
--- a/src/lxc/attach.c
+++ b/src/lxc/attach.c
@@ -1188,6 +1188,7 @@ static int create_attach_timeout_thread(int64_t attach_timeout, pid_t pid)
@ -24,7 +24,7 @@ index 068cc5f8..b33ff632 100644
ERROR("Create attach wait timeout thread failed");
free(timeout_conf);
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 7e4af0a9..6a25b96a 100644
index 7e4af0a95..6a25b96ac 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4660,6 +4660,7 @@ static int run_ocihook_buffer(struct oci_hook_conf *oconf, const char *inmsg)
@ -36,7 +36,7 @@ index 7e4af0a9..6a25b96a 100644
ERROR("Create wait timeout thread failed");
free(conf);
diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c
index 864b16be..ceac0889 100644
index 864b16be7..ceac08891 100644
--- a/src/lxc/lsm/selinux.c
+++ b/src/lxc/lsm/selinux.c
@@ -100,8 +100,6 @@ static int selinux_process_label_set(const char *inlabel, struct lxc_conf *conf,
@ -146,7 +146,7 @@ index 864b16be..ceac0889 100644
#endif
diff --git a/src/lxc/start.c b/src/lxc/start.c
index 51d13254..ab47420f 100644
index 51d13254b..ab47420f1 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -2484,6 +2484,7 @@ static int create_start_timeout_thread(struct lxc_conf *conf, unsigned int start

View File

@ -1,7 +1,7 @@
From 405b048dc82a8695b8a400524787243f3898cbd6 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Tue, 21 Jul 2020 17:30:17 +0800
Subject: [PATCH 5/5] solve coredump bug caused by fstype being NULL during
Subject: [PATCH 5/9] solve coredump bug caused by fstype being NULL during
mount
Signed-off-by: wujing <wujing50@huawei.com>
@ -11,7 +11,7 @@ Signed-off-by: wujing <wujing50@huawei.com>
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c
index ceac0889..837a3da3 100644
index ceac08891..837a3da3d 100644
--- a/src/lxc/lsm/selinux.c
+++ b/src/lxc/lsm/selinux.c
@@ -68,7 +68,6 @@ static int selinux_process_label_set(const char *inlabel, struct lxc_conf *conf,
@ -32,7 +32,7 @@ index ceac0889..837a3da3 100644
}
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 5ec6117f..95c00cfe 100644
index 5ec6117f7..95c00cfed 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1230,7 +1230,7 @@ int safe_mount(const char *src, const char *dest, const char *fstype,

View File

@ -1,7 +1,7 @@
From e21c6474901e3d12560eb389597e88b47fd46be5 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Fri, 11 Sep 2020 10:05:04 +0800
Subject: [PATCH 6/6] SIGTERM: do not catch signal SIGTERM in [lxc monitor]
Subject: [PATCH 6/9] SIGTERM: do not catch signal SIGTERM in [lxc monitor]
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---

View File

@ -1,8 +1,8 @@
From 5a8c9b52ad3291feb87c2281e074b2c85c766245 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Fri, 25 Sep 2020 10:21:37 +0800
Subject: [PATCH] Using string type instead of security_context_t because it is
deprecated
Subject: [PATCH 7/9] Using string type instead of security_context_t because
it is deprecated
Signed-off-by: wujing <wujing50@huawei.com>
---
@ -10,7 +10,7 @@ Signed-off-by: wujing <wujing50@huawei.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c
index 837a3da3..79697c58 100644
index 837a3da3d..79697c583 100644
--- a/src/lxc/lsm/selinux.c
+++ b/src/lxc/lsm/selinux.c
@@ -36,7 +36,7 @@ lxc_log_define(selinux, lsm);

View File

@ -0,0 +1,26 @@
From e8d9c6475eb42fdb1775a465353758f2c5418938 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Sat, 31 Oct 2020 17:38:04 +0800
Subject: [PATCH 8/9] hook: pass correct mount dir as root to hook
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---
src/lxc/conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 6a25b96ac..3d8713954 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4785,7 +4785,7 @@ static int do_run_oci_hooks(const char *name, const char *lxcpath, struct lxc_co
return 0;
}
- rootpath = get_root_path(lc->rootfs.path, lc->rootfs.bdev_type);
+ rootpath = get_root_path(lc->rootfs.path ? lc->rootfs.mount : NULL, lc->rootfs.bdev_type);
if (!rootpath) {
ERROR("Get container %s rootpath failed.", name);
return -1;
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
%global _release 2020101001
%global _release 2020110301
Name: lxc
Version: 4.0.3
@ -14,6 +14,8 @@ Patch9004: 0004-Removes-the-definition-of-the-thread-attributes-obje.patch
Patch9005: 0005-solve-coredump-bug-caused-by-fstype-being-NULL-durin.patch
Patch9006: 0006-SIGTERM-do-not-catch-signal-SIGTERM-in-lxc-monitor.patch
Patch9007: 0007-Using-string-type-instead-of-security_context_t-beca.patch
Patch9008: 0008-hook-pass-correct-mount-dir-as-root-to-hook.patch
Patch9009: 0009-cgroup-refact-cgroup-manager-to-single-file.patch
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
BuildRequires: pkgconfig(libseccomp)
@ -102,7 +104,6 @@ done
chrpath -d %{buildroot}/usr/lib64/liblxc.so
chmod +x %{buildroot}/usr/lib64/liblxc.so
# docs
mkdir -p %{buildroot}%{_pkgdocdir}/api
cp -a AUTHORS README %{buildroot}%{_pkgdocdir}
@ -186,6 +187,12 @@ make check
%{_mandir}/*/man7/%{name}*
%changelog
* Tue Nov 3 2020 lifeng <lifeng68@openeuler.org> - 4.0.3-2020110301
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: 1. fix hook root dir error and refact cgroup
* Sat Oct 10 2020 openEuler Buildteam <buildteam@openeuler.org> - 4.0.3-2020101001
- Type:enhancement
- ID:NA
@ -214,7 +221,7 @@ make check
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add patches
- DESC: add debug packages
* Mon Apr 20 2020 openEuler Buildteam <buildteam@openeuler.org> - 4.0.3-2020071501
- Type:enhancement

5
lxc.yaml Normal file
View File

@ -0,0 +1,5 @@
---
version_control: github
src_repo: lxc/lxc
tag_prefix: "lxc-"
seperator: "."