Skip to content

Commit

Permalink
fix gosec
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Jul 24, 2024
1 parent f853b94 commit f8e131a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/daemon/netns_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func getCurrentThreadNetNSPath() string {
}

func newNetNS(path string) error {
mountPointFd, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o666)
mountPointFd, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o666) // #nosec G302,G304
if err != nil {
return err
}
mountPointFd.Close()
_ = mountPointFd.Close()

defer func() {
// Ensure the mount point is cleaned up on errors
Expand Down

0 comments on commit f8e131a

Please sign in to comment.