summaryrefslogtreecommitdiffstats
path: root/x11vnc/ssltools.h
diff options
context:
space:
mode:
authorrunge <runge>2009-03-07 22:30:43 +0000
committerrunge <runge>2009-03-07 22:30:43 +0000
commite7152a7f68063a86887a9059728ca26b5404ce51 (patch)
treef7ac5e878e0655840337f10946868231e10dd9ba /x11vnc/ssltools.h
parenteb1cc7608b91996199dae88663ee0d14d5d5b3f7 (diff)
downloadlibtdevnc-e7152a7f68063a86887a9059728ca26b5404ce51.tar.gz
libtdevnc-e7152a7f68063a86887a9059728ca26b5404ce51.zip
Allow range for X11VNC_SKIP_DISPLAY, document grab
Xserver issue. Add progress_client() to proceed more quickly thru handshake. Improvements to turbovnc hack.
Diffstat (limited to 'x11vnc/ssltools.h')
-rw-r--r--x11vnc/ssltools.h86
1 files changed, 67 insertions, 19 deletions
diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h
index c6ff87b..04cd081 100644
--- a/x11vnc/ssltools.h
+++ b/x11vnc/ssltools.h
@@ -908,6 +908,62 @@ char find_display[] =
" echo \"$tf\"\n"
"}\n"
"\n"
+"skip_display() {\n"
+" dtry=$1\n"
+" if [ \"X$X11VNC_SKIP_DISPLAY\" = \"X\" ]; then\n"
+" # no skip list, return display:\n"
+" echo \"$dtry\"\n"
+" else\n"
+" # user supplied skip list:\n"
+" mat=\"\"\n"
+" slist=\"\"\n"
+" for skip in `echo \"$X11VNC_SKIP_DISPLAY\" | tr ',' '\\n'`\n"
+" do\n"
+" if echo \"$skip\" | sed -e 's/://g' | grep '^[0-9][0-9]*-[0-9][0-9]*$' > /dev/null; then\n"
+" # a range n-m\n"
+" min=`echo \"$skip\" | sed -e 's/://g' | awk -F- '{print $1}'`\n"
+" max=`echo \"$skip\" | sed -e 's/://g' | awk -F- '{print $2}'`\n"
+" if [ \"$min\" -le \"$max\" ]; then\n"
+" while [ $min -le $max ]\n"
+" do\n"
+" if [ \"X$slist\" = \"X\" ]; then\n"
+" slist=\"$min\"\n"
+" else\n"
+" slist=\"$slist $min\"\n"
+" fi\n"
+" min=`expr $min + 1`\n"
+" done\n"
+" continue\n"
+" fi\n"
+" fi\n"
+" # a simple :n or n (or user supplied garbage).\n"
+" if [ \"X$slist\" = \"X\" ]; then\n"
+" slist=\"$skip\"\n"
+" else\n"
+" slist=\"$slist $skip\"\n"
+" fi\n"
+" done\n"
+"\n"
+" for skip in $slist\n"
+" do\n"
+" if echo \"$skip\" | grep \"^:\" > /dev/null; then\n"
+" :\n"
+" else\n"
+" skip=\":$skip\"\n"
+" fi\n"
+" if echo \"$skip\" | grep \":$dtry\\>\" > /dev/null; then\n"
+" mat=1\n"
+" break\n"
+" fi\n"
+" done\n"
+" if [ \"X$mat\" = \"X1\" ]; then\n"
+" echo \"\"\n"
+" else\n"
+" echo \"$dtry\"\n"
+" fi\n"
+" fi\n"
+"}\n"
+"\n"
"\n"
"# this mode is to try to grab a display manager (gdm, kdm, xdm...) display\n"
"# when we are run as root (e.g. no one is logged in yet). We look at the\n"
@@ -919,6 +975,10 @@ char find_display[] =
" do\n"
" da=`echo \"$pair\" | awk -F, '{print $1}'`\n"
" xa=`echo \"$pair\" | awk -F, '{print $2}'`\n"
+" da=`skip_display \"$da\"`\n"
+" if [ \"X$da\" = \"X\" ]; then\n"
+" continue\n"
+" fi\n"
" if [ -f $xa -a -r $xa ]; then\n"
" # if we have an xauth file, we proceed to test it:\n"
" #\n"
@@ -1036,25 +1096,9 @@ char find_display[] =
" xa=`echo \"$p\" | awk -F, '{print $2}'`\n"
" d=`echo \"$p\" | sed -e 's/,.*$//' -e 's/://' -e 's/\\..*$//'`\n"
" ok=\"\"\n"
-" if [ \"X$X11VNC_SKIP_DISPLAY\" != \"X\" ]; then\n"
-" # user supplied skip list:\n"
-" mat=\"\"\n"
-" for skip in `echo $X11VNC_SKIP_DISPLAY | tr ',' '\\n'`\n"
-" do\n"
-" if echo \"$skip\" | grep \"^:\" > /dev/null; then\n"
-" :\n"
-" else\n"
-" skip=\":$skip\"\n"
-" fi\n"
-" if echo \"$skip\" | grep \":$d\\>\" > /dev/null; then\n"
-" mat=1\n"
-" break\n"
-" \n"
-" fi\n"
-" done\n"
-" if [ \"X$mat\" = \"X1\" ]; then\n"
-" continue\n"
-" fi\n"
+" d=`skip_display \"$d\"`\n"
+" if [ \"X$d\" = \"X\" ]; then\n"
+" continue;\n"
" fi\n"
"\n"
" # check for the local X11 files:\n"
@@ -1158,6 +1202,10 @@ char find_display[] =
" else\n"
" myenv=\"FOO_BAR_=baz\"\n"
" fi\n"
+" p=`skip_display \"$p\"`\n"
+" if [ \"X$p\" = \"X\" ]; then\n"
+" continue\n"
+" fi\n"
" env \"$myenv\" xdpyinfo -display \"$p\" >/dev/null 2>&1\n"
" rc=$?\n"
" if [ $rc != 0 -a \"X$XAUTHLOCALHOSTNAME\" = \"X\" ]; then\n"