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 120410 - [MacOS] Admin install - can't "Force install into shared directories"
Summary: [MacOS] Admin install - can't "Force install into shared directories"
Status: RESOLVED FIXED
Alias: None
Product: installer
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P2 blocker (vote)
Assignee: Yulia Novozhilova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-29 22:39 UTC by _ krystyna
Modified: 2009-02-19 20:57 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
install.log (489.12 KB, application/octet-stream)
2007-10-30 02:31 UTC, _ krystyna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ krystyna 2007-10-29 22:39:40 UTC
Can install NB + glassfish + apache ok using root/admin account (get prompted at intervals
for password), however if downloading a Plugin as shared. When attempting to check Advanced, "Force install into
shared directories" I get a write permission dialog error:

200710291200.app/Contents/Resources/NetBeans/nb6.0 is read only. Cannot install
Comment 1 _ krystyna 2007-10-29 22:40:17 UTC
Updating version.
Comment 2 Ivan Sidorkin 2007-10-29 23:26:34 UTC
could you please attach install.log
Comment 3 _ krystyna 2007-10-30 01:17:52 UTC
I log in as myself, but the admin account and pass is requested at install time. 
There is no log dated today for my 1029 install in my account/.nbi/log
Where else can I look?
Comment 4 _ krystyna 2007-10-30 01:27:08 UTC
and, there is no /Users/"adminaccount"/.nbi directory at all...
Comment 5 Ivan Sidorkin 2007-10-30 01:37:35 UTC
latest builds has native installer, not NBI installer
check /var/log/installer.log
Comment 6 _ krystyna 2007-10-30 02:31:19 UTC
Created attachment 51957 [details]
install.log
Comment 7 dlipin 2007-10-30 09:26:00 UTC
krystyna,

what is the output of the following commands:
ls -dla "/Applications/NetBeans/NetBeans 6.0 Dev 200710291200.app/Contents/Resources/NetBeans/nb6.0"
id
id root

Can you make a project in NetBeans IDE with project directory somewhere inside the ..../Contents/Resources/NetBeans/
?
Comment 8 dlipin 2007-11-01 15:13:35 UTC
krystyna,

any update?
Comment 9 Kenneth Ganfield 2007-11-01 16:46:54 UTC
I also see this issue when trying to use force install plugin in shared directory option

When trying to create project in ..../Contents/Resources/NetBeans/ dir
I cannot. The New Project wizard displays the message "Project Folder is read only."

MacOS, build 200710310000
Comment 10 dlipin 2007-11-01 17:11:39 UTC
I would rather say that it is mostly by design (see also Issue 119213).

You install NetBeans as root and use as non-root user.
For security reasons non-root user is not allowed to modify the files/dirs created by root that is why such behavior is 
observed.
Comment 11 Kenneth Ganfield 2007-11-01 17:51:26 UTC
I also believe that the behaviour is correct.

I think that there should be a better explanation of how the user can use the force install option.
Maybe there should be further instructions/note that the permissions need to be changed to install plugins there.

Is this specific to the Mac OS? 
Comment 12 dlipin 2007-11-01 18:49:18 UTC
It also occurs on all unix`es when installation was performed under root user (maybe with using sudo command) and 
netbeans itself is running under the non-root.
Comment 13 _ krystyna 2007-11-01 19:48:47 UTC
I confirm that my account is a standard account, not admin, so
the shared option one could argue is acceptable "by design", however,
since I do have the admin password to install, and I create AND
deploy projects, my point is : why can I not likewise be prompted to 
"force install into shared directories". In other words I would like the "override option"
there as well..

answers to your other questions:
output of the following commands:
ls -dla "/Applications/NetBeans/NetBeans 6.0 Dev 200710291200.app/Contents/Resources/NetBeans/nb6.0"
drwxr-xr-x  11 root  admin 

id
uid=505(krys) gid=505(krys) groups=505(krys)

id root
uid=0(root) gid=0(wheel), 1(daemon), 2(kmem), 3(sys), 31(guest), 4(tty), 29(certusers), 5(operator), 80(admin), 20(staff)

Can you make a project in NetBeans IDE with project directory somewhere inside the ..../Contents/Resources/NetBeans/
No--I get the read-only there. That is expected and okay, as the default project creation dir is /Users/krys/...
Comment 14 dlipin 2007-11-01 20:02:25 UTC
In other words : it is the autoupdate problem or maybe RFE.
reassigning...
Comment 15 rmatous 2007-11-02 10:22:44 UTC
Behavior added by fixing #117101 in AU. I believe this fix was right and this sanity check is right. The code exactly
does if !installdir.canWrite () then show message and prevent from checking "Force install into
shared directories".
Comment 16 Jiri Rechtacek 2007-11-02 10:53:08 UTC
I agree with evaluation, more plainly: the Autoupdate cannot install into shared dirs if user has no write permission
for them which is a common case for mac installations.
Comment 17 Jaromir Uhrik 2007-11-02 11:32:59 UTC
I have verified that the behavior is correct on my Mac. I have filed RFE #120935 for improvement of message text to avoid issues like this one.
Comment 18 _ krystyna 2007-11-07 23:35:31 UTC
OK, I changed my account to an admin one on Mac and still am not allowed to "Force Install into Shared Directories".
Neverthless, there is a manual workaround for users with administration privileges to use the 
"Force install into shared directories" and that is to manually chmod the subdirectories of the <NetBeansInstall>

cd NetBeans
sudo chmod g+w *

I will add this to the release notes. 

Please reconsider fixing this. I will reopen this because I am afraid users with admin accounts won't be autoupdated.


Comment 19 dlipin 2007-11-08 07:25:05 UTC
krystyna,

please note that there is a big difference between admin(root) account and the user with admin privileges.
In the latter case the user is non-admin but it is in the admin group.

In my understanding the second variant is a normal thing on macosx but working under real root on mac is a very rare 
thing. Even enabling of the root account is not a trivial task.
Comment 20 Jiri Rechtacek 2007-11-08 09:25:11 UTC
Dmitry's explanation about difference in write permissions root and admin users. Force install into shared directories
can  one and only the root on Mac installations. Plugin Manager cannot override Mac/Unix security settings.
Comment 21 claudiomassi 2008-11-06 11:17:02 UTC
When installing NetBeans 6.5 RC2.mpkg you have to provide user name and password of an administrator user (not root);
Installer.app (from CoreServices) is requesting system.install.root.user permission.
At the end of the installation the NetBeans 6.5 RC2.app directory is owned by root/admin as drwxr-xr-x
# ls -al
total 0
drwxr-xr-x    6 root  admin   204 Oct 29 18:57 .
drwxrwxr-x+ 236 root  admin  8024 Oct 30 09:55 ..
drwxr-xr-x    3 root  admin   102 Oct 29 18:57 NetBeans 6.5 RC2.app
drwxrwxrwx   13 root  admin   442 Oct 29 18:53 apache-tomcat-6.0.18
drwxrwxrwx   22 root  admin   748 Oct 29 18:56 glassfish-v2ur2
drwxrwxrwx    7 root  admin   238 Oct 29 18:53 glassfish-v3-prelude-b28c

The administrator who installed the product should always be able to add shared plugins, according to the comments in
this issue
The administrator can set the flag "Force install into shared directories", but shared installation will silently fail
due to lack of permissions to write the "extra" directory in installdir and files will be written in userdir. 
Please note that a non administrator user will not be able to set the flag and a popup explains that directory cannot be
written
The "root" user can do everything but is disabled by default on Mac and is rarely used to install/update products.
To fix the problem the correct permissions should be set during Netbeans installation, and in the meantime the following
workaround could be added in faq 
# cd /Applications/NetBeans/
# chmod -R g+w "NetBeans 6.5 RC2.app"
Comment 22 Jaromir Uhrik 2008-11-06 11:45:31 UTC
Not problem of autoupdate component => reassigning to installer. BTW I don't think this is relevant issue.
Comment 23 dlipin 2008-11-06 12:34:18 UTC
Doing 
# cd /Applications/NetBeans/
# chmod -R g+w "NetBeans 6.5 RC2.app"
is not required.

The only thing required is to change permissions on the NetBeans folder (yes, chmod is not recursive here)
chmod g+w "/Applications/NetBeans/NetBeans 6.5 RC2.app/Contents/Resources/NetBeans"

After that I was able to install plugins (e.g. Maven) to the shared installation directory (maven1 cluster was created).
We`ll fix it in 7.0.
I guess it can be fixed together with Issue 151681.
Comment 24 Quality Engineering 2008-11-16 04:11:39 UTC
Integrated into 'main-golden', will be available in build *200811160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0bf4d7c3782d
User: Yulia Novozhilova <ynov@netbeans.org>
Log: [MacOs Installer]Fix for #120410: Admin install - can't Force install into shared directories
Comment 25 Yulia Novozhilova 2008-11-17 16:26:07 UTC
Fixed. Please verify.