summaryrefslogtreecommitdiffstats
path: root/x11vnc/ssltools.h
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/ssltools.h')
-rw-r--r--x11vnc/ssltools.h71
1 files changed, 50 insertions, 21 deletions
diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h
index 804767a..7d1a2e3 100644
--- a/x11vnc/ssltools.h
+++ b/x11vnc/ssltools.h
@@ -889,7 +889,12 @@ char create_display[] =
"\n"
"#CREATE_DISPLAY_OUTPUT=/tmp/cdo.txt\n"
"\n"
-"CREATE_DISPLAY_OUTPUT=/tmp/cdo.$USER.txt\n"
+"if echo \"$USER\" | egrep 'runge' > /dev/null ; then\n"
+" CREATE_DISPLAY_OUTPUT=/tmp/cdo.$USER.txt\n"
+" if [ -f $CREATE_DISPLAY_OUTPUT -a ! -w $CREATE_DISPLAY_OUTPUT ]; then\n"
+" CREATE_DISPLAY_OUTPUT=$CREATE_DISPLAY_OUTPUT.$$\n"
+" fi\n"
+"fi\n"
"if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
" if [ \"X$CREATE_DISPLAY_EXEC\" = \"X\" ]; then\n"
" CREATE_DISPLAY_EXEC=1\n"
@@ -902,6 +907,14 @@ char create_display[] =
" exit $?\n"
" fi\n"
"fi\n"
+"if [ \"X$CREATE_DISPLAY_PERL_SETPGRP\" = \"X\" ]; then\n"
+" CREATE_DISPLAY_PERL_SETPGRP=1\n"
+" export CREATE_DISPLAY_PERL_SETPGRP\n"
+" if type perl >/dev/null 2>&1; then\n"
+" perl -e \"setpgrp(0,0); exec '/bin/sh $0 $*'\";\n"
+" exit $?\n"
+" fi\n"
+"fi\n"
"\n"
"\n"
"if [ \"X$CREATE_DISPLAY_OUTPUT\" != \"X\" ]; then\n"
@@ -1076,9 +1089,9 @@ char create_display[] =
" # we cannot use -nolisten tcp\n"
" echo \"$* -once -query localhost\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
-" nohup $* -once -query localhost 1>&2 &\n"
+" $have_nohup $* -once -query localhost 1>&2 &\n"
" else\n"
-" nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile)\" 1>&2 &\n"
" ns=0\n"
" result=1\n"
" fi\n"
@@ -1093,7 +1106,7 @@ char create_display[] =
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $sxcmd $sess -- $* -nolisten tcp -auth $authfile 1>&2 &\n"
" else\n"
-" nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
" ns=0\n"
" result=1\n"
" fi\n"
@@ -1101,15 +1114,15 @@ char create_display[] =
" else\n"
" echo \"$* -nolisten tcp -auth $authfile\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
-" nohup $* -nolisten tcp -auth $authfile 1>&2 &\n"
+" $have_nohup $* -nolisten tcp -auth $authfile 1>&2 &\n"
" pid=$!\n"
" sleep 2\n"
-" nohup $sess 1>&2 &\n"
+" $have_nohup $sess 1>&2 &\n"
" else\n"
-" nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
" pid=$!\n"
" sleep 2\n"
-" nohup sh -c \"(sleep $ns; $sess)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep $ns; $sess)\" 1>&2 &\n"
" ns=0\n"
" result=1\n"
" fi\n"
@@ -1125,9 +1138,9 @@ char create_display[] =
" result=0\n"
" fi\n"
" if uname | grep SunOS > /dev/null; then\n"
-" nohup sh -c \"(sleep 60; rm -f $rmf)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep 60; rm -f $rmf)\" 1>&2 &\n"
" else\n"
-" nohup sh -c \"(sleep 60; rm -f $rmf $authfile)\" 1>&2 &\n"
+" $have_nohup sh -c \"(sleep 60; rm -f $rmf $authfile)\" 1>&2 &\n"
" fi\n"
"}\n"
"\n"
@@ -1171,24 +1184,22 @@ char create_display[] =
" return\n"
" fi\n"
"\n"
-" #save_have_startx=$have_startx\n"
-" #have_startx=\"\"\n"
" sarg=\"-screen\"\n"
" if uname | grep SunOS > /dev/null; then\n"
" if grep /usr/openwin/bin/Xsun $have_Xvfb > /dev/null; then\n"
" sarg=\"screen\"\n"
-" if [ \"X$depth\" = \"X16\" ]; then\n"
-" #depth=24\n"
-" :\n"
-" fi\n"
" fi\n"
" fi\n"
-" server $have_Xvfb :$N +kb $sarg 0 ${geom}x${depth}\n"
-" #have_startx=$save_have_startx\n"
+" # remember to put server args after sarg ... to work on Solaris 9 and 10.\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"
+" fi\n"
"\n"
" if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
" if [ \"X$have_root\" = \"X\" ]; then\n"
-" nohup sh -c \"(\n"
+" $have_nohup sh -c \"(\n"
" sleep 10;\n"
" $have_xmodmap -display :$N -e 'keycode any = Shift_R' \\\n"
" -e 'add Shift = Shift_L Shift_R' \\\n"
@@ -1265,9 +1276,9 @@ char create_display[] =
" echo \"$tmp\"\n"
"}\n"
"\n"
-"\n"
"depth=${depth:-16}\n"
"geom=${geom:-1280x1024}\n"
+"\n"
"if [ \"X$X11VNC_CREATE_GEOM\" != \"X\" -a \"X$FD_GEOM\" = \"X\" ]; then\n"
" FD_GEOM=$X11VNC_CREATE_GEOM\n"
"fi\n"
@@ -1284,6 +1295,20 @@ char create_display[] =
" fi\n"
"fi\n"
"\n"
+"depth=`echo \"$depth\" | head -1`\n"
+"geom=`echo \"$geom\" | head -1`\n"
+"\n"
+"if echo \"$depth\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
+" :\n"
+"else\n"
+" depth=16\n"
+"fi\n"
+"if echo \"$geom\" | grep '^[0-9][0-9]*x[0-9][0-9]*$' > /dev/null; then\n"
+" :\n"
+"else\n"
+" geom=1280x1024\n"
+"fi\n"
+"\n"
"if [ \"X$USER\" = \"X\" ]; then\n"
" USER=$LOGNAME\n"
"fi\n"
@@ -1304,7 +1329,7 @@ char create_display[] =
" p_ok=1\n"
"fi\n"
"\n"
-"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker metacity X Xorg XFree86 Xsun Xsession netstat\n"
+"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker metacity X Xorg XFree86 Xsun Xsession netstat nohup\n"
"do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n"
@@ -1322,6 +1347,10 @@ char create_display[] =
" fi\n"
"done\n"
"\n"
+"if [ \"X$have_nohup\" = \"X\" ]; then\n"
+" have_nohup=\"nohup\"\n"
+"fi\n"
+"\n"
"N=`findfree`\n"
"\n"
"if [ \"X$N\" = \"X\" ]; then\n"