-
Notifications
You must be signed in to change notification settings - Fork 10
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
URI encoding problems with passwords #4
Comments
Thanks for reporting this issue! I just made a commit that should fix both issues. Can you confirm that? |
Thanks for taking a look. I'll do some testing. But looking at your commit, I'm not sure using URLEncoder is the right thing to do; it's meant for |
Fair point. But do we expect spaces in usernames and password? |
I dunno. Pretty unlikely for sure, but I don't know enough about SMB to know if it's actually illegal. |
Ok, I tested. You fixed the first problem, but not the second.
|
Passwords with certain URI-reserved characters, like
/
and#
, present challenges.If you use
/
in the env map sent toSmbFileSystemProvider.newFilesystem(URI, Map)
, it is not percent-encoded before being concatenated into the URL that is fed into SmbFile, and you can get odd errors as a result.For example, using username "foo" and password "bar/", you get
To work around this, I would have to percent-encode the password in the env map.
A related problem is when I put the password into the URI (and not the env map) that I pass in to
SmbFileSystemProvider.newFilesystem(URI, Map)
. In this case, I have to percent-encode the password so that I can construct a valid URI.But SMBFileSystemProvider decodes this password, and does not re-encode it, when it sends it on to SmbFile.
So a uri like
smb://foo:bar%[email protected]/some_share
results in a stack trace like this:To work around this, I would have to double percent-encode the password in the URI.
The text was updated successfully, but these errors were encountered: