Commit Graph

7 Commits

Author SHA1 Message Date
Christophe Fergeau
c247b31e20 lint: Fix error appearing after the go 1.24 go.mod change
GOOS=windows /Applications/Xcode.app/Contents/Developer/usr/bin/make lint
"/Users/teuf/dev/gvisor-tap-vsock/tools/bin"/golangci-lint run
cmd/win-sshproxy/main.go:99:17: printf: non-constant format string in call to github.com/sirupsen/logrus.Errorf (govet)
		logrus.Errorf("Error saving thread id: " + err.Error())
		              ^
cmd/win-sshproxy/main.go:111:17: printf: non-constant format string in call to github.com/sirupsen/logrus.Errorf (govet)
		logrus.Errorf("Error occurred in execution group: " + err.Error())

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2025-09-10 10:15:58 +02:00
Gunjan Vyas
c60cf839d6 Fix all linting errors found by cross-lint
Signed-off-by: Gunjan Vyas <vyasgun20@gmail.com>
2025-09-03 13:05:13 +05:30
lstocchi
cf01d72ae6 Warn user and keep executing if Event Log Service is stopped
As reported by https://github.com/containers/podman/issues/21426 , it
may happen that during a Windows update the Event Log Service is
disabled automatically without the user noticing it. In this case win-sshproxy
fails at starting bc it is not able to write logs.

However, the Event Log Service could also be disabled voluntarely by the
user and we cannot be sure that the user want/can re-enable it. In such a case,
a warn log is printed and win-sshproxy keeps executing. It
should be up to the user to decide if to start the Event Log service again or keep
running win-sshproxy without logs.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2025-01-08 14:27:30 +01:00
lstocchi
08769de7e0 win-sshproxy.tid created before thread id is available
this commit fixes a potential race condition that prevented the tests to succeed
when running in a github workflow.
Basically the thread id was not actually available before
writing it on the file, resulting in a thread id equals to 0 written in it.
So, when the tests were trying to retrieve the thread id to use it to send
the WM_QUIT signal, they failed.

This patch adds a check on the thread id before writing
it on the file. Now, if the thread id is 0, it keeps calling winquit to
retrieve it. If, after 10 secs, there is no success it returns an error.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2024-11-29 11:18:44 +01:00
Christophe Fergeau
f64bf1988b cmd/*: Add -version flag to executables
This sets the version to `git describe --always --dirty` using the
`-X github.com/containers/gvisor-tap-vsock/pkg/types.ModuleVersion`
linker flag.

This adds a -version flag to all binaries which currently have
command-line flags.

Correct versioning when installing from tarballs, and through
`go install` will be addressed in the next commits.

This fixes https://github.com/containers/gvisor-tap-vsock/issues/295

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2023-12-20 16:50:09 +01:00
Jason T. Greene
4c6193e834 Add graceful shutdown support for gvproxy on Win
Leverages WM_CLOSE and WM_QUIT events on win32 for SIGTERM like behavior
The improved/updated logic is now implemented in a shared containers/winquit module
Also, refactors win-sshproxy.exe to be consistent (had it's own precursor impl)

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-09-22 13:04:59 +02:00
Jason T. Greene
db04e7ddba Implement windows ssh proxy with windows pipe support
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-01-14 01:33:01 -06:00