Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ func (c *Config) LoadConfigByUser(username string) {
}

func (c *Config) LoadConfigByPath(path string) {
// Before reading the config file, check that it isn't world-writable.
if worldWritable, _ := isFileWorldWritable(path); worldWritable {
log.Printf(
"Refusing to load configuration from %v: file is world-writable",
path,
)
return
}
yamlFile, err := os.ReadFile(path)
if err != nil {
log.Printf("Failed to %v ", err)
Expand Down
Loading