mirror of
https://github.com/rclone/rclone.git
synced 2025-06-23 05:21:50 +02: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 {
|
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…
x
Reference in New Issue
Block a user