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

x/crypto/ssh/terminal: terminal.Restore returning errno 0 #24718

Closed
henvic opened this issue Apr 6, 2018 · 2 comments
Closed

x/crypto/ssh/terminal: terminal.Restore returning errno 0 #24718

henvic opened this issue Apr 6, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@henvic
Copy link
Contributor

henvic commented Apr 6, 2018

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

And probably on earlier ones as well: https://github.com/dcposch/go/blob/e3d59bc96985b3c03a6926d8771b05d397e68819/client/terminal_nix.go#L84-L86

What operating system and processor architecture are you using (go env)?

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/henvic/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/henvic/projects/gocode"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9j/qvv7_n8d6qb76n0mz3_6m4sc0000gq/T/go-build286491612=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Try to restore the terminal after using terminal.MakeRaw on a shell.

package main

import (
	"golang.org/x/crypto/ssh/terminal"
)

func main() {
	state, err := terminal.MakeRaw(0)

	if err != nil {
		panic(err)
	}

	err = terminal.Restore(0, state)

	if err != nil {
		panic(err)
	}
}

What did you expect to see?

No error.

What did you see instead?

errno 0.

@gopherbot gopherbot added this to the Unreleased milestone Apr 6, 2018
@tklauser tklauser added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 6, 2018
@tklauser
Copy link
Member

tklauser commented Apr 6, 2018

I cannot reproduce this here on linux/amd64 or darwin/amd64 with golang.org/x/crypto at golang/crypto@b2aa354. Are you sure you have an up-to-date copy of golang.org/x/crypto?

@henvic
Copy link
Contributor Author

henvic commented Apr 6, 2018

Nope. I didn't have an up-to-date copy of golang.org/x/crypto. Thank you, @tklauser.

@henvic henvic closed this as completed Apr 6, 2018
@golang golang locked and limited conversation to collaborators Apr 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants