Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z0 - fix storage load/save #139

Closed
wants to merge 1 commit into from
Closed

z0 - fix storage load/save #139

wants to merge 1 commit into from

Conversation

jansaidl
Copy link
Contributor

@jansaidl jansaidl commented Apr 1, 2024

No description provided.

Comment on lines +47 to +49
if err := os.Remove(h.config.FilePath); err != nil {
return errors.WithStack(err)
}
Copy link
Contributor

@janhajek-outreach janhajek-outreach Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to delete the file?

}

f, err := file.Open(h.config.FilePath, os.O_RDONLY, h.config.FileMode)
f, err := os.Open(h.config.FilePath)
Copy link
Contributor

@janhajek-outreach janhajek-outreach Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally removed the h.config.FileMode part? The file can contain a private key, so we agreed on 0600 permissions.

#135 (comment)

@@ -82,6 +74,9 @@ func (h *Handler[T]) save(data T) error {
h.data = data

if err := func() error {
if err := os.MkdirAll(filepath.Dir(h.config.FilePath), 0755); err != nil {
Copy link
Contributor

@janhajek-outreach janhajek-outreach Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0755 is intentional?

#135 (comment)

@jan-hajek
Copy link
Collaborator

Covered by this PR #141

@jan-hajek jan-hajek closed this Apr 5, 2024
@tikinang tikinang deleted the z0-fix-storage branch July 2, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants