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 197678 - "/Applications/Netbeans" folder is owned by an invalid user (uid 520)
Summary: "/Applications/Netbeans" folder is owned by an invalid user (uid 520)
Status: VERIFIED FIXED
Alias: None
Product: installer
Classification: Unclassified
Component: Mac Native (show other bugs)
Version: 7.0.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-12 21:44 UTC by athompson
Modified: 2012-05-16 18:06 UTC (History)
1 user (show)

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 athompson 2011-04-12 21:44:44 UTC
1. install netbeans from an account with admin privileges
2. start netbeans
3. go to Tools>Plugins>Settings
4. ensure "Force install into shared directories" is NOT checked
5! install a plugin - the plugin is installed in the App directory instead of the user's '.netbeans' directory

This is does not happen on Windows.  I haven't checked Linux in a while.  I haven't investigated at all, but I imagine the for some reason now Netbeans is doing the horrible thing that Eclipse does and just tries to write everything in the app folder and only falls back to the user folder if it's not writable.

At least 2 problems are:
- the "/Applications/Netbeans" folder is owned by an invalid user (uid 520)
- the "/Applications/Netbeans/Netbeans Dev 201104120401" folder is owned by the user which installed the app

Running "chown -R root:wheel /Applications/Netbeans" before starting Netbeans makes things work correctly.
Comment 1 athompson 2011-04-12 21:59:01 UTC
To summarize, this is a 2-phase problem:
- the installer is installing with the wrong permissions
- the app is writing data to the app folder without explicit permission
Comment 2 Jaroslav Tulach 2011-04-14 05:37:29 UTC
I've got a request to remove the "force" checkbox in bug 197661 together with explanation how it behaves (comment #2) and why it is useless.

Yes, making the install directory read-only solves the problem. Or you can create .noautoupdate file inside platform, ide, java, etc. cluster directories. That will prevent autoupdate from touching these directories as well.
Comment 3 athompson 2011-04-21 22:14:36 UTC
I agree that the checkbox should probably go away, but I have to reopen the issue on the basis that the behavior is inconsistent depending on the platform. On Windows for example, the "Web Apps" plugin goes into the user plugin folder, but on OSX the plugin goes into the application folder.

There probably needs to be some thought/discussion to decide how plugins should work.  In the mean time, may I suggest this temporary fix:
1. When updating a plugin, the update goes into whatever folder the plugin is currently located. This will let updates of preinstalled/internal components work properly and let user-installed plugins be updated at the user's discretion.
2. When adding a plugin, if the user has write access to the app folder (and the plugin declares a target cluster), the IDE should ask if the plugin should be installed for everyone or just the user.  If the user does not have write access to the app folder, just install the plugin into the user folder.
Comment 4 Jaroslav Tulach 2011-04-24 05:44:53 UTC
OK, so let's start with basics: "/Applications/Netbeans" folder is owned by an invalid user (uid 520)
Comment 5 Yulia Novozhilova 2011-04-25 12:47:44 UTC
Reproduced on Snow Leo. Investigating.
Comment 6 Yulia Novozhilova 2011-04-27 14:07:36 UTC
Fixed: http://hg.netbeans.org/core-main/rev/afa5a3254de2

Concerning the second problem: the "/Applications/Netbeans/Netbeans Dev 201104120401" folder is owned by the user which installed the app, could you please clarify why do you think it is a problem? Excepting the fact that plugins is installed in the App directory.

Also see https://netbeans.org/bugzilla/show_bug.cgi?id=198132
Comment 7 athompson 2011-04-27 18:09:04 UTC
On my mac, I am uid 501 (the only user on the system), yet after installing the mentioned build the created "Netbeans" folder was owned by uid 520.  This is the parent folder (/Applications/Netbeans), not the app folder (/Applications/Netbeans/Netbeans Dev 201104xxxxxx.app).
Comment 8 Quality Engineering 2011-04-28 05:09:14 UTC
Integrated into 'main-golden', will be available in build *201104280000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/afa5a3254de2
User: Yulia Novozhilova <ynov@netbeans.org>
Log: Fix #197678 -  /Applications/Netbeans folder is owned by an invalid user (uid 520)
Comment 9 athompson 2011-05-11 21:10:24 UTC
The "incorrect owner" portion of the issue is verified...
Comment 10 athompson 2011-05-11 21:13:21 UTC
...although I still believe the actual app folder should also be owned by "root:wheel".
Comment 11 Jiri Rechtacek 2012-05-16 14:51:07 UTC
(In reply to comment #10)
> ...although I still believe the actual app folder should also be owned by
> "root:wheel".

It's intention made NB installation r/w for user who install NB itself (see issue 177872).
Since issue 197661 will be solved (still planned for 7.2), an user is allowed to decide install plugins locally.
Comment 12 athompson 2012-05-16 18:06:14 UTC
yup