-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
File upload unusual behaviour on a ' character #4535
Milestone
Comments
Yes, that's unfortunately adding an extra escape. Are you interested in submitting a fix? |
I am actually, just pulling everything down to give it a go. Probably should have specified to avoid duplication of efforts! |
BrianDevC
added a commit
to BrianDevC/iss-4535
that referenced
this issue
Oct 27, 2022
Single quotes in folder or file names were causing corruption of the shell command. The fix changes the ' character to '"'"' For example a folder called te'st would now get shellQuoted to 'te'"'"'st' 1. ' ends the first quote, 2. " starts second quote, 3. ' is valid character in double quotes 4. " ends the second quote 5. ' starts the third quote 6. The end result when fed into the shell, is as we desired: te'st fabric8io#4535
11 tasks
BrianDevC
added a commit
to BrianDevC/iss-4535
that referenced
this issue
Oct 27, 2022
Changed to be much shorter as pointed out, manual still passes tests. New test added Changelog moved. fabric8io#4535
BrianDevC
added a commit
to BrianDevC/iss-4535
that referenced
this issue
Oct 28, 2022
Fixed test brackets that mvn spotless:apply unfortunately didn't. fabric8io#4535
BrianDevC
added a commit
to BrianDevC/iss-4535
that referenced
this issue
Nov 1, 2022
Altered some catch statements to catch exceptions rather than throwables for sonar fabric8io#4535
manusa
pushed a commit
to BrianDevC/iss-4535
that referenced
this issue
Nov 4, 2022
Single quotes in folder or file names were causing corruption of the shell command. The fix changes the ' character to '"'"' For example a folder called te'st would now get shellQuoted to 'te'"'"'st' 1. ' ends the first quote, 2. " starts second quote, 3. ' is valid character in double quotes 4. " ends the second quote 5. ' starts the third quote 6. The end result when fed into the shell, is as we desired: te'st fabric8io#4535 iss-4535 Changed to be much shorter as pointed out, manual still passes tests. New test added Changelog moved. iss-4535 Fixed test brackets that mvn spotless:apply unfortunately didn't. fabric8io#4535 iss-4535 Altered some catch statements to catch exceptions rather than throwables for sonar fabric8io#4535
manusa
pushed a commit
that referenced
this issue
Nov 4, 2022
Single quotes in folder or file names were causing corruption of the shell command. The fix changes the ' character to '"'"' For example a folder called te'st would now get shellQuoted to 'te'"'"'st' 1. ' ends the first quote, 2. " starts second quote, 3. ' is valid character in double quotes 4. " ends the second quote 5. ' starts the third quote 6. The end result when fed into the shell, is as we desired: te'st #4535 iss-4535 Changed to be much shorter as pointed out, manual still passes tests. New test added Changelog moved. iss-4535 Fixed test brackets that mvn spotless:apply unfortunately didn't. #4535 iss-4535 Altered some catch statements to catch exceptions rather than throwables for sonar #4535
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A file or folder with the single quote ' character in the path name will exhibit unusual behaviour on the upload.
For example if uploading to /data/te'st/file.txt
The following two folders will be created. All square brackets[] added here to emphasize individual folders, they do not show up in the test.
Empty folder:
/[data]/[te'st]/
Folder with empty file.txt
/[data]/[te\st && base64 -d - >]/[data]/[te\st]/file.txt
Fabric8 Kubernetes Client version
5.12.4
Steps to reproduce
Expected behavior
Empty folder:
/data/te'st/
Folder with empty file.txt
/data/te\st && base64 -d - >/data/te\st/file.txt
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.24
Environment
Linux
Fabric8 Kubernetes Client Logs
No response
Additional context
Looks to be the area that's causing the issue is here:
kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/uploadable/PodUpload.java
Line 139 in 0f997aa
Specifically inside the shellQuote function:
The text was updated successfully, but these errors were encountered: