Bug 20305 - F3 build, Update test C6, wrong permissions on updated SWT libraries
Summary: F3 build, Update test C6, wrong permissions on updated SWT libraries
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC HP-UX
: P1 major (vote)
Target Milestone: 2.0 F4   Edit
Assignee: Konrad Kolosowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-13 20:00 EDT by Konrad Kolosowski CLA
Modified: 2002-06-24 10:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad Kolosowski CLA 2002-06-13 20:00:26 EDT
After performing one click update platform does not restart due to the wrong 
persmissions on the downloaded SWT libaries.
See bug 18376, where permissions were wrong in the new installation of Eclipse.

Note, I have renamed the hp9000 directory to the PA_RISC directory inside the 
updated swt plugin, because I was running Eclipse with -arch PA_RISC option, 
and libraries would not be found at all otherwise.

% ./eclipse -arch PA_RISC -vm /opt/java1.3/jre/bin/java
java.lang.UnsatisfiedLinkError: /bluebird/teamswt/kkolosow/eclipse/plugins/org.e
clipse.swt.motif_2.0.0.v2045/os/hpux/PA_RISC/libswt-motif-2045.sl: Permission 
denied
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:102)
        at org.eclipse.swt.internal.motif.OS.<clinit>(OS.java:14)
        at org.eclipse.swt.widgets.Display.createDisplay(Display.java:505)
        at org.eclipse.swt.widgets.Display.create(Display.java:491)
        at org.eclipse.swt.graphics.Device.<init>(Device.java:110)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:317)
        at org.eclipse.swt.widgets.Display.<init>(Display.java:314)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1142)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:739)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:248)
        at org.eclipse.core.launcher.Main.run(Main.java:697)
        at org.eclipse.core.launcher.Main.main(Main.java:530)
%
Comment 1 Vlad Klicnik CLA 2002-06-20 10:05:48 EDT
From: Konrad Kolosowski/Toronto/IBM@IBMCA
Subject: http://dev.eclipse.org/bugs/show_bug.cgi?id=20305

On HP, shared libraries need to have r-x permissions (no write).  On other 
Unixes, shared libraries do not need execute permission.

There is no API to read permission from the zip in Java.  The permissions inside 
a zip file is not a standard zip feature.  That is why tar.gz is used to 
distribute files on Unixes today rather than zip.  AIX and HP do not even ship 
with zip/unzip programs.

To fix only this bug, we can do a hack:  check if running of HP and file ends 
with .sl (shared library), then call Runtime.exec(chmod ...).

I think there is a bigger problem, not mentioned in the bug:  If a plug-in ships 
a main executable file (not a library), that file when updated will get default 
permissions and is not going to execute on any non windows platform, not just 
HP.  There is no way to guess what the permission should be from file name in 
this case.  The solution can be to change the format that updates are packaged.  
It can be a zip and an additional file with file permissions, or completely 
proprietary "Eclipse" format.  In any case build tool would be probably needed - 
not a pretty solution.

	
	       
Comment 2 Vlad Klicnik CLA 2002-06-20 10:08:44 EDT
F4 candidate
Value: high (able to run on HPUX after update)
Risk: if the fix is limited to the chmod slam on HPUX (as suggested) then low. 
Will need better solution for 2.0. A workaround for the general problem would be 
for the packager to provide a custom install handler for the feature that does 
the permission "fixup"
Comment 3 Vlad Klicnik CLA 2002-06-20 10:37:59 EDT
just a correction ...
"will need a better solution after 2.0"
Comment 4 Jim des Rivieres CLA 2002-06-20 10:42:53 EDT
The suggested hack of chmod'ing downloaded *.sl files on HP-UX sounds 
reasonable. 

While eclipse clearly must do it for SWT, it remains to be seen how common it 
is for ISVs to be including HP-UX executables. If it rarely happens in 
practice, the suggested workaround of using a custom installer may be 
sufficient.
Comment 5 Konrad Kolosowski CLA 2002-06-21 11:20:55 EDT
Fix to change permissions on *.sl files on HPUX went into 20020621 integration 
build.
Comment 6 Konrad Kolosowski CLA 2002-06-21 11:22:20 EDT
Verified in 20020621 integration build.  File permissions are set to r-xr-xr-x 
on SWT libraries and Eclipse comes up O.K. ufter updating entire SDK.
Comment 7 Grant Gayed CLA 2002-06-24 09:56:20 EDT
Question: I assume that this check has been added to the Update component 
specifically, and therefore wouldn't apply to the following situations:

   - retrieving SWT from CVS, then trying to self-host
   - retrieving SWT through Import -> Plugins and Frgaments, then trying to 
self-host

I ask because I want to verify that these situations should be readme'd.
Comment 8 Konrad Kolosowski CLA 2002-06-24 10:32:13 EDT
The fix only affects Update code.  Permissions are changed on the files that 
Update retrieves from update site and installs under plugins directory.

If there is problems with permission of files in the workspace, it would not be 
affected by the update fix.