Bug 20753 - Update manager does not preserve file permissions
Summary: Update manager does not preserve file permissions
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 blocker (vote)
Target Milestone: 2.0.1   Edit
Assignee: Christophe Elek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-20 14:59 EDT by Vlad Klicnik CLA
Modified: 2002-08-22 15:09 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Klicnik CLA 2002-06-20 14:59:18 EDT
The update manager uses default Java I/O support to copy files. This seems to 
create all files with rw- permissions. On some systems shared libraries need x 
(execute). Having w in a shared install is also a problem.
Comment 1 Greg Adams CLA 2002-07-08 12:16:01 EDT
We also are shipping on linux and need to ensure that file permissions never 
get lost during updates.
Comment 2 Vlad Klicnik CLA 2002-07-08 13:27:23 EDT
I agree this needs to be fixed, but please justify how this is a blocker. The 
only supported system where this was preventing Eclipse from working was HP-UX 
and 2.0 contains a temporary fix for HP-UX for this.
Comment 3 Peter Manahan CLA 2002-07-09 10:11:37 EDT
If the description is correct then it is a blocker. If all files are having 
their permissions stripped and reset to rw (i assume rw for all users -rw-rw-
rw?) Then WSAD has a couple of problems. 

Our shell scripts and executables contained in plugins we update won't run 
without the execute bit set. This is true for WSAD as well as the ClearCase 
plugin which relies on executable perl scripts to function. 

This is blocking for that reason.


Comment 4 Peter Manahan CLA 2002-07-09 10:21:48 EDT
The fix needs to be the correct fix as well. It is impossible to detect 
whether a file was executable after stripping the execute bit. I don't know 
what the temp fix for HP was.

 Hopefully it wasn't to set the execute bit on files that had a particular 
extension. If so that was a dangerous assumption. The extensions of shared 
libraries are a convention not requirement. Many shared libs don't have 
extensions or have extensions that are not .so.  So it may work for eclipse's 
shared objects but not others.
Comment 5 Christophe Elek CLA 2002-07-10 10:29:42 EDT
Peter, can you confirm installp and rpm have a filset list that lists the
permission of the files during install... do you have doc about this ?
Comment 6 Dejan Glozic CLA 2002-08-10 13:50:46 EDT
We will fix the problem in 2.0.1 in the following way:

A Java properties file called 'permissions.properties' will be required 
for plug-ins that contain files that need to be executable on UNIX operating 
systems. The file will be looked for in the plug-in root. The syntax for the 
file will be very similar to that of build.properties. A single 
property 'permissions.executable' will be used to list files that need to be 
executable. Files are listed in the comma-separated list in the value portion 
of the key/value pair. Wildcard * is permitted. Post 2.0.1, we may introduce 
more properties for a more specific post-install file fixup. 

For 2.0.1, files that match permissions.executable value will have their 
executable bit set. The effect is equivalent to running 'chmod' command 
with '+x' argument. The command will be run using Runtime.exec' in 2.0.1 
to avoid regressions.

Example of a permissions.properties file for SWT fragment org.eclipse.swt.motif:

#Permissions used by the Install/Update on platforms that depend on it

permissions.executable = os/aix/ppc/*.a,\
			 os/hpux/PA_RISC/*.sl,\
			 os/linux/x86/*.so,\
			 os/solaris/sparc/*.so

Note that in reality only hpux libraries need their executable bit set.
The file needs to be placed in the fragment root directory. 

Post 2.0.1, native code will be written to call chmod function from unistd.h 
ANSI C library. This will make the code execute faster. Performance is not
an issue with a handful of files that need their executable bit set (as
defined in permissions.properties). However, if all the files that are
installed have their permissions set, it becomes a problem. Using a 
native call will make it possible to fix permissions on ALL the
installed files to be rw-r--r-- (as opposed to the pure Java behaviour
that results in rw-rw-rw- when creating new files). 

Bottom line:

For 2.0.1, all files installed by Update component will have rw-rw-rw- 
permissions except for files listed in permissions.properties that
will have rwxrwxrwx.

After 2.0.1, native code calls will be used to change permissions for
all the files to rw-r--r--, and rwx-r-xr-x for files listed in
permissions.properties.
Comment 7 Dejan Glozic CLA 2002-08-22 15:09:59 EDT
Verified using 2.0.1 build 0821 (the build required manual addition of 
permissions.properties into org.eclipse.swt.motif - see defect 
http://dev.eclipse.org/bugs/show_bug.cgi?id=22729 - but the problem is in SWT 
and will be addressed in the suqsequent build).