Bug 149285 - [ssh] multiple prompts and errors in case of incorrect username
Summary: [ssh] multiple prompts and errors in case of incorrect username
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux-GTK
: P4 minor (vote)
Target Milestone: 3.0 M7   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: bugday, contributed
: 181480 (view as bug list)
Depends on:
Blocks: 231964
  Show dependency tree
 
Reported: 2006-06-30 05:08 EDT by Martin Oberhuber CLA
Modified: 2011-05-25 07:40 EDT (History)
1 user (show)

See Also:


Attachments
patch for SystemCommandAction (3.13 KB, patch)
2008-04-25 15:17 EDT, Anna Dushistova CLA
mober.at+eclipse: iplog+
mober.at+eclipse: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2006-06-30 05:08:19 EDT
Create an ssh connection to build.eclipse.org, choose "Launch Shell".
Have an SSH private key available and configured.
On the Username prompt, enter an invalid username (and invalid password).

The SSH Connector Service will do another interactive prompt for the password, and when pressing "Cancel" a "Keyboard Interactive" authentication will also be tried. When that is also canceled, RSE shows an "Auth Cancel" error message.

Correct behavior would be to cancel the login without further messages when the user chooses cancel.
Comment 1 Martin Oberhuber CLA 2006-06-30 05:09:17 EDT
Moreover, the incorrect username gets saved and it is not easy to correct the username on subsequent tries (need to clear it or change it in properties or use the "Connect..." action).
Comment 2 Martin Oberhuber CLA 2006-06-30 05:12:02 EDT
Moreover, on Linux an exception ("Auth Cancel") is printed to stdout when the user cancels the authentication.
Comment 3 Anna Dushistova CLA 2008-04-23 08:22:41 EDT
Martin,
what should be the expected behaviour?
Comment 4 Martin Oberhuber CLA 2008-04-23 12:08:40 EDT
(In reply to comment #3)
From the description:

  "Correct behavior would be to cancel the login without further messages
   when the user chooses cancel."

from comment #1:

  "Also don't save any credentials when the user chooses cancel."

from comment #2:

  "Never print any errors to stdout. Best avoid any errors if possible e.g.
   by not allowing invalid input. If this can't be done, then inform the user
   with a dialog about errors. If the error is not important enough, then 
   just log it to the Eclipse Error Log.

   In the concrete case, "Auth Cancel" should be silently ignored and
   nowhere logged since the user manually chose cancel so the system
   is already doing what the user wants."

Is that clear enough? - I'm fine if not all 3 conditions of satisfaction can be met right away, just fixing the first issue for now would be fine, the others can be tracked separately if necessary.
Comment 5 Anna Dushistova CLA 2008-04-23 14:27:49 EDT
Thanks a lot.
BTW, I wasn't able to get that "Auth Cancel" error message shown.
Comment 6 Martin Oberhuber CLA 2008-04-23 14:38:49 EDT
Yeah... maybe that was fixed with some other bug along the way. Are you going to take on this bug and try to come up with a patch?
Comment 7 Anna Dushistova CLA 2008-04-25 15:17:40 EDT
Created attachment 97670 [details]
patch for SystemCommandAction

I, Anna Dushistova, declare that I developed attached code from scratch,
without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer to make this contribution under the EPL.
Comment 8 Martin Oberhuber CLA 2008-04-25 17:32:35 EDT
Patch applied with one minor modification (directly catch OperationCanceledException rather than doing instanceof).
Thanks!

When testing, I saw that in the following case:
  Select file subsystem, right-click > connect...
  Enter invalid password
  on SSH dialog, press cancel
Following exception is printed to the log:


org.eclipse.core.runtime.OperationCanceledException
	at org.eclipse.rse.internal.connectorservice.ssh.SshConnectorService.internalConnect(SshConnectorService.java:193)
	at org.eclipse.rse.core.subsystems.AbstractConnectorService.connect(AbstractConnectorService.java:412)
	at org.eclipse.rse.core.subsystems.SubSystem.connect(SubSystem.java:2402)
	at org.eclipse.rse.internal.ui.actions.SystemConnectAction$ConnectJob.run(SystemConnectAction.java:56)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Keeping the bug open to fix that one as well.
Comment 9 Martin Oberhuber CLA 2008-04-25 17:37:02 EDT
(In reply to comment #8)
Fixed the issue in SystemConnectAction. Now, when I "Launch Terminal" and cancel in the SSH dialog (due to invalid password) I get this in the error log:

org.eclipse.core.runtime.OperationCanceledException
	at org.eclipse.rse.internal.connectorservice.ssh.SshConnectorService.internalConnect(SshConnectorService.java:193)
	at org.eclipse.rse.core.subsystems.AbstractConnectorService.connect(AbstractConnectorService.java:412)
	at org.eclipse.rse.core.subsystems.SubSystem.connect(SubSystem.java:2402)
	at org.eclipse.rse.internal.terminals.ui.actions.LaunchTerminalAction.run(LaunchTerminalAction.java:239)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        [...]
Comment 10 Martin Oberhuber CLA 2008-04-25 17:39:29 EDT
Fixed that one in LaunchTerminalAction
Comment 11 Martin Oberhuber CLA 2008-04-25 17:41:55 EDT
Now, when I expand the My Home Filter and press cancel in SSH, I get an "Empty List" subnode. When I select "My Home" again and press Refresh, I get the login dialog; if I cancel, I get the login dialog again.

Login dialog should appear once only.
Comment 12 Martin Oberhuber CLA 2008-04-25 17:49:49 EDT
Hm... that one is harder. Here is a stack trace:

SubSystem.checkIsConnected()
   -> throws SystemMessageException
RemoteFileSubSystem.getTargetForFilter(ISystemFilterReference)
   -> eats the exception silently, but returns null
SystemView$ResourceChangedJob.runInUIThread(IProgressMonitor) line 2207
   -> doesnt know that it was canceled and tries to continue

DaveM, I think that's a problem which only you can finish... thanks
Comment 13 Martin Oberhuber CLA 2008-04-25 17:51:04 EDT
Looks like second time we pop into connect from here:

AbstractSystemViewAdapter.fetchDeferredChildren()
DeferredTreeContentManager$1.run(IProgressMonitor)
Comment 14 Martin Oberhuber CLA 2008-05-13 18:37:23 EDT
Marking this fixed in order to close off our IP Log.
Remaining issue as per comment #11 will be tracked in bug 231964.
Comment 15 David Dykstal CLA 2008-05-30 18:17:19 EDT
*** Bug 181480 has been marked as a duplicate of this bug. ***