summaryrefslogtreecommitdiffstats
path: root/x11vnc/ssltools.h
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/ssltools.h')
-rw-r--r--x11vnc/ssltools.h94
1 files changed, 67 insertions, 27 deletions
diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h
index 5518533..6635bdf 100644
--- a/x11vnc/ssltools.h
+++ b/x11vnc/ssltools.h
@@ -271,13 +271,13 @@ char genCA[] =
" -keyout \"$DIR/CA/private/cakey.pem\" \\\n"
" -out \"$DIR/CA/cacert.pem\"\n"
"\n"
-"chmod go-rwx \"$DIR/CA/private/cakey.pem\"\n"
-"\n"
"if [ $? != 0 ]; then\n"
" echo \"openssl failed.\"\n"
" exit 1\n"
"fi\n"
"\n"
+"chmod go-rwx \"$DIR/CA/private/cakey.pem\"\n"
+"\n"
"echo \"\"\n"
"echo \"----------------------------------------------------------------------\"\n"
"echo \"Your public x11vnc CA cert is:\"\n"
@@ -785,6 +785,10 @@ char find_display[] =
" set -xv\n"
"fi\n"
"\n"
+"if [ \"X$X11VNC_SKIP_DISPLAY\" = \"Xall\" ]; then\n"
+" exit 1\n"
+"fi\n"
+"\n"
"PATH=$PATH:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/ucb\n"
"export PATH\n"
"\n"
@@ -1439,7 +1443,11 @@ char create_display[] =
" return\n"
" fi\n"
" if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n"
-" echo \"$have_gnome_session\"\n"
+" if [ \"X$have_dbus_launch\" != \"X\" ]; then\n"
+" echo \"$have_dbus_launch --exit-with-session $have_gnome_session\"\n"
+" else\n"
+" echo \"$have_gnome_session\"\n"
+" fi\n"
" return\n"
" elif [ \"X$have_startkde\" != \"X\" -a \"X$FD_SESS\" = \"Xkde\" ]; then\n"
" echo \"$have_startkde\"\n"
@@ -1692,8 +1700,10 @@ char create_display[] =
" DISPLAY=:$N\n"
" export DISPLAY\n"
" stmp=\"\"\n"
+" noxauth=\"\"\n"
" if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
" sess=\"env DISPLAY=:$N $sess\"\n"
+" noxauth=\"1\"\n"
" fi\n"
"\n"
" redir_daemon=\"\"\n"
@@ -1706,27 +1716,34 @@ char create_display[] =
" touch $stmp\n"
" chmod 755 $stmp || exit 1\n"
" echo \"#!/bin/sh\" > $stmp\n"
+" #echo \"(id; env; env | grep XAUTHORITY | sed -e 's/XAUTHORITY=//' | xargs ls -l) > /tmp/ENV.OUT.$$\" >> $stmp\n"
+" if [ \"X$noxauth\" = \"X1\" ]; then\n"
+" echo \"unset XAUTHORITY\" >> $stmp\n"
+" fi\n"
" echo \"$sess\" >> $stmp\n"
" echo \"sleep 1\" >> $stmp\n"
" echo \"rm -f $stmp\" >> $stmp\n"
" sess=$stmp\n"
" rmf=\"$stmp\"\n"
" fi\n"
+"\n"
" if [ \"X$have_root\" != \"X\" -a \"X$USER\" != \"Xroot\" ]; then\n"
-" ctmp=/tmp/.xat$$`random`\n"
-" ctmp=`mytmp \"$ctmp\"`\n"
-" touch $ctmp\n"
-" chmod 644 $ctmp || exit 1\n"
-" $have_xauth -f $authfile nextract - :$N > $ctmp\n"
-" su - $USER -c \"$have_xauth nmerge - < $ctmp\" 1>&2\n"
-" $have_xauth -f $authfile nextract - `hostname`:$N > $ctmp\n"
-" su - $USER -c \"$have_xauth nmerge - < $ctmp\" 1>&2\n"
-" rm -f $ctmp\n"
+" ctmp1=/tmp/.xat1_$$`random`\n"
+" ctmp1=`mytmp \"$ctmp1\"`\n"
+" ctmp2=/tmp/.xat2_$$`random`\n"
+" ctmp2=`mytmp \"$ctmp2\"`\n"
+" touch $ctmp1 $ctmp2\n"
+" $have_xauth -f $authfile nextract - :$N > $ctmp1\n"
+" $have_xauth -f $authfile nextract - `hostname`:$N > $ctmp2\n"
+" chown $USER $ctmp1 $ctmp2\n"
+" (unset XAUTHORITY; su - $USER -c \"$have_xauth nmerge - < $ctmp1\" 1>&2)\n"
+" (unset XAUTHORITY; su - $USER -c \"$have_xauth nmerge - < $ctmp2\" 1>&2)\n"
+" rm -f $ctmp1 $ctmp2\n"
" XAUTHORITY=$authfile\n"
" export XAUTHORITY\n"
" sess=\"/bin/su - $USER -c $sess\"\n"
" else\n"
-" $have_xauth -f $authfile nextract - :$N | $have_xauth nmerge -\n"
+" $have_xauth -f $authfile nextract - :$N | $have_xauth nmerge -\n"
" $have_xauth -f $authfile nextract - `hostname`:$N | $have_xauth nmerge -\n"
" fi\n"
"\n"
@@ -1742,7 +1759,12 @@ char create_display[] =
" # we cannot use -nolisten tcp\n"
" echo \"$* -once -query localhost $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
-" $have_nohup $* -once -query localhost $FD_OPTS 1>&2 &\n"
+" if [ -r $authfile ]; then\n"
+" $have_nohup $* -once -query localhost -auth $authfile $FD_OPTS 1>&2 &\n"
+" else\n"
+" # why did we have this?\n"
+" $have_nohup $* -once -query localhost $FD_OPTS 1>&2 &\n"
+" fi\n"
" else\n"
" if [ \"X$ns\" = \"X0\" ]; then\n"
" $have_nohup sh -c \"$* -once -query localhost -auth $authfile $FD_OPTS\" 1>&2 &\n"
@@ -1754,10 +1776,10 @@ char create_display[] =
" pid=$!\n"
" sleep 10\n"
" elif [ \"X$have_startx\" != \"X\" -o \"X$have_xinit\" != \"X\" ]; then\n"
-" if [ \"X$have_startx\" != \"X\" ]; then\n"
-" sxcmd=$have_startx\n"
-" else\n"
+" if [ \"X$have_xinit\" != \"X\" ]; then\n"
" sxcmd=$have_xinit\n"
+" else\n"
+" sxcmd=$have_startx\n"
" fi\n"
" echo \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
@@ -1924,12 +1946,18 @@ char create_display[] =
" sarg=\"screen\"\n"
" fi\n"
" fi\n"
-" # remember to put server args after sarg ... to work on Solaris 9 and 10.\n"
+" margs=\"+kb\"\n"
+"\n"
+" # currently not enabled in Xvfb's we see.\n"
+"# if $have_Xvfb -extension MOOMOO 2>&1 | grep -w RANDR >/dev/null; then\n"
+"# margs=\"$margs +extension RANDR\"\n"
+"# fi\n"
+"\n"
" if [ $depth -ge 16 ]; then\n"
-" server $have_Xvfb :$N $sarg 0 ${geom}x${depth} +kb -cc 4\n"
-" else\n"
-" server $have_Xvfb :$N $sarg 0 ${geom}x${depth} +kb\n"
+" # avoid DirectColor for default visual:\n"
+" margs=\"$margs -cc 4\"\n"
" fi\n"
+" server $have_Xvfb :$N $sarg 0 ${geom}x${depth} $margs\n"
"\n"
" if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
" if [ \"X$have_root\" = \"X\" ]; then\n"
@@ -2030,6 +2058,10 @@ char create_display[] =
" cook=`cookie`\n"
" $have_xauth -f $tmp add :$N . $cook 1>&2\n"
" $have_xauth -f $tmp add `hostname`:$N . $cook 1>&2\n"
+" if [ \"X$CREATE_DISPLAY_EXEC\" != \"X\" ]; then\n"
+" ls -l $tmp 1>&2\n"
+" $have_xauth -f $tmp list 1>&2\n"
+" fi\n"
" echo \"$tmp\"\n"
"}\n"
"\n"
@@ -2117,7 +2149,7 @@ char create_display[] =
" USER=`whoami`\n"
"fi\n"
"\n"
-"PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin\n"
+"PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde4/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin\n"
"\n"
"have_root=\"\"\n"
"id0=`id`\n"
@@ -2130,7 +2162,7 @@ char create_display[] =
" p_ok=1\n"
"fi\n"
"\n"
-"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth xdpyinfo mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker enlightenment metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup esddsp konsole gnome-terminal perl startxfce4 startxfce\n"
+"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth xdpyinfo mcookie md5sum xmodmap startkde dbus-launch gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker enlightenment metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup esddsp konsole gnome-terminal x-terminal-emulator perl startxfce4 startxfce\n"
"do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n"
@@ -2148,10 +2180,12 @@ char create_display[] =
" fi\n"
"done\n"
"if [ \"X$have_xterm\" = \"X\" ]; then\n"
-" if [ \"X$have_konsole\" != \"X\" ]; then\n"
-" have_xterm=$have_konsole\n"
-" elif [ \"X$have_gnome_terminal\" != \"X\" ]; then\n"
+" if [ \"X$have_gnome_terminal\" != \"X\" ]; then\n"
" have_xterm=$have_gnome_terminal\n"
+" elif [ \"X$have_konsole\" != \"X\" ]; then\n"
+" have_xterm=$have_konsole\n"
+" elif [ \"X$have_x_terminal_emulator\" != \"X\" ]; then\n"
+" have_xterm=$have_x_terminal_emulator\n"
" fi\n"
"fi\n"
"\n"
@@ -2182,9 +2216,15 @@ char create_display[] =
" if echo \"$curr_try\" | egrep '[+.-]xdmcp' > /dev/null; then\n"
" use_xdmcp_query=1\n"
" fi\n"
+"\n"
+" if [ \"X$X11VNC_XDM_ONLY\" = \"X1\" -a \"X$use_xdmcp_query\" = \"X0\" ]; then\n"
+" echo \"SKIPPING NON-XDMCP item '$curr_try' in X11VNC_XDM_ONLY=1 mode.\" 1>&2\n"
+" continue\n"
+" fi\n"
+" \n"
" curr_try=`echo \"$curr_try\" | sed -e 's/[+.-]xdmcp//'`\n"
" curr_try=`echo \"$curr_try\" | sed -e 's/[+.-]redirect//'`\n"
-" \n"
+"\n"
" if echo \"$curr_try\" | grep -i '^Xdummy\\>' > /dev/null; then\n"
" try_Xdummy\n"
" elif echo \"$curr_try\" | grep -i '^Xvfb\\>' > /dev/null; then\n"