Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup from RJ Kroege's comments to an earlier PR #282

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading