mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Revert "libcontainer: seccomp: pass around *os.File for notifyfd"
This reverts commit 20b95f23ca.
> Conflicts:
> libcontainer/init_linux.go
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
@@ -451,11 +451,11 @@ func syncParentHooks(pipe *syncSocket) error {
|
||||
|
||||
// syncParentSeccomp sends the fd associated with the seccomp file descriptor
|
||||
// to the parent, and wait for the parent to do pidfd_getfd() to grab a copy.
|
||||
func syncParentSeccomp(pipe *syncSocket, seccompFd *os.File) error {
|
||||
if seccompFd == nil {
|
||||
func syncParentSeccomp(pipe *syncSocket, seccompFd int) error {
|
||||
if seccompFd == -1 {
|
||||
return nil
|
||||
}
|
||||
defer seccompFd.Close()
|
||||
defer unix.Close(seccompFd)
|
||||
|
||||
// Tell parent to grab our fd.
|
||||
//
|
||||
@@ -466,7 +466,7 @@ func syncParentSeccomp(pipe *syncSocket, seccompFd *os.File) error {
|
||||
// before the parent gets the file descriptor would deadlock "runc init" if
|
||||
// we allowed it for SCMP_ACT_NOTIFY). See seccomp.InitSeccomp() for more
|
||||
// details.
|
||||
if err := writeSyncArg(pipe, procSeccomp, seccompFd.Fd()); err != nil {
|
||||
if err := writeSyncArg(pipe, procSeccomp, seccompFd); err != nil {
|
||||
return err
|
||||
}
|
||||
// Wait for parent to tell us they've grabbed the seccompfd.
|
||||
|
||||
Reference in New Issue
Block a user