forked from TrueCloudLab/rclone
sftp: read $USER in username fallback not $HOME
This commit is contained in:
parent
28480c0570
commit
052c886317
1 changed files with 2 additions and 2 deletions
|
@ -123,8 +123,8 @@ func readCurrentUser() (userName string) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return usr.Username
|
return usr.Username
|
||||||
}
|
}
|
||||||
// Fall back to reading $HOME then $LOGNAME
|
// Fall back to reading $USER then $LOGNAME
|
||||||
userName = os.Getenv("HOME")
|
userName = os.Getenv("USER")
|
||||||
if userName != "" {
|
if userName != "" {
|
||||||
return userName
|
return userName
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue