plugin sandbox fixes (#8418)

This commit is contained in:
Chris
2018-03-07 12:43:26 -06:00
committed by Derrick Anderson
parent af758c8e5d
commit e4ddad16bf

View File

@@ -267,7 +267,7 @@ func pivotRoot(newRoot string) error {
func dropInheritableCapabilities() error {
type capHeader struct {
version uint32
pid int
pid int32
}
type capData struct {
@@ -425,6 +425,15 @@ func checkSupportInNamespace() error {
return errors.Wrapf(err, "unable to enable seccomp filter")
}
if f, err := os.Create(os.DevNull); err != nil {
return errors.Wrapf(err, "unable to open os.DevNull")
} else {
defer f.Close()
if _, err = f.Write([]byte("foo")); err != nil {
return errors.Wrapf(err, "unable to write to os.DevNull")
}
}
return nil
}