Skip to content

Commit 29d910b

Browse files
committed
Remove lint exclude for file and directory permissions
This removes the linting exclusion for warning about directories being created with too open of permissions. We had a few instances of a directory being created with 755 and some file creation permissions dropped to 0600. These do not appear to be needed. Golangci-lint exclusion for the warning is now removed. Signed-off-by: Sean McGinnis <[email protected]>
1 parent 59c620c commit 29d910b

20 files changed

+27
-28
lines changed

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ issues:
7474
# The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
7575
# If it is decided they will not be addressed they should be moved above this comment.
7676
- Subprocess launch(ed with variable|ing should be audited)
77-
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
7877
- (G104|G307)
7978
exclude-rules:
8079
- linters:

cmd/clusterctl/client/repository/repository_local_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func createLocalTestProviderFile(t *testing.T, tmpDir, path, msg string) string
137137

138138
dst := filepath.Join(tmpDir, path)
139139
// Create all directories in the standard layout
140-
g.Expect(os.MkdirAll(filepath.Dir(dst), 0755)).To(Succeed())
140+
g.Expect(os.MkdirAll(filepath.Dir(dst), 0750)).To(Succeed())
141141
g.Expect(os.WriteFile(dst, []byte(msg), 0600)).To(Succeed())
142142

143143
return dst

test/e2e/cluster_upgrade.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func ClusterUpgradeConformanceSpec(ctx context.Context, inputGetter func() Clust
6363
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6464
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6565
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
66-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
66+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6767

6868
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersionUpgradeFrom))
6969
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersionUpgradeTo))

test/e2e/clusterctl_upgrade.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
8383
Expect(input.E2EConfig.Variables).To(HaveKey(initWithBinaryVariableName), "Invalid argument. %s variable must be defined when calling %s spec", initWithBinaryVariableName, specName)
8484
Expect(input.E2EConfig.Variables[initWithBinaryVariableName]).ToNot(BeEmpty(), "Invalid argument. %s variable can't be empty when calling %s spec", initWithBinaryVariableName, specName)
8585
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
86-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
86+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
8787

8888
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.
8989
managementClusterNamespace, managementClusterCancelWatches = setupSpecNamespace(ctx, specName, input.BootstrapClusterProxy, input.ArtifactFolder)
@@ -141,7 +141,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
141141
clusterctlBinaryPath := downloadToTmpFile(clusterctlBinaryURL)
142142
defer os.Remove(clusterctlBinaryPath) // clean up
143143

144-
err := os.Chmod(clusterctlBinaryPath, 0744)
144+
err := os.Chmod(clusterctlBinaryPath, 0744) //nolint:gosec
145145
Expect(err).ToNot(HaveOccurred(), "failed to chmod temporary file")
146146

147147
By("Initializing the workload cluster with older versions of providers")

test/e2e/k8s_conformance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp
6363
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6464
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6565
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
66-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
66+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6767

6868
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
6969
Expect(input.E2EConfig.Variables).To(HaveKey(kubetestConfigurationVariable), "% spec requires a %s variable to be defined in the config file", specName, kubetestConfigurationVariable)

test/e2e/kcp_adoption.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInpu
7575
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
7676
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
7777
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
78-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
78+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
7979
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
8080

8181
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.

test/e2e/kcp_upgrade.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func KCPUpgradeSpec(ctx context.Context, inputGetter func() KCPUpgradeSpecInput)
6060
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6161
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6262
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
63-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
63+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6464
Expect(input.ControlPlaneMachineCount).ToNot(BeZero())
6565
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersionUpgradeTo))
6666
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersionUpgradeFrom))

test/e2e/md_scale.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func MachineDeploymentScaleSpec(ctx context.Context, inputGetter func() MachineD
5757
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
5858
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
5959
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
60-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
60+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6161
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
6262
Expect(input.E2EConfig.Variables).To(HaveValidVersion(input.E2EConfig.GetVariable(KubernetesVersion)))
6363

test/e2e/md_upgrades.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func MachineDeploymentUpgradesSpec(ctx context.Context, inputGetter func() Machi
5858
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
5959
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6060
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
61-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
61+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6262
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
6363
Expect(input.E2EConfig.Variables).To(HaveValidVersion(input.E2EConfig.GetVariable(KubernetesVersion)))
6464
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersionUpgradeFrom))

test/e2e/mhc_remediations.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func MachineRemediationSpec(ctx context.Context, inputGetter func() MachineRemed
5858
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
5959
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6060
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
61-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
61+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6262
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
6363

6464
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.

test/e2e/node_drain_timeout.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func NodeDrainTimeoutSpec(ctx context.Context, inputGetter func() NodeDrainTimeo
6363
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6464
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6565
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
66-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
66+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6767

6868
Expect(input.E2EConfig.GetIntervals(specName, "wait-deployment-available")).ToNot(BeNil())
6969

test/e2e/quick_start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func QuickStartSpec(ctx context.Context, inputGetter func() QuickStartSpecInput)
6060
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6161
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6262
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
63-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
63+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
6464

6565
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
6666

test/e2e/self_hosted.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
6666
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling %s spec", specName)
6767
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling %s spec", specName)
6868
Expect(input.BootstrapClusterProxy).ToNot(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
69-
Expect(os.MkdirAll(input.ArtifactFolder, 0755)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
69+
Expect(os.MkdirAll(input.ArtifactFolder, 0750)).To(Succeed(), "Invalid argument. input.ArtifactFolder can't be created for %s spec", specName)
7070
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion))
7171

7272
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.

test/framework/alltypes_helpers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ func dumpObject(resource runtime.Object, logPath string) {
139139
name := metaObj.GetName()
140140

141141
resourceFilePath := filepath.Clean(path.Join(logPath, namespace, kind, name+".yaml"))
142-
Expect(os.MkdirAll(filepath.Dir(resourceFilePath), 0755)).To(Succeed(), "Failed to create folder %s", filepath.Dir(resourceFilePath))
142+
Expect(os.MkdirAll(filepath.Dir(resourceFilePath), 0750)).To(Succeed(), "Failed to create folder %s", filepath.Dir(resourceFilePath))
143143

144-
f, err := os.OpenFile(resourceFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
144+
f, err := os.OpenFile(resourceFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
145145
Expect(err).ToNot(HaveOccurred(), "Failed to open %s", resourceFilePath)
146146
defer f.Close()
147147

test/framework/clusterctl/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func Move(ctx context.Context, input MoveInput) {
236236
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling Move")
237237
Expect(input.FromKubeconfigPath).To(BeAnExistingFile(), "Invalid argument. input.FromKubeconfigPath must be an existing file when calling Move")
238238
Expect(input.ToKubeconfigPath).To(BeAnExistingFile(), "Invalid argument. input.ToKubeconfigPath must be an existing file when calling Move")
239-
Expect(os.MkdirAll(input.LogFolder, 0755)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for Move")
239+
Expect(os.MkdirAll(input.LogFolder, 0750)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for Move")
240240

241241
By("Moving workload clusters")
242242

test/framework/clusterctl/clusterctl_helpers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func InitManagementClusterAndWatchControllerLogs(ctx context.Context, input Init
5252
Expect(input.ClusterProxy).ToNot(BeNil(), "Invalid argument. input.ClusterProxy can't be nil when calling InitManagementClusterAndWatchControllerLogs")
5353
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling InitManagementClusterAndWatchControllerLogs")
5454
Expect(input.InfrastructureProviders).ToNot(BeEmpty(), "Invalid argument. input.InfrastructureProviders can't be empty when calling InitManagementClusterAndWatchControllerLogs")
55-
Expect(os.MkdirAll(input.LogFolder, 0755)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for InitManagementClusterAndWatchControllerLogs")
55+
Expect(os.MkdirAll(input.LogFolder, 0750)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for InitManagementClusterAndWatchControllerLogs")
5656

5757
if input.CoreProvider == "" {
5858
input.CoreProvider = config.ClusterAPIProviderName
@@ -135,7 +135,7 @@ func UpgradeManagementClusterAndWait(ctx context.Context, input UpgradeManagemen
135135
Expect(input.ClusterProxy).ToNot(BeNil(), "Invalid argument. input.ClusterProxy can't be nil when calling UpgradeManagementClusterAndWait")
136136
Expect(input.ClusterctlConfigPath).To(BeAnExistingFile(), "Invalid argument. input.ClusterctlConfigPath must be an existing file when calling UpgradeManagementClusterAndWait")
137137
Expect(input.Contract).ToNot(BeEmpty(), "Invalid argument. input.Contract can't be empty when calling UpgradeManagementClusterAndWait")
138-
Expect(os.MkdirAll(input.LogFolder, 0755)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for UpgradeManagementClusterAndWait")
138+
Expect(os.MkdirAll(input.LogFolder, 0750)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for UpgradeManagementClusterAndWait")
139139

140140
Upgrade(ctx, UpgradeInput{
141141
ClusterctlConfigPath: input.ClusterctlConfigPath,

test/framework/clusterctl/logger/log_file.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type CreateLogFileInput struct {
3535

3636
func CreateLogFile(input CreateLogFileInput) *LogFile {
3737
filePath := filepath.Join(input.LogFolder, input.Name)
38-
Expect(os.MkdirAll(filepath.Dir(filePath), 0755)).To(Succeed(), "Failed to create log folder %s", filepath.Dir(filePath))
38+
Expect(os.MkdirAll(filepath.Dir(filePath), 0750)).To(Succeed(), "Failed to create log folder %s", filepath.Dir(filePath))
3939

4040
f, err := os.Create(filePath)
4141
Expect(err).ToNot(HaveOccurred(), "Failed to create log file %s", filePath)

test/framework/clusterctl/repository.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (i *CreateRepositoryInput) RegisterClusterResourceSetConfigMapTransformatio
7878
// to a clusterctl config file to be used for working with such repository.
7979
func CreateRepository(ctx context.Context, input CreateRepositoryInput) string {
8080
Expect(input.E2EConfig).ToNot(BeNil(), "Invalid argument. input.E2EConfig can't be nil when calling CreateRepository")
81-
Expect(os.MkdirAll(input.RepositoryFolder, 0755)).To(Succeed(), "Failed to create the clusterctl local repository folder %s", input.RepositoryFolder)
81+
Expect(os.MkdirAll(input.RepositoryFolder, 0750)).To(Succeed(), "Failed to create the clusterctl local repository folder %s", input.RepositoryFolder)
8282

8383
providers := []providerConfig{}
8484
for _, provider := range input.E2EConfig.Providers {
@@ -89,7 +89,7 @@ func CreateRepository(ctx context.Context, input CreateRepositoryInput) string {
8989
Expect(err).ToNot(HaveOccurred(), "Failed to generate the manifest for %q / %q", providerLabel, version.Name)
9090

9191
sourcePath := filepath.Join(input.RepositoryFolder, providerLabel, version.Name)
92-
Expect(os.MkdirAll(sourcePath, 0755)).To(Succeed(), "Failed to create the clusterctl local repository folder for %q / %q", providerLabel, version.Name)
92+
Expect(os.MkdirAll(sourcePath, 0750)).To(Succeed(), "Failed to create the clusterctl local repository folder for %q / %q", providerLabel, version.Name)
9393

9494
filePath := filepath.Join(sourcePath, "components.yaml")
9595
Expect(os.WriteFile(filePath, manifest, 0600)).To(Succeed(), "Failed to write manifest in the clusterctl local repository for %q / %q", providerLabel, version.Name)
@@ -119,7 +119,7 @@ func CreateRepository(ctx context.Context, input CreateRepositoryInput) string {
119119

120120
// set this path to an empty file under the repository path, so test can run in isolation without user's overrides kicking in
121121
overridePath := filepath.Join(input.RepositoryFolder, "overrides")
122-
Expect(os.MkdirAll(overridePath, 0755)).To(Succeed(), "Failed to create the clusterctl overrides folder %q", overridePath)
122+
Expect(os.MkdirAll(overridePath, 0750)).To(Succeed(), "Failed to create the clusterctl overrides folder %q", overridePath)
123123

124124
// creates a clusterctl config file to be used for working with such repository
125125
clusterctlConfigFile := &clusterctlConfig{

test/framework/deployment_helpers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ func WatchDeploymentLogs(ctx context.Context, input WatchDeploymentLogsInput) {
121121
defer GinkgoRecover()
122122

123123
logFile := filepath.Clean(path.Join(input.LogPath, input.Deployment.Name, pod.Name, container.Name+".log"))
124-
Expect(os.MkdirAll(filepath.Dir(logFile), 0755)).To(Succeed())
124+
Expect(os.MkdirAll(filepath.Dir(logFile), 0750)).To(Succeed())
125125

126-
f, err := os.OpenFile(logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
126+
f, err := os.OpenFile(logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
127127
Expect(err).NotTo(HaveOccurred())
128128
defer f.Close()
129129

0 commit comments

Comments
 (0)