Skip to content

Commit

Permalink
Merge pull request #210 from cpuguy83/open_cloexec
Browse files Browse the repository at this point in the history
Fix potential dirfd leak.
  • Loading branch information
crosbymichael authored Nov 20, 2021
2 parents 9ada639 + 17fece8 commit 2b95ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ func setDevices(path string, devices []specs.LinuxDeviceCgroup) error {
if err != nil {
return err
}
dirFD, err := unix.Open(path, unix.O_DIRECTORY|unix.O_RDONLY, 0600)
dirFD, err := unix.Open(path, unix.O_DIRECTORY|unix.O_RDONLY|unix.O_CLOEXEC, 0600)
if err != nil {
return fmt.Errorf("cannot get dir FD for %s", path)
}
Expand Down

0 comments on commit 2b95ef0

Please sign in to comment.