diff --git a/0033-fix-mount-device-path-incorrect.patch b/0033-fix-mount-device-path-incorrect.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c0bc4ca8df35efcf2d984f9efb46a7c26144e34 --- /dev/null +++ b/0033-fix-mount-device-path-incorrect.patch @@ -0,0 +1,27 @@ +From f7da4786892ab6b4bbe1cfedad24127a7d059f3d 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 3335b0d..a5573ac 100644 +--- a/src/lxc/conf.c ++++ b/src/lxc/conf.c +@@ -6064,7 +6064,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 6bed87e7f39797c34c2d647009b9041027871a01..44ead7507b9ff89966ed09761375b08c23cc7ab7 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102419 +%global _release 2022102420 Name: lxc Version: 4.0.3 @@ -40,6 +40,7 @@ Patch0029: 0029-fix-mixed-use-of-signed-and-unsigned-type.patch Patch0030: 0030-remove-unused-meminfo-stats.patch Patch0031: 0031-lxc-attach-Fix-lost-return-codes-of-spawned-processe.patch Patch0032: 0032-fix-load-bpf-failed.patch +Patch0033: 0033-fix-mount-device-path-incorrect.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -226,6 +227,12 @@ rm -rf %{buildroot}%{_sysconfdir}/default/%{name} %endif %changelog +* Fri Jun 16 2023 zhangxiaoyu - 4.0.3-2022102420 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix mount device path incorrect + * Sat May 06 2023 zhangxiaoyu - 4.0.3-2022102419 - Type:bugfix - ID:NA