summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a02e9ae)
raw | patch | inline | side by side (parent: a02e9ae)
author | pjrm <pjrm@users.sourceforge.net> | |
Sun, 30 Mar 2008 12:34:46 +0000 (12:34 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Sun, 30 Mar 2008 12:34:46 +0000 (12:34 +0000) |
Add FIXME comment about insecure /tmp file.
packaging/macosx/Resources/script | patch | blob | history |
index ec3861f4d479f0b58762167726debd4e75982c08..e6b7b224d322d40d970b8498cebb309a3b58c7d3 100755 (executable)
# Author: Aaron Voisine <aaron@voisine.org>
# Inkscape Modifications: Michael Wybrow <mjwybrow@users.sourceforge.net>
-CWD="`dirname \"$0\"`"
+CWD=`dirname "$0"`
# System version: 3 for Panther, 4 for Tiger, 5 for Leopard
export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`
# from xinitrc but when is it really used? Should we modify
# the .xinitrc of the user without warning?
ps -wx -ocommand | grep -e '[X]11' > /dev/null
- if [ "$?" != "0" -a ! -f ${HOME}/.xinitrc ]; then
- echo "rm -f ${HOME}/.xinitrc" > ${HOME}/.xinitrc
- sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ${HOME}/.xinitrc
+ if [ "$?" != "0" -a ! -f "${HOME}/.xinitrc" ]; then
+ echo "rm -f \"\${HOME}/.xinitrc\"" > "${HOME}/.xinitrc"
+ sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> "${HOME}/.xinitrc"
fi
# Start X11 and get DISPLAY
+ # FIXME: Insecure tmp file usage. Why do we have to copy this to /tmp anyway?
cp -f "$CWD/bin/getdisplay.sh" /tmp/
rm -f /tmp/display.$UID
open-x11 /tmp/getdisplay.sh || \
while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do
sleep 1
done
- export DISPLAY="`cat /tmp/display.$UID`"
+ export DISPLAY=`cat /tmp/display.$UID`
ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
-BASE="`echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//'`"
+BASE=`echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//'`
cd "$BASE"
exec "$CWD/bin/inkscape" "$@"
-# TODO examine wether it would be wisest to move the code from inkscape shell
+# TODO examine whether it would be wisest to move the code from inkscape shell
# script and getdisplay.sh to here and only keep the real binary in bin. This
# may make things easier on Leopard and may also help using Inkscape on the
-# command line
+# command line.