-
Notifications
You must be signed in to change notification settings - Fork 599
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
Shell expansion does not work #212
Comments
The stack trace is: Exception in thread "main" net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command returned error: scp: *_file: No such file or directory |
I have found this is caused by SCPEngine.java quoting the source path: SCPEngine.java line 112: Why the requirement to quote, could we optionally not quote ? |
linked to #184 |
Have you verified it works without quoting? |
Yes |
OK, what do you suggest as a good approach then? As said in #184 not quoting is not a good idea. Double quotes could work I think, but do they work always? |
Double quotes does not solve the issue. If you want to escape space char then \ works, on Linux at least. I am not sure if a universal escaping solution exists across operating system, file systems and ssh servers. Leaving escaping to the user or at least a way of opting out of escaping is required for sshj to at least be functional without a universal escaping mechanism. I am currently using jsch and unfortunately can't move to sshj until this is resolved. |
Could we start compiling a list of all the characters that need to be escaped, across platforms and see if there is a common set? In the mean time can we leave escaping to the user, or at least make it optional by providing a Typed interface, eg. RemoteFile which will be escaped and String remoteFile which leaves it up to the user? |
Thanks for this patch, I'll test it out. |
Let me know. It seems that actually Apache Mina does not need any escaping. I have not had the time to test it out on OpenSSH and others. If you could let me know the results of your tests? |
It's working for our use cases with openssh. |
It seems as though shell expansion is not supported is this correct or am I doing something wrong.
The example below will not find the file test_file
unless you explicitly specify "test_file"
Thanks
The text was updated successfully, but these errors were encountered: