summaryrefslogtreecommitdiffstats
path: root/x11vnc/ssltools.h
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-12-15 09:17:37 -0500
committerrunge <runge@karlrunge.com>2009-12-15 09:17:37 -0500
commitd6c012e9688d32d80c288541615c01cd082ecf0a (patch)
tree83ab0988d56d3a4f29cd419a8d20381fb35ed128 /x11vnc/ssltools.h
parent8f5c9ef01ef9101cf8f8d8f1eacdaab27ac7c2c8 (diff)
downloadlibtdevnc-d6c012e9688d32d80c288541615c01cd082ecf0a.tar.gz
libtdevnc-d6c012e9688d32d80c288541615c01cd082ecf0a.zip
X props names via env var. fakebuttonevent action, connect_switch and
ultravnc_repeater.pl scripts, find_display try FD_XDM on failure, -quiet and -storepasswd changes, better port 113 testing.
Diffstat (limited to 'x11vnc/ssltools.h')
-rw-r--r--x11vnc/ssltools.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h
index e6f82c3..ebd8683 100644
--- a/x11vnc/ssltools.h
+++ b/x11vnc/ssltools.h
@@ -911,7 +911,7 @@ char find_display[] =
" dL=\"-h\"\n"
"fi\n"
"\n"
-"# a portable, but not absolutely safe, tmp file creator\n"
+"# a portable tmp file creator\n"
"mytmp() {\n"
" tf=$1\n"
" if type mktemp > /dev/null 2>&1; then\n"
@@ -1462,7 +1462,26 @@ char create_display[] =
" fi\n"
" while [ $try -lt $sry ]\n"
" do\n"
-" if [ ! -f \"/tmp/.X${try}-lock\" ]; then\n"
+" tlock=\"/tmp/.X${try}-lock\"\n"
+" if [ -r $tlock ]; then\n"
+" if echo \"$nsout\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
+" :\n"
+" else\n"
+" pid=`head -n 1 $tlock 2>/dev/null | sed -e 's/[ ]//g' | grep '^[0-9][0-9]*$'`\n"
+" if [ \"X$pid\" != \"X\" ]; then\n"
+" exists=0\n"
+" if [ -d /proc/$pid ]; then\n"
+" exists=1\n"
+" elif kill -0 $pid 2>/dev/null; then\n"
+" exists=1\n"
+" fi\n"
+" if [ \"X$exists\" = \"X0\" ]; then\n"
+" rm -f $tlock\n"
+" fi\n"
+" fi\n"
+" fi\n"
+" fi\n"
+" if [ ! -f $tlock ]; then\n"
" if echo \"$nsout\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
" :\n"
" else\n"
@@ -1715,7 +1734,7 @@ char create_display[] =
" dL=\"-h\"\n"
"fi\n"
"\n"
-"# a portable, but not absolutely safe, tmp file creator\n"
+"# a portable tmp file creator\n"
"mytmp() {\n"
" tf=$1\n"
" if type mktemp > /dev/null 2>&1; then\n"