We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35f37a3 commit 62b1814Copy full SHA for 62b1814
modules/setting/setting.go
@@ -1159,6 +1159,19 @@ func CreateOrAppendToCustomConf(callback func(cfg *ini.File)) {
1159
if err := cfg.SaveTo(CustomConf); err != nil {
1160
log.Fatal("error saving to custom config: %v", err)
1161
}
1162
+
1163
+ // Change permissions to be more restrictive
1164
+ fi, err := os.Stat(CustomConf)
1165
+ if err != nil {
1166
+ log.Error("Failed to determine current conf file permissions: %v", err)
1167
+ return
1168
+ }
1169
1170
+ if fi.Mode().Perm() > 0o600 {
1171
+ if err = os.Chmod(CustomConf, 0o600); err != nil {
1172
+ log.Warn("Failed changing conf file permissions to -rw-------. Consider changing them manually.")
1173
1174
1175
1176
1177
// NewServices initializes the services
0 commit comments