Skip to content

Commit f1edfd4

Browse files
service: Do not set Mode to 0644 by default
1 parent a101fb8 commit f1edfd4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

service/service.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ type FilePath struct {
145145
}
146146

147147
// UnmarshalYAML implements the yaml.Unmarshaler interface.
148-
// Mode defaults to 0644 if unspecified in the YAML node.
149148
func (lp *FilePath) UnmarshalYAML(node *yaml.Node) error {
150149
switch node.Kind {
151150
case yaml.ScalarNode:
@@ -155,7 +154,7 @@ func (lp *FilePath) UnmarshalYAML(node *yaml.Node) error {
155154
return err
156155
}
157156
lp.Path = path
158-
lp.Mode = 0644
157+
lp.Mode = 0
159158
default:
160159
type noRecursion FilePath
161160
var noRec noRecursion

service/service_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ links:
117117

118118
func TestParseLinksString(t *testing.T) {
119119
expect := map[string]service.FilePath{
120-
"/my/path/file1": {Path: "/tmp/alias1", Mode: 0644},
121-
"my/path/file2": {Path: "/tmp/alias2", Mode: 0o644},
120+
"/my/path/file1": {Path: "/tmp/alias1", Mode: 0o000},
121+
"my/path/file2": {Path: "/tmp/alias2", Mode: 0o000},
122122
}
123123
const doc = `
124124
links:
@@ -202,8 +202,8 @@ copies:
202202

203203
func TestParseCopiesString(t *testing.T) {
204204
expect := map[string]service.FilePath{
205-
"/my/path/file1": {Path: "/tmp/alias1", Mode: 0644},
206-
"my/path/file2": {Path: "/tmp/alias2", Mode: 0o644},
205+
"/my/path/file1": {Path: "/tmp/alias1", Mode: 0o000},
206+
"my/path/file2": {Path: "/tmp/alias2", Mode: 0o000},
207207
}
208208
const doc = `
209209
copies:

0 commit comments

Comments
 (0)