Summary: | [ssh] NPE in SftpFileService.getUserHome() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Martin Oberhuber <mober.at+eclipse> | ||||||
Component: | RSE | Assignee: | Martin Oberhuber <mober.at+eclipse> | ||||||
Status: | RESOLVED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||||
Severity: | minor | ||||||||
Priority: | P3 | CC: | dmcknigh, uwe.st, wb-rel, xuanchen | ||||||
Version: | 2.0 | Flags: | xuanchen:
review+
|
||||||
Target Milestone: | 2.0.1 | ||||||||
Hardware: | PC | ||||||||
OS: | Linux-GTK | ||||||||
Whiteboard: | |||||||||
Bug Depends on: | 204710 | ||||||||
Bug Blocks: | 227135 | ||||||||
Attachments: |
|
Description
Martin Oberhuber
2007-09-14 16:35:14 EDT
Created attachment 78471 [details]
Patch fixing the issue
Attached patch fixes the issue.
The fix is simple, though I'm not sure why fUserHome is null here -- perhaps pwd() returned null for the given connection. Anyways, returning the root folder in that case seems the right thing to do. DaveM can you please review this? I'm not sure why pwd would have returned null but at least this resolves the issue. Patch committed. Original patch was not good because if user chose "Refresh" on the "My Home" filter while not connected, the fallback (home=="/") would be activated and not changed later. Users would not get access to their real home directory. As per bug 204710, it is better to return null in case we are not yet connected. Created attachment 79228 [details]
New patch (overriding the old one)
Attached new patch fixes the issue properly for both Sftp and FTP, and also makes a minor performance improvement to SftpFileService by marking the inner classes used for Streams "static".
Dave can you please review this?
The fix looks good. I ran the following scenarios: Create ssh connection. Before connect, refresh the My Home filter. Then expand the My Home filter. Got logon dialog. Logon. My home directory displayed correctly. Repeat it for FTP connection. Things are fine too. Patch committed: [203490] Fix NPE in SftpService.getUserHome() SftpFileService 1.21 FTPService 1.39 |