Skip to content

Commit 48aa5e2

Browse files
committed
fix: file permissions
1 parent 49aff56 commit 48aa5e2

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

cmd/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var statusCmd = &cobra.Command{
4949
// Read protocol names map
5050
var protocols map[string]*templating.Protocol
5151
if !realProtocolNames {
52-
contents, err := os.ReadFile(path.Join("/etc/bird/", "protocol_names.json"))
52+
contents, err := os.ReadFile(path.Join("/etc/bird/", "protocols.json"))
5353
if err != nil {
5454
log.Fatalf("Reading protocol names: %v", err)
5555
}

pkg/optimizer/optimizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func modifyPref(
203203
modified := lpRegex.ReplaceAllString(string(peerFile), fmt.Sprintf("bgp_local_pref = %d; # pathvector:localpref", newLocalPref))
204204

205205
//nolint:golint,gosec
206-
if err := os.WriteFile(fileName, []byte(modified), 0755); err != nil {
206+
if err := os.WriteFile(fileName, []byte(modified), 0644); err != nil {
207207
log.Fatal(err)
208208
} else {
209209
log.Printf("[Optimizer] Lowered AS%s %s local-pref from %d to %d", peerASN, peerName, currentLocalPref, newLocalPref)

pkg/process/process.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ func Run(configFilename, lockFile, version string, noConfigure, dryRun, withdraw
721721
// If the lockfile doesn't exist, create it
722722
log.Debug("Lockfile doesn't exist, creating one")
723723
//nolint:golint,gosec
724-
if err := os.WriteFile(lockFile, []byte(""), 0755); err != nil {
724+
if err := os.WriteFile(lockFile, []byte(""), 0644); err != nil {
725725
log.Fatalf("Writing lockfile: %v", err)
726726
}
727727
} else {
@@ -825,9 +825,10 @@ func Run(configFilename, lockFile, version string, noConfigure, dryRun, withdraw
825825
if err != nil {
826826
log.Fatalf("Marshalling protocol names: %v", err)
827827
}
828-
file := path.Join(c.BIRDDirectory, "protocol_names.json")
828+
file := path.Join(c.BIRDDirectory, "protocols.json")
829829
log.Debugf("Writing protocol names to %s", file)
830-
if err := os.WriteFile(file, j, 0600); err != nil {
830+
//nolint:golint,gosec
831+
if err := os.WriteFile(file, j, 0644); err != nil {
831832
log.Fatalf("Writing protocol names: %v", err)
832833
}
833834

pkg/util/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestMoveFile(t *testing.T) {
5252
inputString := "Test File"
5353

5454
//nolint:golint,gosec
55-
if err := os.WriteFile("test-cache/source.txt", []byte(inputString), 0755); err != nil {
55+
if err := os.WriteFile("test-cache/source.txt", []byte(inputString), 0644); err != nil {
5656
t.Error(err)
5757
}
5858

0 commit comments

Comments
 (0)