Merge pull request #16633 from dfr/freebsd-cloexec

libpod: Use O_CLOEXEC for descriptors returned by (*Container).openDi…
This commit is contained in:
OpenShift Merge Robot 2022-11-28 03:20:17 -05:00 committed by GitHub
commit 308cdc153d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ func (c *Container) getOCICgroupPath() (string, error) {
func openDirectory(path string) (fd int, err error) { func openDirectory(path string) (fd int, err error) {
const O_PATH = 0x00400000 const O_PATH = 0x00400000
return unix.Open(path, unix.O_RDONLY|O_PATH, 0) return unix.Open(path, unix.O_RDONLY|O_PATH|unix.O_CLOEXEC, 0)
} }
func (c *Container) addNetworkNamespace(g *generate.Generator) error { func (c *Container) addNetworkNamespace(g *generate.Generator) error {