add judge whether have mount /dev entry
1.Should not populate devices 2.Should not setup devpts Signed-off-by: haozi007 <liuhao27@huawei.com>
This commit is contained in:
parent
3b797473c0
commit
f223d891bd
50
0144-add-judge-whether-have-mount-dev-entry.patch
Normal file
50
0144-add-judge-whether-have-mount-dev-entry.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
From 035a43547eb501b3db9da6780635652d906600c1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: haozi007 <liuhao27@huawei.com>
|
||||||
|
Date: Mon, 20 Apr 2020 15:14:49 +0800
|
||||||
|
Subject: [PATCH] add judge whether have mount /dev entry
|
||||||
|
|
||||||
|
1.Should not populate devices
|
||||||
|
2.Should not setup devpts
|
||||||
|
|
||||||
|
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
||||||
|
---
|
||||||
|
src/lxc/conf.c | 22 ++++++++++++----------
|
||||||
|
1 file changed, 12 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
|
||||||
|
index b67e138d..5155824a 100644
|
||||||
|
--- a/src/lxc/conf.c
|
||||||
|
+++ b/src/lxc/conf.c
|
||||||
|
@@ -2064,17 +2064,19 @@ static int lxc_setup_dev_console(const struct lxc_rootfs *rootfs,
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
- ret = fchmod(console->slave, S_IXUSR | S_IXGRP);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- SYSERROR("Failed to set mode \"0%o\" to \"%s\"",
|
||||||
|
- S_IXUSR | S_IXGRP, console->name);
|
||||||
|
- return -errno;
|
||||||
|
- }
|
||||||
|
+ if (console->slave > 0) {
|
||||||
|
+ ret = fchmod(console->slave, S_IXUSR | S_IXGRP);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ SYSERROR("Failed to set mode \"0%o\" to \"%s\"",
|
||||||
|
+ S_IXUSR | S_IXGRP, console->name);
|
||||||
|
+ return -errno;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- ret = safe_mount(console->name, path, "none", MS_BIND, 0, rootfs_path);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- ERROR("Failed to mount \"%s\" on \"%s\"", console->name, path);
|
||||||
|
- return -1;
|
||||||
|
+ ret = safe_mount(console->name, path, "none", MS_BIND, 0, rootfs_path);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ ERROR("Failed to mount \"%s\" on \"%s\"", console->name, path);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG("Mounted pts device \"%s\" onto \"%s\"", console->name, path);
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
||||||
@ -142,3 +142,4 @@ lxc-CVE-2019-5736-runC-rexec-callers-as-memfd.patch
|
|||||||
0141-lxc-decode-some-escape-charactors-of-lxc-config-file.patch
|
0141-lxc-decode-some-escape-charactors-of-lxc-config-file.patch
|
||||||
0142-lxc-fix-non-root-user-cannot-write-dev-stdout.patch
|
0142-lxc-fix-non-root-user-cannot-write-dev-stdout.patch
|
||||||
0143-Support-syslog-for-console-log.patch
|
0143-Support-syslog-for-console-log.patch
|
||||||
|
0144-add-judge-whether-have-mount-dev-entry.patch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user