| Summary: | Obscure file names caused sync to fail | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] PTP | Reporter: | Will Sharber <wsharber> | ||||||
| Component: | Remote Tools | Assignee: | Project Inbox <ptp-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | drwootton, g.watson, jdeblen1, roland | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 5.0.2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Will Sharber
Created attachment 201609 [details]
Obscure filenames patch
Here is the patch.
1. I have authored, 100% of the content contained within the patch.
2. I have the rights to contribute the content to the PTP project.
3. I agree I am contributing the content under the EPL.
Created attachment 201648 [details] Obscure filenames patch modified to handle single quotes This patch handles single quotes correctly. (Only two source lines were modified from Will's original patch.) The following website explains why single quotes are a special case: http://muffinresearch.co.uk/archives/2007/01/30/bash-single-quotes-inside-of-single-quoted-strings/ This patch alters the fundamental operation of the process builder, making it similar to java's process builder, which also escapes special characters. Since it could affect the operation of any code using the RemoteToolsProcessBuilder, we would appreciate some feedback from developers and users of this class. Please review the patch and test it for your particular use case. The patch works well for synchronization projects, but there may be cases where character escaping breaks other code. This could happen, for example, if there is code that already escapes characters or code that wants to preserve the shell meaning of special characters. The LocalProcessBuilder, by the way, also escapes characters. So any code broken by this patch may also not work correctly with the LocalProcessBuilder. The RSEProcessBuilder, on the other hand, seems to not do any escaping of characters. Patch added to PTP_5_0 and HEAD with minor changes: 1) Fix non-externalized strings. 2) Do not escape non-ASCII characters (> 127), which can break UTF encodings. I think there is a problem with this patch escaping ';' characters in the command string in RemoteToolsProcessBuilder. I have a command which is supposed to be executed as "export IHPCT_BASE=/opt/ibmhpc/ppedev.hpct; /opt/ibmhpc/ppedev.hpct/bin/hpctInst -bas /u/wootton/shallow_aix/shallow" where the IHPCT_BASE environment variable is supposed to be set for the hpctInst command to use. This command fails with shell (bash) error messages complaining /opt/ibmhpc/ppedev.hpct/bin/hpctInst is not an identifier. If I add ';' to the set of characters in the trustedString variable then my command runs successfully. I'm not sure if there are implications for other cases. I think '=' and '@' also need to be included as these shouldn't be escaped. I've added all three to trustedChars and am running a new build. Actually, in hindsight, this is probably correct as is. To set an environment variable, you should use IRemoteProcessBuilder#envrionment() instead. |