Kaydet (Commit) 791fe38f authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Andras Timar

Don't let root run unopkg without --shared or --bundled option

with the exception of -h|--help.

It only makes sense to run unopkg with root priviledges if adding,
deleting etc. extensions system-wide for all users (i.e with --shared
or --bundled switch). In all other cases it only messes up access
rights to extensions, so prevent that.

Fusion of 723e0999 and 9444ffc9

Change-Id: Ifa273a4d66b85d9d7ed7e8e22036ccc821507fd2
Reviewed-on: https://gerrit.libreoffice.org/16293Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 656fd696
......@@ -49,17 +49,35 @@ AIX)
;;
esac
#collect all bootstrap variables specified on the command line
#so that they can be passed as arguments to javaldx later on
help_mode=0
isnotuser=0
for arg in $@
do
case "$arg" in
#collect all bootstrap variables specified on the command line
#so that they can be passed as arguments to javaldx later on
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
--shared) umask 0022;;
# make sure shared extensions will be readable by all users
# make sure shared extensions will be readable by all users
--shared)
umask 0022
isnotuser=1
;;
--bundled) isnotuser=1;;
-h|--help) help_mode=1;;
esac
done
# we don't really want root to run unopkg without --shared or --bundled option
# but we might at least let him read help
if [ "$(id -u)" -eq "0" ]; then
if [ $isnotuser -eq 0 ] && [ $help_mode -eq 0 ]; then
echo "Cannot run '${0} $*' as root without --shared or --bundled option."
exit 1
fi
fi
# extend the ld_library_path for java: javaldx checks the sofficerc for us
if [ -x "${sd_prog}/javaldx" ] ; then
my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment