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

Add hostlogin to proxy config for windows desktop #12775

Merged
merged 3 commits into from
May 20, 2022
Merged

Conversation

rcanderson23
Copy link
Contributor

Resolves https://github.com/gravitational/cloud/issues/1635 and #12706

When HostLogin is not set, it attempts to default to the username of the current linux user. This fails when running containers as an arbitrary UID and there is no matching user in /etc/passwd. This value doesn't appear to be used by Windows Desktop Services so it just needs to be set to something to avoid the issue.

@@ -193,6 +193,7 @@ func proxyClient(ctx context.Context, sessCtx *SessionContext, addr string) (*cl
if err := cfg.ParseProxyHost(addr); err != nil {
return nil, trace.Wrap(err)
}
cfg.HostLogin = sessCtx.user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically HostLogin should be the user on the target host, which we have in the username variable we pull from the query string on line 92.

It doesn't really matter, as this is only used when using the ProxyClient to connect to an SSH node, but we do have more accurate information so we might as well use it.

I would also add a comment here:

// HostLogin must be specified in order to avoid defaulting to 
// the local Unix user, which will fail in some environments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: I had time and realized it would be several hours before you're awake, so I went ahead and made the change. Let me know what you think!

Also convert a few TLS handshakes to a context-aware version
for better timeout/cancelation behavior.
@zmb3 zmb3 enabled auto-merge (squash) May 20, 2022 08:52
@zmb3 zmb3 merged commit 7564a5c into master May 20, 2022
@github-actions
Copy link

@rcanderson23 See the table below for backport results.

Branch Result
branch/v9 Create PR

@zmb3 zmb3 deleted the carson/windows-userid branch August 4, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants