mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
optimize(db): set database directory permission to 0750 to protect privacy
This commit is contained in:
1 parent
6e30ad4e77
commit
7d8017d631
2 files changed
+3
-2
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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?
|
||||
|
||||
Reference in new issue
Block a user