!477 [sync] PR-476: fix mount device path incorrect

Merge pull request !477 from openeuler-sync-bot/sync-pr476-openEuler-22.03-LTS-to-openEuler-20.03-LTS-SP3
This commit is contained in:
haozi007 2023-06-20 12:58:55 +00:00 committed by Gitee
commit 8a61b08b36
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From e461e117238420ba9abdc4c9ec6de46b690354e8 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Fri, 16 Jun 2023 12:02:38 +0800
Subject: [PATCH] fix mount device path incorrect
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
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

View File

@ -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<zhangxiaoyu58@huawei.com> - 4.0.3-2022102417
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix mount device path incorrect
* Mon Apr 24 2023 wangrunze<wangrunze13@huawei.com> - 4.0.3-2022102416
- Type:bugfix
- ID:NA