mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-29 06:26:31 +00:00
more misc plan9 work; it works now
Change-Id: Iafc4ee41dd4d7ba9b9907c8e13bb1e161c8f78e3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -1032,6 +1032,14 @@ func (ss *sshSession) startWithStdPipes() (err error) {
|
||||
}
|
||||
|
||||
func envForUser(u *userMeta) []string {
|
||||
if runtime.GOOS == "plan9" {
|
||||
return []string{
|
||||
fmt.Sprintf("shell=%s", u.LoginShell()),
|
||||
"service=ssh",
|
||||
fmt.Sprintf("USER=%s", u.Username),
|
||||
fmt.Sprintf("home=%s", u.HomeDir),
|
||||
}
|
||||
}
|
||||
return []string{
|
||||
fmt.Sprintf("SHELL=%s", u.LoginShell()),
|
||||
fmt.Sprintf("USER=%s", u.Username),
|
||||
@@ -1108,7 +1116,7 @@ func (ia *incubatorArgs) loginArgs(loginCmdPath string) []string {
|
||||
|
||||
func shellArgs(isShell bool, cmd string) []string {
|
||||
if isShell {
|
||||
if runtime.GOOS == freebsd || runtime.GOOS == openbsd {
|
||||
if runtime.GOOS == freebsd || runtime.GOOS == openbsd || runtime.GOOS == "plan9" {
|
||||
// bsd shells don't support the "-l" option, so we can't run as a login shell
|
||||
return []string{}
|
||||
}
|
||||
|
||||
@@ -672,7 +672,6 @@ type sshSession struct {
|
||||
wrStdin io.WriteCloser
|
||||
rdStdout io.ReadCloser
|
||||
rdStderr io.ReadCloser // rdStderr is nil for pty sessions
|
||||
ptyReq *ssh.Pty // non-nil for pty sessions
|
||||
|
||||
// childPipes is a list of pipes that need to be closed when the process exits.
|
||||
// For pty sessions, this is the tty fd.
|
||||
@@ -903,7 +902,7 @@ func (ss *sshSession) run() {
|
||||
defer t.Stop()
|
||||
}
|
||||
|
||||
if euid := os.Geteuid(); euid != 0 {
|
||||
if euid := os.Geteuid(); euid != 0 && runtime.GOOS != "plan9" {
|
||||
if lu.Uid != fmt.Sprint(euid) {
|
||||
ss.logf("can't switch to user %q from process euid %v", lu.Username, euid)
|
||||
fmt.Fprintf(ss, "can't switch user\r\n")
|
||||
|
||||
Reference in New Issue
Block a user