tsh: Add wrapper for syscall.Dup2 for linux/arm64#55925
Merged
Conversation
8714b50 to
1b05da7
Compare
1b05da7 to
4cad3bd
Compare
Add a wrapper for `syscall.Dup2()` as linux ARM64 does not have that syscall. On that platform, `syscall.Dup3()` needs to be used instead. Fixes: 57c909d
4cad3bd to
8ac1321
Compare
bl-nero
approved these changes
Jun 20, 2025
tigrato
approved these changes
Jun 20, 2025
espadolini
reviewed
Jun 20, 2025
espadolini
approved these changes
Jun 23, 2025
| // You should have received a copy of the GNU Affero General Public License | ||
| // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //go:build !linux |
Contributor
There was a problem hiding this comment.
I don't think windows has syscall.Dup2, and tsh is one of those things that we build for windows too.
Suggested change
| //go:build !linux | |
| //go:build unix && !linux |
Contributor
Author
There was a problem hiding this comment.
my expectation was that the _unix in the filename added that constraint, but I'll add it here to be sure.
Contributor
There was a problem hiding this comment.
It does not, unix is a valid build constraint but not one that gets checked as part of implicit constraints in filenames (https://pkg.go.dev/cmd/go#hdr-Build_constraints) because those are only for GOOS and/or GOARCH. 🥲
atburke
pushed a commit
that referenced
this pull request
Jun 24, 2025
* tsh: Add wrapper for syscall.Dup2 for linux/arm64 Add a wrapper for `syscall.Dup2()` as linux ARM64 does not have that syscall. On that platform, `syscall.Dup3()` needs to be used instead. Fixes: 57c909d * Implement dup2 with syscall.Dup3 on all linux platforms * Add explicit "unix" constraint to dup2_unix.go to ensure Windows is excluded
atburke
pushed a commit
that referenced
this pull request
Jun 24, 2025
* tsh: Add wrapper for syscall.Dup2 for linux/arm64 Add a wrapper for `syscall.Dup2()` as linux ARM64 does not have that syscall. On that platform, `syscall.Dup3()` needs to be used instead. Fixes: 57c909d * Implement dup2 with syscall.Dup3 on all linux platforms * Add explicit "unix" constraint to dup2_unix.go to ensure Windows is excluded
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jun 24, 2025
* Add fork after authentication for tsh ssh (#54696) This change adds fork after authentication support to tsh ssh. * tsh: Add wrapper for syscall.Dup2 for linux/arm64 (#55925) * tsh: Add wrapper for syscall.Dup2 for linux/arm64 Add a wrapper for `syscall.Dup2()` as linux ARM64 does not have that syscall. On that platform, `syscall.Dup3()` needs to be used instead. Fixes: 57c909d * Implement dup2 with syscall.Dup3 on all linux platforms * Add explicit "unix" constraint to dup2_unix.go to ensure Windows is excluded --------- Co-authored-by: Cam Hutchison <camh@goteleport.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jun 26, 2025
* Add fork after authentication for tsh ssh (#54696) This change adds fork after authentication support to tsh ssh. * tsh: Add wrapper for syscall.Dup2 for linux/arm64 (#55925) * tsh: Add wrapper for syscall.Dup2 for linux/arm64 Add a wrapper for `syscall.Dup2()` as linux ARM64 does not have that syscall. On that platform, `syscall.Dup3()` needs to be used instead. Fixes: 57c909d * Implement dup2 with syscall.Dup3 on all linux platforms * Add explicit "unix" constraint to dup2_unix.go to ensure Windows is excluded --------- Co-authored-by: Cam Hutchison <camh@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a wrapper for
syscall.Dup2()as linux ARM64 does not have thatsyscall. On that platform,
syscall.Dup3()needs to be used instead.Fixes: 57c909d
Related: #54696