teleport: patch os.Executable() call in tsh
This commit is contained in:
parent
2b3ac063a4
commit
abc4290fa1
|
@ -27,6 +27,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ zip makeWrapper ];
|
nativeBuildInputs = [ zip makeWrapper ];
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/120738
|
||||||
|
patches = [ ./tsh.patch ];
|
||||||
|
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
pushd .
|
pushd .
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
|
17
pkgs/servers/teleport/tsh.patch
Normal file
17
pkgs/servers/teleport/tsh.patch
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go
|
||||||
|
index 57379c40f..cb4d7b84c 100644
|
||||||
|
--- a/tool/tsh/tsh.go
|
||||||
|
+++ b/tool/tsh/tsh.go
|
||||||
|
@@ -514,10 +514,11 @@ func Run(args []string, opts ...cliOption) error {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- cf.executablePath, err = os.Executable()
|
||||||
|
+ tempBinaryPath, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return trace.Wrap(err)
|
||||||
|
}
|
||||||
|
+ cf.executablePath = path.Dir(tempBinaryPath) + "/tsh"
|
||||||
|
|
||||||
|
if err := client.ValidateAgentKeyOption(cf.AddKeysToAgent); err != nil {
|
||||||
|
return trace.Wrap(err)
|
Loading…
Reference in a new issue