Permalink
Browse files

Fix PCDMd to use a randomized authorization file name in the /tmp dir…

…ectory
  • Loading branch information...
1 parent 2ec77c7 commit 89cdf9c7832f365accd96f4433d29dab44d5107d Ken Moore committed Nov 15, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 src-qt4/PCDM/PCDMd
View
@@ -4,7 +4,7 @@
#------------------------------------
PCDMCONF="/usr/local/etc/pcdm.conf"
-PCDMAUTHFILE="/tmp/.PCDMAuth"
+BASEPCDMAUTHFILE="/tmp/.PCDMAuth"
XOPTS=""
grep -q "^ENABLE_TCP_LISTEN=TRUE" ${PCDMCONF}
@@ -38,6 +38,8 @@ touch /tmp/.PCDMAutoLogin
# Now start the X Server
while [ ! -e /var/run/nologin ]; do
/usr/local/bin/pc-checkxdisplay
+ # Randomize the authorization file location
+ PCDMAUTHFILE=${BASEPCDMAUTHFILE}-`openssl rand -hex 10`
# Make sure the authorization file does not exist
if [ -f ${PCDMAUTHFILE} ]; then
rm ${PCDMAUTHFILE}
@@ -50,4 +52,6 @@ while [ ! -e /var/run/nologin ]; do
(sleep 10 ; $vnccmd >/var/log/vncserver 2>/var/log/vncserver) &
fi
xinit /usr/local/bin/PCDM-session -once -- :0 -auth ${PCDMAUTHFILE} $XOPTS
+ #Now remove the authorization file
+ rm ${PCDMAUTHFILE}
done

0 comments on commit 89cdf9c

Please sign in to comment.