fixing sec issues
Some checks failed
CloudSave/pipeline/head There was a failure building this commit

This commit is contained in:
2025-09-07 01:14:19 +02:00
parent b3232e79d5
commit af11e843a4
13 changed files with 88 additions and 37 deletions

View File

@@ -63,9 +63,15 @@ func (p *SyncCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
pg := progressbar.New(-1)
destroyPg := func() {
pg.Finish()
pg.Clear()
pg.Close()
if err := pg.Finish(); err != nil {
slog.Error("failed to finish progressbar", "err", err)
}
if err := pg.Clear(); err != nil {
slog.Error("failed to clear progressbar", "err", err)
}
if err := pg.Close(); err != nil {
slog.Error("failed to close progressbar", "err", err)
}
}
pg.Describe(fmt.Sprintf("[%s] Checking status...", g.Name))

View File

@@ -30,7 +30,7 @@ func main() {
}
datastorepath := filepath.Join(roaming, "cloudsave", "data")
err = os.MkdirAll(datastorepath, 0740)
err = os.MkdirAll(datastorepath, 0600)
if err != nil {
panic("cannot make the datastore:" + err.Error())
}

View File

@@ -89,7 +89,7 @@ func save(store map[string]credential) error {
Store: store,
}
f, err := os.OpenFile(filepath.Join(datastorePath, "credential.json"), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0740)
f, err := os.OpenFile(filepath.Join(datastorePath, "credential.json"), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
if err != nil {
return fmt.Errorf("failed to open datastore: %w", err)
}