mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-06-29 04:01:23 +00:00
26 lines
595 B
Go
26 lines
595 B
Go
//go:build with_gvisor
|
|
|
|
package tailssh
|
|
|
|
import (
|
|
"github.com/sagernet/sing-box/adapter"
|
|
)
|
|
|
|
func resolveLocalUser(platformInterface adapter.PlatformInterface, username string) (*adapter.PlatformUser, error) {
|
|
var (
|
|
localUser *adapter.PlatformUser
|
|
err error
|
|
)
|
|
if platformInterface != nil && platformInterface.UsePlatformShell() {
|
|
localUser, err = platformInterface.LookupUser(username)
|
|
} else {
|
|
localUser, err = resolveLocalUserNative(username)
|
|
}
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if localUser.Shell == "" {
|
|
localUser.Shell = defaultShell()
|
|
}
|
|
return localUser, nil
|
|
}
|