Apache OpenOffice (AOO) Bugzilla – Issue 79645
Extension Manager should not write into the user directory when installing a shared extension
Last modified: 2007-10-31 10:06:01 UTC
Currently when the PackageManagerFactory is created it also creates the directory structure of user and shared settings. Using sudo (without -H)to install a office with bundled extensions would cause several folders and files be written with root file access. The user will not be able to change them later on. See also tr148665.
.
When a unopkg add --shared is called (for example for a bundled extension) then only the directory structure for the shared extensions is created which is located in the office installation. What causes the .dat files (see tr tr148665) to be written is the config manager service.
Since changing the config manager to not use caching during installation is a risky thing, we will use for the time being a temporary UserInstallation. That is unopkg can be started with the bootstrap variable -env:UserInstallation=path_to_temporary_directory, so that nothing is written to the root's home directory. Follow up issue is i79786.
We need to resync with native84 in order to make the changes in instset_native.
Now, the installation should not create the user installation directory in the root. The scripts in the packages or the custom action (Windows) create a temporary folder which is then used by unopkg as the user installation. When unopkg is done then the directory is deleted. On Windows the Temp directory is obtained by using the GetTempPath function. See the documentation at http://msdn2.microsoft.com/en-us/library/Aa364992.aspx to find out what the exact tmp directory will be. On Linux and Solaris the tmp directory will determined by the environment variables $TMPDIR, then $TMP When both are not set then it is assumed that /tmp is the temp folder. On Linux and Solaris the tmp dir is created by mktemp and if it is not available then mkdir is used. mktemp is at /usr/lib/mktemp on Solaris and at /bin/mktemp on Linux. Please check if the alternate method to create the temporary directory works as well. The part which creates the directory looks like this: Linux:#Find the temp dir if [ -n "$TMPDIR" ]; then UNOPKGTMP="$TMPDIR" elif [ -n "$TMP" ]; then UNOPKGTMP="$TMP" elif [ -d "/tmp" ]; then UNOPKGTMP="/tmp" else echo "No tmp directory found!" exit 1 fi #Create the command which creates a temporary directory if [ -x "/bin/mktemp" ] then INSTDIR=`/bin/mktemp -d "${UNOPKGTMP}/userinstall.XXXXXX"` else INSTDIR="${UNOPKGTMP}/userinstall.$$" mkdir "$INSTDIR" fi Solaris: if [ -n "$TMPDIR" ]; then UNOPKGTMP="$TMPDIR" elif [ -n "$TMP" ]; then UNOPKGTMP="$TMP" elif [ -d "/tmp" ]; then UNOPKGTMP="/tmp" else echo "No tmp directory found!" exit 1 fi #Create the command which creates a temporary directory if [ -x "/usr/bin/mktemp" ] then INSTDIR=`/usr/bin/mktemp -d "${UNOPKGTMP}/userinstall.XXXXXX"` else INSTDIR="${UNOPKGTMP}/userinstall.$$" mkdir "$INSTDIR" fi ================================================ Please also verify the update of a package on Linux (rpm -U). For that reason I have prepared an rpm whhich has a higher build id. It can be found in the SRC680 directory of the cws. A similar rpm exist also for openoffice. Because I needed to adapt the script also for OpenOffice, you should test OOo as well. The install sets of the cws contain a leaves1.oxt which is only availabe on this cws and will not get into the master. It is just for testing purposes.
In case the postrun (/usr/lib/postrun) is used on Solaris, then the tmp directory may be created in /var/tmp/
Also, when postrun is used, then uninstalling of a Java extensions fails. See i79643.
jl->jsk: Please verify.
This works for StarOffice (Linux and Solaris). Todo: Update on Linux, Windows, OOo builds.
Verified other platforms. However, this only works due to the redirecting mechanism (bootstrapping -env:UserInstallation=...) which is not set by default when the administrator adds a shared extension. During normal usage this fix does not help, the root cause has not been fixed, this is a workaround for exactly one use case. Verified.
As for the installation, I think there is an issue with sb concerning the configuration writing data into the user layer.
Good in OOG680m7, Closing