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

Atomically create API file #7227

Closed
Stebalien opened this issue Apr 27, 2020 · 0 comments · Fixed by #7282
Closed

Atomically create API file #7227

Stebalien opened this issue Apr 27, 2020 · 0 comments · Fixed by #7282
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/daemon + init

Comments

@Stebalien
Copy link
Member

We should:

  1. Atomically create the IPFS_HOME/api file to ensure we never leave an empty/corrupt one behind. The relevant code is in the SetAPIAddr function in repo/fsrepo/fsrepo.go. We should create a temporary file, write to the temporary file, then atomically rename to "api".
  2. If we read the "api" file and it's empty, we should ignore it.

Reported on the forums: https://discuss.ipfs.io/t/error-multiaddr-must-start-with-a/7824

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue topic/daemon + init P2 Medium: Good to have, but can wait until someone steps up exp/intermediate Prior experience is likely helpful labels Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/daemon + init
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant