Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

bug: Use evalSymlinks to replace filepath.EvalSymlinks #81

Closed
Xuanwo opened this issue Sep 23, 2021 · 1 comment · Fixed by #84
Closed

bug: Use evalSymlinks to replace filepath.EvalSymlinks #81

Xuanwo opened this issue Sep 23, 2021 · 1 comment · Fixed by #84

Comments

@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 23, 2021

go-service-fs/utils.go

Lines 69 to 83 in f60980c

if opt.HasWorkDir {
workDir, err := filepath.EvalSymlinks(opt.WorkDir)
if err != nil {
return nil, err
}
store.workDir = workDir
}
// Check and create work dir
err = os.MkdirAll(store.workDir, 0755)
if err != nil {
return nil, err
}
return
}

Current logic will lead to NewStorager return object not exist error like https://github.com/beyondstorage/beyond-tp/pull/167/checks?check_run_id=3649077637

2021-09-20T07:30:23.817Z	ERROR	task/staff.go:151	format storage	{"error": "fs new_storager: [work_dir: /tmp/b/]: object not exist: lstat /tmp/b: no such file or directory"}
github.com/beyondstorage/beyond-tp/task.(*Staff).Start
	/home/runner/work/beyond-tp/beyond-tp/task/staff.go:151

We need to handle this.

Fix

  • Use evalSymlinks to replace filepath.EvalSymlinks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant