This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194073 - [70cat][uninstaller] Uninstalling on Linux causes problems when using non-root user if installed as root
Summary: [70cat][uninstaller] Uninstalling on Linux causes problems when using non-roo...
Status: REOPENED
Alias: None
Product: installer
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: PC Linux
: P4 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-06 07:27 UTC by esmithbss
Modified: 2014-02-10 14:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description esmithbss 2011-01-06 07:27:16 UTC
[ JDK VERSION : 1.6.22 ]

If NetBeans is installed as Root within a users home folder, and subsequently
has the ownership of the application files changed to the home folder's owner,
uninstall as the home folder's owner fails with an inability to create a folder
in the root user's tree.

To Reproduce:

1) As the root user in Linux, install Net Beans into a users home folder or a
sub-folder under the users home folder.  (ex.  as root, install netbeans into
/home/esmith/apps/NetBeans)

2) As the root user, change the owner of the NetBeans application to the owner
of the home folder (ex. after installation, execute chown -R esmith.esmith
/home/esmith/apps/NetBeans)

3) Launch the IDE and do some work.

4) As the owner of the home folder, execute the uninstaller (ex.  as esmith,
execute /home/esmith/apps/NetBeans/uninstall.sh)
Comment 1 Ondrej Vrabec 2011-01-10 11:57:21 UTC
Yes, it is not possible, but why is that unexpected? You installed the IDE as root, so the install process stored the installation data in /root/.nbi. And to uninstall the IDE, it needs to have access to them. So either make /root/.nbi accessible or install the IDE as a normal user.
Comment 2 esmithbss 2011-01-11 15:05:11 UTC
I agree that the scenario is one that should be disallowed; however, this is actually a problem in the installer for not checking permissions before the uninstall begins.

Assume the user installed NetBeans, then at some point the .nbi folder had permissions changed to root.  The same issue would exist.

The results of this scenario should be that the uninstaller informs the user before they start that they don't have permission to perform the uninstallation.  Instead, the uninstallation starts then throws an error.
Comment 3 Ondrej Vrabec 2011-01-11 15:22:21 UTC
> this is actually a problem in the installer for not checking permissions
> before the uninstall begins.
IMO not true, the installation process does not start, i mean no file is deleted. The error is thrown just in the initialization phase.
 
> Assume the user installed NetBeans, then at some point the .nbi folder had
> permissions changed to root. The same issue would exist.
Yes, it would. But it's the same unlikely scenario as yours. Or can you see any meaning in changing a hidden folder's owner to root when it lies inside user's home dir?

> The results of this scenario should be that the uninstaller informs the user
> before they start that they don't have permission to perform the
> uninstallation.  Instead, the uninstallation starts then throws an error.
Well, it kind of does. As i mentioned earlier, the error is thrown in the init phase. Or at least in my case, if you experienced any difference, please run the uninstall process with --verbose and attach the output.

I agree that the error message is confusing or meaningless at least and should probably be changed. Or do you want us to do something else?
Comment 4 esmithbss 2011-01-11 16:21:47 UTC
Changing the error message to something mor meaningful is IMO a good solution. As long as the error can provide an indication of the problem and a recommended solution.