summaryrefslogtreecommitdiffstats
path: root/x11vnc/ssltools.h
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/ssltools.h')
-rw-r--r--x11vnc/ssltools.h41
1 files changed, 31 insertions, 10 deletions
diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h
index 89849a5..9c74d5f 100644
--- a/x11vnc/ssltools.h
+++ b/x11vnc/ssltools.h
@@ -1151,7 +1151,7 @@ char find_display[] =
" list=\"$list \"`xauth list | awk '{print $1}' | grep /unix | grep \"^${host}\" | sed -e 's/^.*:/:/' | sort -n | uniq`\n"
"\n"
" # check for gdm and kdm non-NFS cookies in /tmp: (and now /var/run/gdm)\n"
-" for xa in /tmp/.gdm* /tmp/.Xauth* /var/run/gdm/auth-for-*/database /var/run/gdm/auth-cookie-*-for-*\n"
+" for xa in /tmp/.gdm* /tmp/.Xauth* /var/run/gdm*/auth-for-*/database /var/run/gdm*/auth-cookie-*-for-*\n"
" do\n"
" # try to be somewhat careful about the real owner of the file:\n"
" if [ \"X$am_root\" = \"X1\" ]; then\n"
@@ -1307,16 +1307,34 @@ char find_display[] =
" if [ \"X$p\" = \"X\" ]; then\n"
" continue\n"
" fi\n"
+"\n"
" env \"$myenv\" xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
" rc=$?\n"
-" if [ $rc != 0 -a \"X$XAUTHLOCALHOSTNAME\" = \"X\" ]; then\n"
+"\n"
+" if [ $rc != 0 ]; then\n"
" # guard against libxcb/desktop silliness: \n"
-" env \"$myenv\" XAUTHLOCALHOSTNAME=localhost xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
-" rc=$?\n"
-" if [ $rc = 0 ]; then\n"
-" # better export it for cmds below...\n"
-" XAUTHLOCALHOSTNAME=localhost\n"
-" export XAUTHLOCALHOSTNAME\n"
+" xalhn_save=$XAUTHLOCALHOSTNAME\n"
+"\n"
+" if [ \"X$xalhn_save\" != \"X\" ]; then\n"
+" # try it again unset\n"
+" unset XAUTHLOCALHOSTNAME\n"
+" env \"$myenv\" xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
+" rc=$?\n"
+" if [ $rc != 0 ]; then\n"
+" # did not work; put it back\n"
+" XAUTHLOCALHOSTNAME=$xalhn_save\n"
+" export XAUTHLOCALHOSTNAME\n"
+" fi\n"
+" fi\n"
+" if [ $rc != 0 -a \"X$xalhn_save\" != \"Xlocalhost\" ]; then\n"
+" # try it again with localhost\n"
+" env \"$myenv\" XAUTHLOCALHOSTNAME=localhost xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
+" rc=$?\n"
+" if [ $rc = 0 ]; then\n"
+" # better export it for cmds below...\n"
+" XAUTHLOCALHOSTNAME=localhost\n"
+" export XAUTHLOCALHOSTNAME\n"
+" fi\n"
" fi\n"
" fi\n"
"\n"
@@ -1460,11 +1478,14 @@ char create_display[] =
"\n"
"findfree() {\n"
" try=20\n"
-" sry=99\n"
+" dpymax=79\n"
" if [ \"X$X11VNC_CREATE_STARTING_DISPLAY_NUMBER\" != \"X\" ]; then\n"
" try=$X11VNC_CREATE_STARTING_DISPLAY_NUMBER\n"
-" sry=`expr $try + 99`\n"
" fi\n"
+" if [ \"X$X11VNC_CREATE_MAX_DISPLAYS\" != \"X\" ]; then\n"
+" dpymax=$X11VNC_CREATE_MAX_DISPLAYS\n"
+" fi\n"
+" sry=`expr $try + $dpymax`\n"
" n=\"\"\n"
" nsout=\"\"\n"
" if [ \"X$have_netstat\" != \"X\" ]; then\n"