Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gaia/app: failure to retrieve the userHome directory should crash loudly instead of just fmt.Println and inserting content into current directory, or at least fallback to using os.TempDir #1874

Closed
1 of 5 tasks
odeke-em opened this issue Nov 4, 2022 · 0 comments · Fixed by #1878

Comments

@odeke-em
Copy link
Contributor

odeke-em commented Nov 4, 2022

Summary of Bug

This code is suspect and it os.UserHomeDir fails, it just incorrectly prints to screen and then uses the empty string to create a filepath which will use the current working directory
in

gaia/app/app.go

Lines 85 to 92 in 842f231

func init() {
userHomeDir, err := os.UserHomeDir()
if err != nil {
stdlog.Println("Failed to get home dir %2", err)
}
DefaultNodeHome = filepath.Join(userHomeDir, ".gaia")
}

image

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
  • Is a spike necessary to map out how the issue should be approached?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant