Skip to content

Atomically create API file #7227

@Stebalien

Description

@Stebalien

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/intermediatePrior experience is likely helpfulhelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)topic/daemon + init

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions