Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353377

Summary: Connection name with ":" causes problems
Product: [Tools] Target Management Reporter: Masao Nishimoto <e03616>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh, immaneni, kjdoyle
Version: 3.2.2Flags: kjdoyle: review+
Target Milestone: 3.3.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 357479, 353434    
Attachments:
Description Flags
patch to account for colon in connection name
none
patch to not allow ':' in connection name for connection wizard
none
updated patch to handle ':' when using non-Windows client none

Description Masao Nishimoto CLA 2011-07-28 21:37:49 EDT
SystemRegistry.getSubSystem(String absoluteSubSystemName) returns null, if the connection name in absoluteSubSystemName contains ":".
e.g.
connection name: plex4b:4035
absoluteSubSystemName: NISHIMOTO.plex4b:4035:ibm.mvs.files

As the results, saving a remote file will not be reflected to the remote file, etc.
Comment 1 David McKnight CLA 2011-07-29 10:58:56 EDT
Created attachment 200599 [details]
patch to account for colon in connection name

Masao, could you try with this patch?
Comment 2 David McKnight CLA 2011-07-29 12:22:13 EDT
I'm assuming you'll need a RSE 3.2.x backport for this, so I opened bug 353434 for the backport.
Comment 3 Masao Nishimoto CLA 2011-08-01 01:46:27 EDT
The patch solved the problem of saving a remote file.

Another problem:

When I created stplex4b:4035 and ctfmvs08:4035, and restarted the workbench,
the first connection, stplex4b:4035, does not appear in the Remote Systems view.
Comment 4 Masao Nishimoto CLA 2011-08-01 23:51:45 EDT
Is it acceptable to reject a host name and a connection name that cannot be a part of a file path as a short term solution?  It is ok to have that restriction only in RSE 3.2.x.
Comment 5 Masao Nishimoto CLA 2011-08-02 21:49:11 EDT
The patch has a side effect.  It causes drag and drop from Local Files not to work.

When the input for SystemViewDataDropAdapter.getObjectFor(String) is

NISHIMOTO.Local:local.files:C:\Documents and Settings\Administrator\COPY11.cpy

subsystemId becomes NISHIMOTO.Local:local.files:C.
Comment 6 David McKnight CLA 2011-08-03 14:42:37 EDT
Created attachment 200845 [details]
patch to not allow ':' in connection name for connection wizard

This alternative patch prevents users from creating a connection that has ':' in the connection name.  The patch allows for hostnames that have ':' (IPv6 will use ':' in it's addresses so I think we still need to support that case) but adds a file name validator for the connection names.  When the connection wizard tries to prefill the connection name with the hostname, it will augment any ':' with '_'.  Masao, could you try with this patch?
Comment 7 Pavan Kumar Immaneni CLA 2011-08-03 17:04:34 EDT
Tried the patch to not allow colon in the connection name for connection wizard (attachment 200845 [details]) and it works as expected.

1. When ever the user enters a connection name with any of the characters like  \ / : * ? " < > | then a valid error message is displayed and the user is not allowed to specify an invalid  connection name.
2. In case if the user specifies a host name with colons (IPv6 address - example 9:1:2:3) then the connection name gets suggested with colons being replaced with underscores (example 9_1_2_3).

Thanks for providing the fix.
Comment 8 David McKnight CLA 2011-08-03 17:06:40 EDT
Xuan, could you please review this patch?
Comment 9 David McKnight CLA 2011-08-03 17:18:10 EDT
Kevin, could you please review this patch?
Comment 10 Kevin Doyle CLA 2011-08-04 10:12:29 EDT
Review +.
Comment 11 David McKnight CLA 2011-08-04 10:44:40 EDT
Thanks for the review, Kevin.  I've committed the change to cvs.
Comment 12 Martin Oberhuber CLA 2011-09-13 08:40:54 EDT
I verified that also on SSH connections, when the connection name has a ":" files can't be saved. Personally I'd prefer fixing the problem rather than working around it (eg by quoting connection names like we already do when writing files to disk), but I can also live with the workaround.

If our choice is to disallow connections with a ":" in the name, then the rename dialog should also be changed. I filed bug 357479 for this.
Comment 13 David McKnight CLA 2011-09-14 13:59:22 EDT
The current fix doesn't account for non-windows cases where ':' can be a valid file name character.  Reopening this in order to provide a solution that will also work on linux clients.
Comment 14 David McKnight CLA 2011-09-14 14:00:11 EDT
Created attachment 203354 [details]
updated patch to handle ':' when using non-Windows client
Comment 15 David McKnight CLA 2011-09-14 14:00:56 EDT
Masao, can you see if the updated patch helps cases where users are on a linux client?
Comment 16 David McKnight CLA 2011-09-15 11:43:49 EDT
I'm going to leave this resolved for now.  Masao, if you require a fix that will work on a Linux client please open a separate defect referencing this one.
Comment 17 Pavan Kumar Immaneni CLA 2011-09-15 12:30:02 EDT
David, did you apply your patch to handle ':' when using non-Windows client, so that its available when we pick up the next RSE version ?
Comment 18 David McKnight CLA 2011-09-15 14:34:12 EDT
(In reply to comment #17)
> David, did you apply your patch to handle ':' when using non-Windows client, so
> that its available when we pick up the next RSE version ?

Pavan, no, I haven't applied the patch.  Since the original fix was already resolved and put in RSE builds and we've already passed SR1, I think it's better to handle the Linux-case via a separate bug.