diff --git a/service/db/nutsdb.go b/service/db/nutsdb.go index 092c324f..5b588679 100644 --- a/service/db/nutsdb.go +++ b/service/db/nutsdb.go @@ -17,8 +17,9 @@ func initDB() { opt := nutsdb.DefaultOptions opt.Dir = confPath db, err = nutsdb.Open(opt) + // for privacy + defer os.Chmod(confPath, os.ModeDir|0750) if err != nil { - _ = os.Chmod(confPath, os.ModeDir|0755) log.Fatal(err) } } diff --git a/service/pre.go b/service/pre.go index a4f6a261..df42b127 100644 --- a/service/pre.go +++ b/service/pre.go @@ -135,7 +135,7 @@ func initConfigure() { //db confPath := global.GetEnvironmentConfig().Config if _, err := os.Stat(confPath); os.IsNotExist(err) { - _ = os.MkdirAll(path.Dir(confPath), os.ModeDir|0755) + _ = os.MkdirAll(path.Dir(confPath), os.ModeDir|0750) } if configure.IsConfigureNotExists() { // need to migrate?