Bug 203502 - [files] Potential NPE in FileServiceSubSystem.getUserHome()
Summary: [files] Potential NPE in FileServiceSubSystem.getUserHome()
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2007-09-14 18:08 EDT by Martin Oberhuber CLA
Modified: 2012-11-19 04:57 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-09-14 18:08:01 EDT
+++ This bug was initially created as a clone of Bug #185921 +++
From Reid Holmes in bug 185921 comment 10:

FileServiceSubSystem.getUserHome() makes this call-chain:

if (!userHome.getParentPath().equals(".")) //$NON-NLS-1$

This can result in a NullPointerException as getParentPath() is allowed to
return null if userHome.isRoot() returns true.
Comment 1 Martin Oberhuber CLA 2007-10-16 09:45:37 EDT
CQ:WIND00108151

Here is a concrete sequence of steps that leads to this bug on an Sftp connection where no home directory could be determined: User cannot even expand the root folder ("/") because the home directory returns null:

1. Boot a wrlinux target 
2. Start Workbench
3. Create a user mode target server connection
4. Expand sftp files, two items will appear My Home and Root
5. Expand Root: you will see /
6. Select Root and click on Refresh,  you will then be able to expand /
7. Expand /, you will get an error.

See also bug 203490, bug 204710
Comment 2 Martin Oberhuber CLA 2008-04-15 11:38:49 EDT
See also bug 227135 comment 2 -- just fixing the NPE is probably not sufficient since the file subsystem will be kind of invalid anyways.