diff --git a/cmds/cpu/cpu.go b/cmds/cpu/cpu.go index bab5211f..abc9b43e 100644 --- a/cmds/cpu/cpu.go +++ b/cmds/cpu/cpu.go @@ -143,6 +143,13 @@ func newCPU(host string, args ...string) (retErr error) { // Also, because of how sshd works, we need to pass in // a PWD that is correct; otherwise it gets lost, since // since ssh wants to simulate a login.. + // Per rjkroege's comment: + // "This code for building the port and environment seems + // twisty and exactly the kind of thing that would benefit + // from being pulled out into utility functions that + // have some tests to make sure that the environment is sane?" + // If you are looking for something to contribute to, here is + // your chance. if *sshd && *srvnfs { env := append(os.Environ(), "CPU_PWD="+os.Getenv("PWD")) envargs := "-env=" + strings.Join(env, "\n") diff --git a/cmds/cpu/doc.go b/cmds/cpu/doc.go index 4612740f..f620db28 100644 --- a/cmds/cpu/doc.go +++ b/cmds/cpu/doc.go @@ -73,9 +73,6 @@ // // -9p bool // enable the 9p server in the client (default enabled) -// Note that the 9p server is also enabled if the namespace -// is not empty. To ensure the 9p server is not set, -// cpu -9p=f -namespace="" // -d // enable debug prints // -dbg9p @@ -264,10 +261,13 @@ // Plan 9 papers on cpu, but be aware there are many subtle details visible only // in code. // -// You can now tentatively talk to standard sshd. +// You can now talk to a standard sshd. // Here is an example: // ./cpu -nfs=true -9p=false -d -key ~/.ssh/homemac -sp 22 127.0.0.1 -// A few things: 9p has to be off, since sshd don't understand the -9 switch +// For this case, because it is port 22, cpu will arraange for cpuns +// to run with the sudo command. +// If the nfs switch is true, you must have sudo installed. +// Also: 9p has to be off, since sshd does not understand the -9 switch. // Failing to Setenv is no longer an error, so you may not be able to set things // like SHELL. package main