From 628f3e401295eb4aab6c728b85b0ad247696ceb3 Mon Sep 17 00:00:00 2001 From: zhangxiaoyu Date: Tue, 20 Jun 2023 20:08:36 +0800 Subject: [PATCH] fix mount device path incorrect Signed-off-by: zhangxiaoyu (cherry picked from commit 4e25f7ca15d12ff61b3880f0b1a0ffbecfe38e89) --- 0065-fix-mount-device-path-incorrect.patch | 27 ++++++++++++++++++++++ lxc.spec | 9 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0065-fix-mount-device-path-incorrect.patch diff --git a/0065-fix-mount-device-path-incorrect.patch b/0065-fix-mount-device-path-incorrect.patch new file mode 100644 index 0000000..b2c51db --- /dev/null +++ b/0065-fix-mount-device-path-incorrect.patch @@ -0,0 +1,27 @@ +From e461e117238420ba9abdc4c9ec6de46b690354e8 Mon Sep 17 00:00:00 2001 +From: zhangxiaoyu +Date: Fri, 16 Jun 2023 12:02:38 +0800 +Subject: [PATCH] fix mount device path incorrect + +Signed-off-by: zhangxiaoyu +--- + src/lxc/conf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/lxc/conf.c b/src/lxc/conf.c +index b31ba38..51e4bb0 100644 +--- a/src/lxc/conf.c ++++ b/src/lxc/conf.c +@@ -4301,7 +4301,8 @@ static int setup_populate_devs(const struct lxc_rootfs *rootfs, struct lxc_list + + // Unprivileged containers cannot create devices, so + // try to bind mount the device from the host +- ret = snprintf(hostpath, MAXPATHLEN, "/dev/%s", dev_elem->name); ++ // dev_elem name is the device path ++ ret = snprintf(hostpath, MAXPATHLEN, "%s", dev_elem->name); + if (ret < 0 || ret >= MAXPATHLEN) { + ret = -1; + goto reset_umask; +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 15a452c..94d9d55 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102416 +%global _release 2022102417 Name: lxc Version: 4.0.3 @@ -72,6 +72,7 @@ Patch0061: 0061-fix-ops-hierarchies-cause-coredump.patch Patch0062: 0062-use-ocihooks-env-after-getenv.patch Patch0063: 0063-fix-lxc-attach-stuck-when-disable-isulad.patch Patch0064: 0064-fix-mixed-use-of-signed-and-unsigned-type.patch +Patch0065: 0065-fix-mount-device-path-incorrect.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -252,6 +253,12 @@ make check %endif %changelog +* Fri Jun 16 2023 zhangxiaoyu - 4.0.3-2022102417 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix mount device path incorrect + * Mon Apr 24 2023 wangrunze - 4.0.3-2022102416 - Type:bugfix - ID:NA -- Gitee