[forwardport] fix(ooniprobe): ensure tunnelDir is correctly set (#694)
This commit forward ports 59c63ee0b2249c803c40f1eb19c0f6c062838bf1, whose original log message follows: - - - While doing QA in https://github.com/ooni/probe/issues/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.
This commit is contained in:
parent
00b5c73c3a
commit
fbae9ddece
|
@ -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
|
||||
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue
Block a user