Skip to content

Commit 3cf8266

Browse files
committed
chore: lint
1 parent d40a86c commit 3cf8266

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/file/file_manager_service.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const (
4242
maxAttempts = 5
4343
manifestDirPath = "/var/lib/nginx-agent"
4444
manifestFilePath = manifestDirPath + "/manifest.json"
45+
dirPerm = 0o755
46+
filePerm = 0o600
4547
)
4648

4749
type (
@@ -527,12 +529,12 @@ func (fms *FileManagerService) UpdateManifestFile(currentFiles map[string]*mpi.F
527529
}
528530

529531
// 0755 allows read/execute for all, write for owner
530-
if err = os.MkdirAll(manifestDirPath, 0o755); err != nil {
532+
if err = os.MkdirAll(manifestDirPath, dirPerm); err != nil {
531533
fmt.Printf("Failed to read manifest file: %v\n", err)
532534
}
533535

534536
// 0600 ensures only root can read/write
535-
newFile, err := os.OpenFile(manifestFilePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
537+
newFile, err := os.OpenFile(manifestFilePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, filePerm)
536538
if err != nil {
537539
slog.Error("Failed to read manifest file", "error", err)
538540
}

0 commit comments

Comments
 (0)