From 60ace31be078834605ee318842f32a0193083ebb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 2 Oct 2022 01:02:22 +0200 Subject: [PATCH] libnetwork: sandbox.updateDNS(): use const for file permissions Signed-off-by: Sebastiaan van Stijn --- libnetwork/sandbox_dns_unix.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnetwork/sandbox_dns_unix.go b/libnetwork/sandbox_dns_unix.go index 13ab515782..8206df6742 100644 --- a/libnetwork/sandbox_dns_unix.go +++ b/libnetwork/sandbox_dns_unix.go @@ -20,8 +20,8 @@ import ( const ( defaultPrefix = "/var/lib/docker/network/files" - dirPerm = 0755 - filePerm = 0644 + dirPerm = 0o755 + filePerm = 0o644 ) func (sb *sandbox) startResolver(restore bool) { @@ -332,7 +332,7 @@ func (sb *sandbox) updateDNS(ipv6Enabled bool) error { if err != nil { return err } - err = os.WriteFile(sb.config.resolvConfPath, newRC.Content, 0644) //nolint:gosec // gosec complains about perms here, which must be 0644 in this case + err = os.WriteFile(sb.config.resolvConfPath, newRC.Content, filePerm) if err != nil { return err }