Skip to content

Commit

Permalink
fix(ooniprobe): ensure tunnelDir is correctly set
Browse files Browse the repository at this point in the history
While doing QA in ooni/probe#1845, I
noticed we're not using the correct directory.

Results are written in the current directory inside of the OONI_HOME,
which is quite not what we want to happen.

This diff WILL require forward porting to master.
  • Loading branch information
bassosimone committed Feb 11, 2022
1 parent 36ba363 commit 59c63ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ooniprobe/internal/ooni/ooni.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func (p *Probe) Init(softwareName, softwareVersion string) error {
return errors.Wrap(err, "creating TempDir")
}
p.tempDir = tempDir
p.tunnelDir = utils.TunnelDir(p.home)

p.softwareName = softwareName
p.softwareVersion = softwareVersion
Expand All @@ -205,7 +206,7 @@ func (p *Probe) NewSession(ctx context.Context) (*engine.Session, error) {
if err != nil {
return nil, errors.Wrap(err, "creating engine's kvstore")
}
if err := os.MkdirAll(utils.TunnelDir(p.home), 0700); err != nil {
if err := os.MkdirAll(p.tunnelDir, 0700); err != nil {
return nil, errors.Wrap(err, "creating tunnel dir")
}
return engine.NewSession(ctx, engine.SessionConfig{
Expand Down

0 comments on commit 59c63ee

Please sign in to comment.