Skip to content

Commit

Permalink
Merge branch 'main' into tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
rminnich authored Sep 26, 2024
2 parents 7ebfe67 + d2fca5a commit 84b31ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions cmds/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions cmds/cpu/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 arrange 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

0 comments on commit 84b31ba

Please sign in to comment.