aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Polański <michal@polanski.me>2021-06-22 02:47:29 +0200
committerMichał Polański <michal@polanski.me>2021-06-22 02:47:29 +0200
commit262c4497ff87a53aefcff5efea6fe44f0120dfb2 (patch)
treedc38a5fcf3591a946de9efe78e6ae138dc2f5371
parentefb17e39aee5d5d3ef5e1f1674389c59988e5484 (diff)
downloadaports-262c4497ff87a53aefcff5efea6fe44f0120dfb2.tar.gz
aports-262c4497ff87a53aefcff5efea6fe44f0120dfb2.tar.bz2
aports-262c4497ff87a53aefcff5efea6fe44f0120dfb2.tar.xz
community/podman: fix panic when cgroup filesystem is not mounted
-rw-r--r--community/podman/APKBUILD4
-rw-r--r--community/podman/cgroups-panic-fix.patch31
2 files changed, 34 insertions, 1 deletions
diff --git a/community/podman/APKBUILD b/community/podman/APKBUILD
index 63101c081d..d7073566b6 100644
--- a/community/podman/APKBUILD
+++ b/community/podman/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=podman
pkgver=3.2.1
-pkgrel=0
+pkgrel=1
pkgdesc="Simple management tool for pods, containers, and images"
url="https://podman.io/"
license="Apache-2.0"
@@ -41,6 +41,7 @@ subpackages="
source="https://github.com/containers/podman/archive/v$pkgver/podman-$pkgver.tar.gz
podman.initd
podman.confd
+ cgroups-panic-fix.patch
"
# secfixes:
@@ -113,4 +114,5 @@ sha512sums="
8fa4e2a72d1e655c600fa4dc7ad2366975314a154ff9fa7496622da6042e54c6fe93aca0344e6615e2ce3d400c1bc5de7d8462df45f950a119c3303b3ae520e4 podman-3.2.1.tar.gz
72e91da5c2144c190f4f1a98b5b1f32cbaee50ef53d4c0a2a255a514b79d76cf71a1eca9470d4ad0a5f51ee65df68b1711fd7c5b90a416916715c607275af484 podman.initd
ec6e6d3f72d0ab6c90a30b2cca5152c0d0f1e402ae671289263d7bf3b5141de9d67c3593f20b6075cedd214b7fb1506e69ff7b4f9691b43b391389343ab9b9b1 podman.confd
+2eb0450682560bfef0d4a354bbe3767344dbe61d46be081b45f2d2f1baeccf5ddcbbb2091398668b41c8dbac8075dda6e516a1da2d7465e4fd0c22fb2aca5fb0 cgroups-panic-fix.patch
"
diff --git a/community/podman/cgroups-panic-fix.patch b/community/podman/cgroups-panic-fix.patch
new file mode 100644
index 0000000000..5df25a77ee
--- /dev/null
+++ b/community/podman/cgroups-panic-fix.patch
@@ -0,0 +1,31 @@
+From fc9868e2247d2eb651586bd4b3e9a4ece3562fa0 Mon Sep 17 00:00:00 2001
+From: zhangguanzhang <zhangguanzhang@qq.com>
+Date: Sun, 13 Jun 2021 20:32:43 +0800
+Subject: [PATCH] Fix panic condition in cgroups.getAvailableControllers
+
+Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
+---
+ pkg/cgroups/cgroups.go | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
+index 911edeb5bee..9cb32a36446 100644
+--- a/pkg/cgroups/cgroups.go
++++ b/pkg/cgroups/cgroups.go
+@@ -165,14 +165,13 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool)
+ if _, found := exclude[name]; found {
+ continue
+ }
+- isSymLink := false
+ fileInfo, err := os.Stat(cgroupRoot + "/" + name)
+ if err != nil {
+- isSymLink = !fileInfo.IsDir()
++ continue
+ }
+ c := controller{
+ name: name,
+- symlink: isSymLink,
++ symlink: !fileInfo.IsDir(),
+ }
+ controllers = append(controllers, c)
+ }