Skip to content

Commit 6017fb6

Browse files
committed
artifact: implement findHomeDir helper as specified
This makes a couple small changes to the findHomeDir helper function to properly match the described behavior. It will attempt to use os.UserHomeDir first, and if no path can be discovered, it will return /dev/null.
1 parent fb618ba commit 6017fb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/allocrunner/taskrunner/getter/util_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var initialDirs = map[string]string{
2424
"/usr/libexec": "rx",
2525
}
2626

27-
// findHomeDir returns the home directory as provided by os.UserHomeDir. In case
27+
// findHomeDir returns the home directory as provided by homedir.Dir(). In case
2828
// os.UserHomeDir returns an error, we return /root if the current process is being
2929
// run by root, or /dev/null otherwise.
3030
func findHomeDir() string {
@@ -42,7 +42,7 @@ func findHomeDir() string {
4242
}
4343

4444
// nothing safe to do
45-
return "/nonexistent"
45+
return "/dev/null"
4646
}
4747

4848
// findConfigDir returns the config directory as provided by os.UserConfigDir. In

0 commit comments

Comments
 (0)