Bug 186536 - [telnet] JJ: Strings matched for login and password should be configurable
Summary: [telnet] JJ: Strings matched for login and password should be configurable
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: Sheldon CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed, helpwanted
Depends on: 178201
Blocks:
  Show dependency tree
 
Reported: 2007-05-11 06:13 EDT by Martin Oberhuber CLA
Modified: 2011-05-25 10:24 EDT (History)
0 users

See Also:


Attachments
patch for PropertySet (4.58 KB, patch)
2007-05-11 07:29 EDT, Sheldon CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-05-11 06:13:05 EDT
The TelnetConnectorService currently uses hard-coded strings
  "ogin: "
  "assword: "
to be matched against a remote system's prompt when the login and password are to be entered.

The connectorservice should 
1. Be more fault-tolerant such that connections which do not require a 
   username or password can also be connected. Especially for the password,
   there could be a timeout after which readUntil() no longer waits.

2. Be configurable by adding a PropertySet to the ConnectorService with
   user-configurable properties for 
      * Boolean Login Required
      * String  Login Prompt
      * String  Password Prompt
   such that users can configure their telnet connection appropriately in the
   new connection wizard. See the FTP subsystem / connectorservice for an
   example how PropertySets can be used (it's done for the FTP Parser and
   the passive mode control there).
Comment 1 Martin Oberhuber CLA 2007-05-11 06:14:30 EDT
Sheldon can you do this soon and apply a patch, because I think the Telnet subsystem would otherwise be unusable in many scenarious including your own ARM boards which do not require a login.

It should not be hard to do, looking at what has been done for FTP.
Comment 2 Sheldon CLA 2007-05-11 06:24:35 EDT
I will have a look at FTP propertySet and apply the changes as soon as possible
Comment 3 Sheldon CLA 2007-05-11 07:29:01 EDT
Created attachment 66837 [details]
patch for PropertySet

This contains a patch for the implementation of propertySets in telnet service, The propertySet provide's the following properties that can be configured by the user for the remote system

1. Login required
2. Login prompt
3. Password prompt
4. Command prompt
Comment 4 Martin Oberhuber CLA 2007-05-11 09:47:17 EDT
Thanks for the patch, this was quick!

Patch applied with some modifications:
* Avoid unnecessary duplicate code
* Create String constants for Property keys in order to make it extensible
  and avoid errors due to typos
* Handle the case where a prompt is specified to be empty
  --> This allows to handle systems that ask for a user but not for a password
* Return IConnectorService methods supportsPassword() and supportsUserId()
  as false if the PropertySet says that no login is required
* Return IConnectorService requiresUserId() as false in order to allow for empty
  user id (some systems may want a password only)

When verifying the fix in a build during testing, all these cases should be checked:
- No login, no password, no credentials;
- PropertySets persisted properly
- Invalid user or password given

Please update your workspace out of CVS for any further patches, and submit these patches as "Unified Workspace Diff". See
http://www.eclipse.org/dsdp/tm/development/cvs_setup.php
Comment 5 Martin Oberhuber CLA 2008-08-13 13:18:46 EDT
[target cleanup] 2.0 M7 was the original target milestone for this bug