Commit 8406fd7
GH-9794: Encode SMB domain, username & password before SmbFile
Fixes: #9794
Issue link: #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 <110663902+smitsjelle@users.noreply.github.com>
[artem.bilan@broadcom.com: some code cleanup]
* Add author to the affected classes
* Remove redundant explicit exceptions list from the `SmbMessageHistoryTests`
Signed-off-by: Artem Bilan <artem.bilan@broadcom.com>
(cherry picked from commit fcd90a9)1 parent e73c3f2 commit 8406fd7
File tree
2 files changed
+31
-12
lines changed- spring-integration-smb/src
- main/java/org/springframework/integration/smb/session
- test/java/org/springframework/integration/smb
2 files changed
+31
-12
lines changedLines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
166 | | - | |
| 169 | + | |
167 | 170 | | |
| 171 | + | |
| 172 | + | |
168 | 173 | | |
169 | | - | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | | - | |
| 178 | + | |
173 | 179 | | |
174 | | - | |
175 | | - | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
211 | 217 | | |
212 | 218 | | |
213 | 219 | | |
214 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
221 | | - | |
| 229 | + | |
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
226 | 234 | | |
227 | | - | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
| |||
0 commit comments