From a9f3b548e5f5b4e9756ddffbbe0c3ad34f1bc256 Mon Sep 17 00:00:00 2001 From: ycc Date: Fri, 5 Jan 2024 17:01:36 +0100 Subject: [PATCH] permission fixes --- client/config.go | 14 ++++++++------ server/identity.go | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/config.go b/client/config.go index 20a993b..dc392a2 100644 --- a/client/config.go +++ b/client/config.go @@ -8,8 +8,10 @@ import ( type Config struct { // UserConfig - SavePassword bool `json:"save_password,omitempty"` - SavedPassword string `json:"saved_password,omitempty"` + SavePassword bool `json:"save_password,omitempty"` + SavedPassword string `json:"saved_password,omitempty"` + PasswordTip string `json:"password_tip,omitempty"` + PasswordTipUnlock string `json:"password_tip_unlock,omitempty"` // Technical IdentityFile string `json:"identity_file,omitempty"` StoragePath string `json:"storage_path,omitempty"` @@ -42,9 +44,9 @@ type Config struct { DbSuffix string `json:"db_suffix,omitempty"` // Inner - memoryPassword string `json:"memory_password,omitempty"` - additionalPasswords []string `json:"additional_passwords,omitempty"` - me *Identity `json:"me,omitempty"` + memoryPassword string + additionalPasswords []string + me *Identity } var instance *Config @@ -74,7 +76,7 @@ func (c *Config) Save(filename string) error { if err != nil { return err } - os.WriteFile(filename, data, 0644) + os.WriteFile(filename, data, 0600) if err != nil { return err } diff --git a/server/identity.go b/server/identity.go index 6963eae..fabda18 100644 --- a/server/identity.go +++ b/server/identity.go @@ -52,7 +52,7 @@ func (id *Identity) Save(file string) error { if err != nil { return err } - err = os.WriteFile(file, []byte(armor), 0644) + err = os.WriteFile(file, []byte(armor), 0600) return err }