Establish stricter sqlite file permissions (#21947)

This commit is contained in:
Michael Geers 2025-06-21 11:10:45 +02:00 • committed by GitHub
parent 1333a07664
commit 4d10dcf562
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,7 @@ func New(driver, dsn string) (*gorm.DB, error) {
return nil, err
}
log.INFO.Println("using sqlite database:", file)
if err := os.MkdirAll(filepath.Dir(file), os.ModePerm); err != nil {
if err := os.MkdirAll(filepath.Dir(file), 0700); err != nil {
return nil, err
}
// avoid busy errors