mirror of
https://github.com/rclone/rclone.git
synced 2025-01-23 14:49:25 +01:00
sftp: read $USER in username fallback not $HOME
This commit is contained in:
parent
28480c0570
commit
052c886317
@ -123,8 +123,8 @@ func readCurrentUser() (userName string) {
|
||||
if err == nil {
|
||||
return usr.Username
|
||||
}
|
||||
// Fall back to reading $HOME then $LOGNAME
|
||||
userName = os.Getenv("HOME")
|
||||
// Fall back to reading $USER then $LOGNAME
|
||||
userName = os.Getenv("USER")
|
||||
if userName != "" {
|
||||
return userName
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user