Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 245288 - RemoteTools crashes while launching any application inside a system with BusyBox
Summary: RemoteTools crashes while launching any application inside a system with BusyBox
Status: CLOSED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Remote Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Everton Rufino Constantino CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-26 13:56 EDT by Everton Rufino Constantino CLA
Modified: 2011-05-14 06:37 EDT (History)
4 users (show)

See Also:


Attachments
This patches parses /etc/group on the target machine to see the groups that the user belongs to. (4.76 KB, patch)
2008-08-27 13:51 EDT, Everton Rufino Constantino CLA
g.watson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Everton Rufino Constantino CLA 2008-08-26 13:56:24 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Have a system with an image that is using busybox.
2. Add this box as a generic host.
3. Try to launch an application inside this system using PTP. You will see that the system will crash with the following exception: 

--> Exception in thread "Thread-20" java.lang.NumberFormatException: For input string: "".


More information:
The problem is that the method org.eclipse.ptp.remotetools.internal.ssh.StatusTools.fetchRemoteUserInfo tries to get a list of the groups that a user belongs to by using the id method with the -G argument. However, inside busybox the -G argument does not exists, so userInfoFields[2] is "" and Java cannot convert "" to a number, raising the exception.

My box at this moment is mambo however since this method is generic, any host with busybox would suffer from the same problem.
Comment 1 Everton Rufino Constantino CLA 2008-08-26 15:10:35 EDT
I am working on a patch to solve this problem.
Comment 2 Everton Rufino Constantino CLA 2008-08-27 13:51:30 EDT
Created attachment 111101 [details]
This patches parses /etc/group on the target machine to see the groups that the user belongs to.

If id -G does not exists, userField[2] is left blank. This patch catches this case and parses /etc/group to find out which groups the user belongs to.
Comment 3 Everton Rufino Constantino CLA 2008-08-27 14:06:01 EDT
The patch solved my problem.
Comment 4 Daniel Felix Ferber CLA 2008-08-28 09:18:53 EDT
Committed the change. Thanks.
Comment 5 Everton Rufino Constantino CLA 2008-08-28 10:53:35 EDT
Thanks.