Description: Comply with libcontainer API changes introduced in runc latest version
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/golang-github-containers-storage/+bug/1939423
Origin: backport, https://github.com/containers/buildah/commit/dfc3875f35d8bb11
Reviewed-By: Lucas Kanashiro <kanashiro@ubuntu.com>
Last-Updated: 2021-08-13

--- a/add.go
+++ b/add.go
@@ -22,7 +22,7 @@
 	"github.com/containers/storage/pkg/fileutils"
 	"github.com/containers/storage/pkg/idtools"
 	"github.com/hashicorp/go-multierror"
-	rsystem "github.com/opencontainers/runc/libcontainer/system"
+	"github.com/opencontainers/runc/libcontainer/userns"
 	"github.com/opencontainers/runtime-spec/specs-go"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
@@ -399,7 +399,7 @@
 						ChmodDirs:     nil,
 						ChownFiles:    nil,
 						ChmodFiles:    nil,
-						IgnoreDevices: rsystem.RunningInUserNS(),
+						IgnoreDevices: userns.RunningInUserNS(),
 					}
 					putErr = copier.Put(extractDirectory, extractDirectory, putOptions, io.TeeReader(pipeReader, hasher))
 				}
@@ -534,7 +534,7 @@
 						ChmodDirs:       nil,
 						ChownFiles:      nil,
 						ChmodFiles:      nil,
-						IgnoreDevices:   rsystem.RunningInUserNS(),
+						IgnoreDevices:   userns.RunningInUserNS(),
 					}
 					putErr = copier.Put(extractDirectory, extractDirectory, putOptions, io.TeeReader(pipeReader, hasher))
 				}
--- a/run_unix.go
+++ b/run_unix.go
@@ -3,12 +3,12 @@
 package buildah
 
 import (
-	"github.com/opencontainers/runc/libcontainer/configs"
+	"github.com/containers/buildah/define"
 	"github.com/pkg/errors"
 )
 
 // ContainerDevices is an alias for a slice of github.com/opencontainers/runc/libcontainer/configs.Device structures.
-type ContainerDevices = []configs.Device
+type ContainerDevices define.ContainerDevices
 
 func setChildProcess() error {
 	return errors.New("function not supported on non-linux systems")
