Skip to content

GH-9794: Allow usage of '@' in SMB domain, username and password #9795

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

Closed
wants to merge 1 commit into from

Conversation

smitsjelle
Copy link
Contributor

Fixes: #9794

The SmbConfig.rawUrl() method doesn't apply any URL encoding, resulting in parts of the domainUserPass that may contain a @ character to break the URL logic in regard to determining the hostname.

  • Modify SmbConfig.getDomainUserPass(_includePassword) to conditionally encode the variables. Makes sure to encode the individual parts to not undesirably encode the ; and : characters, breaking other logic.
  • Modify SmbConfig.rawUrl(_includePassword) and SmbConfig.createUri(_includePassword) to call the modified method with the correct _urlEncode variable

…d password

Fixes: spring-projects#9794

The `SmbConfig.rawUrl()` method doesn't apply any URL encoding, resulting in parts of the `domainUserPass` that may contain a `@` character to break the URL logic in regard to determining the hostname.

* Modify `SmbConfig.getDomainUserPass(_includePassword)` to conditionally encode the variables. Makes sure to encode the individual parts to not undesirably encode the `;` and `:` characters, breaking other logic.
* Modify `SmbConfig.rawUrl(_includePassword)` and `SmbConfig.createUri(_includePassword)` to call the modified method with the correct `_urlEncode` variable

Signed-off-by: Jelle Smits <[email protected]>
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Please, also add your name as @author to all the effected classes.

@artembilan
Copy link
Member

Merged as 36e4012.

Thank you for contribution; looking forward for more!

@artembilan artembilan closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@ character is no longer supported in SMB domain, username or password
2 participants