oasisprotocol / oasisprotocol/oasis-core

throw error, if '~' is used in oasis-node config file for paths

Open
#4,349 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c:bug c:cli p:2
Dominant language
Go
Stars
369
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
6

Description

SUMMARY

Using ~ in the config file for oasis-node does not work, for example:

datadir: ~/node/data

In this case badger will create a new directory called ~ in cwd instead of interpreting the symbol as home and then oasis-node will crash saying it cannot access ~/node/data directory. One can image what a rm -r ~ would then result without escaping the ~ symbol in 😉

EXPECTED RESULTS

I suggest we throw error when parsing the config file, if any of the paths contain ~ symbol. Are there any other special characters in posix paths we should avoid?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the oasis-node configuration parsing entry point and trace how path values reach Badger directory creation. Confirm the intended validation behavior for paths containing ~, and consider the issue's question about other POSIX path characters; done means invalid paths are rejected during parsing with a clear error rather than creating a literal ~ directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.