!191 runc:fix the bug when runc syscall.Exec cmd not exist cause panic
From: @zhong-jiawei-1 Reviewed-by: @zhangsong234, @duguhaotian Signed-off-by: @duguhaotian
This commit is contained in:
commit
6f2338ba66
@ -1 +1 @@
|
||||
480f9b7358c97f6513661ba862ff25caa05206b8
|
||||
1256a9448b72c93429600f0e71b45a7c877e0d30
|
||||
|
||||
@ -16,9 +16,27 @@ Generally, our goals are:
|
||||
|
||||
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
|
||||
---
|
||||
init.go | 6 ++----
|
||||
libcontainer/factory_linux.go | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
2 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/init.go b/init.go
|
||||
index a0520b5..5951afe 100644
|
||||
--- a/init.go
|
||||
+++ b/init.go
|
||||
@@ -36,10 +36,8 @@ func init() {
|
||||
factory, _ := libcontainer.New("")
|
||||
if err := factory.StartInitialization(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "libcontainer: container start initialization failed: %s", err)
|
||||
- // as the error is sent back to the parent there is no need to log
|
||||
- // or write it to stderr because the parent process will handle this
|
||||
- os.Exit(1)
|
||||
}
|
||||
- panic("libcontainer: container init failed to exec")
|
||||
+ fmt.Fprint(os.Stderr, "libcontainer: container init failed to exec")
|
||||
+ os.Exit(1)
|
||||
}
|
||||
}
|
||||
diff --git a/libcontainer/factory_linux.go b/libcontainer/factory_linux.go
|
||||
index a1fa7de..86a127c 100644
|
||||
--- a/libcontainer/factory_linux.go
|
||||
|
||||
@ -18,7 +18,7 @@ index 6c79f899..0b58781d 100644
|
||||
- if r.CpuRtPeriod != 0 {
|
||||
- if err := cgroups.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(r.CpuRtPeriod, 10)); err != nil {
|
||||
- return err
|
||||
+var err error
|
||||
+ var err error
|
||||
+ if r.CpuRtRuntime != 0 {
|
||||
+ if err = cgroups.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil {
|
||||
+ if r.CpuRtPeriod != 0 {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: docker-runc
|
||||
Version: 1.1.8
|
||||
Release: 7
|
||||
Release: 8
|
||||
Summary: runc is a CLI tool for spawning and running containers according to the OCI specification.
|
||||
|
||||
License: ASL 2.0
|
||||
@ -54,6 +54,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc
|
||||
%{_bindir}/runc
|
||||
|
||||
%changelog
|
||||
* Thu Oct 26 2023 zhongjiawei<zhongjiawei1@huawei.com> - 1.1.8-8
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:fix the bug when runc syscall.Exec cmd not exist cause panic
|
||||
|
||||
* Tue Oct 24 2023 zhongjiawei<zhongjiawei1@huawei.com> - 1.1.8-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user