Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Restrict vault.json permssion to owner and using random suffix for temp vault.json file #8932

Merged
merged 2 commits into from
Jun 22, 2018

Conversation

sorpaas
Copy link
Collaborator

@sorpaas sorpaas commented Jun 20, 2018

In an unlucky situation, multiple process (which may be incorrectly started to run on the same chain) can decide to write to vault_temp.json file at the same time, resulting in a corrupted file. We don't protect this in key files right now, but given the original intention to write to vault_temp.json and then atomically rename to vault.json is to prevent similar type of thing, I think it would work better to use a random suffix if vault_temp.json file already exists.

This also restricts newly created vault.json file with permission owner only.

@sorpaas sorpaas added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jun 20, 2018
@sorpaas sorpaas added this to the 1.12 milestone Jun 20, 2018
@5chdn
Copy link
Contributor

5chdn commented Jun 22, 2018

Needs a 2nd review.

@andresilva andresilva merged commit 5ae8e8a into master Jun 22, 2018
@5chdn 5chdn deleted the sorpaas/vault-json-permission branch June 22, 2018 16:24
@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 22, 2018
dvdplm added a commit that referenced this pull request Jun 22, 2018
* master:
  Add type for passwords. (#8920)
  deps: bump fs-swap (#8953)
  Eliminate some more `transmute()` (#8879)
  Restrict vault.json permssion to owner and using random suffix for temp vault.json file (#8932)
  print SS.self_public when starting SS node (#8949)
  scripts: minor improvements (#8930)
ordian added a commit to ordian/parity that referenced this pull request Jun 27, 2018
…rp_sync_on_light_client

* 'master' of https://github.com/paritytech/parity:
  deps: bump fs-swap (openethereum#8953)
  Eliminate some more `transmute()` (openethereum#8879)
  Restrict vault.json permssion to owner and using random suffix for temp vault.json file (openethereum#8932)
  print SS.self_public when starting SS node (openethereum#8949)
  scripts: minor improvements (openethereum#8930)
  rpc: cap gas limit of local calls (openethereum#8943)
  docs: update changelogs (openethereum#8931)
  ethcore: fix compilation when using slow-blocks or evm-debug features (openethereum#8936)
  fixed blooms dir creation (openethereum#8941)
  Update hardcoded headers (openethereum#8925)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants