[Xfce4-commits] r24802 - xfce-utils/branches/xfce_4_2/scripts
Olivier Fourdan
olivier at xfce.org
Thu Feb 1 21:41:35 CET 2007
Author: olivier
Date: 2007-02-01 20:41:34 +0000 (Thu, 01 Feb 2007)
New Revision: 24802
Modified:
xfce-utils/branches/xfce_4_2/scripts/xinitrc
Log:
Fix insecure use of temporary file in startup script
Modified: xfce-utils/branches/xfce_4_2/scripts/xinitrc
===================================================================
--- xfce-utils/branches/xfce_4_2/scripts/xinitrc 2007-01-31 23:03:30 UTC (rev 24801)
+++ xfce-utils/branches/xfce_4_2/scripts/xinitrc 2007-02-01 20:41:34 UTC (rev 24802)
@@ -5,12 +5,6 @@
UID=`id -u`
fi
-# create temp file for X resources
-XRESOURCES="/tmp/xrdb-$UID.$$"
-
-# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
-test -r $HOME/.Xdefaults && cat $HOME/.Xdefaults >> $XRESOURCES
-
# Check if the user wants to override the above defaults (set by
# mcs ui plugin)
if test "x$XDG_CONFIG_HOME" = "x" ; then
@@ -19,31 +13,29 @@
BASEDIR=$XDG_CONFIG_HOME/xfce4
fi
-if test -r $BASEDIR/Xft.xrdb; then
- cat $BASEDIR/Xft.xrdb >> $XRESOURCES
-elif test -r $XFCE4HOME/Xft.xrdb; then
- mkdir -p $BASEDIR
- cp $XFCE4HOME/Xft.xrdb $BASEDIR/
- cat $BASEDIR/Xft.xrdb >> $XRESOURCES
-else
- # Those are fallback settings, use the ui plugin to change it
- # or add your overrides to ~/.Xresources
- # Xft DPI: 96
- # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
- # Xft hinting: 1/0
- cat >> $XRESOURCES << EOF
-Xft.dpi: 96
-Xft.hinting: 1
-Xft.hintstyle: hintmedium
-EOF
+# For now, start with an empty list
+XRESOURCES=""
+
+# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
+test -r $HOME/.Xdefaults && XRESOURCES=$HOME/.Xdefaults
+
+BASEDIR=$XDG_CONFIG_HOME/xfce4
+if test -r "$BASEDIR/Xft.xrdb"; then
+ XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
+elif test -r "$XFCE4HOME/Xft.xrdb"; then
+ mkdir -p "$BASEDIR"
+ cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
+ XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi
+# merge in X cursor settings
+test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"
+
# ~/.Xresources contains overrides to the above
-test -r $HOME/.Xresources && cat $HOME/.Xresources >> $XRESOURCES
+test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"
-# load all X resources
-xrdb -nocpp -merge $XRESOURCES
-rm -f $XRESOURCES
+# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
+cat /dev/null $XRESOURCES | xrdb -nocpp -merge -
# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
More information about the Xfce4-commits
mailing list