Commit 5f9693d4 authored by runge's avatar runge

Add Darwin stuff. Sync to current 1.0.7

parent 2635ae44
......@@ -20,6 +20,7 @@ by others. See these sites and related ones for more information:
http://stunnel.mirt.net
http://www.openssl.org
http://www.chiark.greenend.org.uk/~sgtatham/putty/
http://sourceforge.net/projects/cotvnc/
Note: Some of the Windows binaries included contain cryptographic software
that you may not be allowed to download, use, or redistribute. Please
......@@ -107,6 +108,9 @@ README is in) and like this:
./build.unix
To use custom locations for libraries see the LDFLAGS_OS and CPPFLAGS_OS
description at the top of the build.unix script.
The programs:
------------
......@@ -129,9 +133,10 @@ you can run this instead:
this is essentially the same GUI that is run on Windows (the
ssl_tightvncviewer.exe).
Using the GUI is it impossible to initiate a VNC connection that is not
encrypted with either SSL or SSH. Unencrypted VNC connections can only
be started by manually running the ./bin/tightvncviewer script.
Using the GUI is it not possible (well not easy) to initiate
a VNC connection that is not encrypted with either SSL or SSH.
Unencrypted VNC connections can only be started by manually running the
./bin/tightvncviewer script.
For convenience, you can make symlinks from a directory in your PATH to
any of the 3 programs above you wish to run. That is all you usually
......@@ -144,6 +149,10 @@ assuming $HOME/bin is in your $PATH:
(note the "." at the end). The above commands is basically the way to
"install" this package on Unix.
Also symlinks to the GUI launcher script are provided in:
MacOSX/ssl_vnc_gui.sh
Unix/ssl_vnc_gui
On Windows unpack your archive and run:
......@@ -224,6 +233,7 @@ See also:
http://www.tightvnc.com
http://www.realvnc.com
http://www.chiark.greenend.org.uk/~sgtatham/putty/
http://sourceforge.net/projects/cotvnc/
Windows:
......
#!/bin/sh
cp -p vncviewer.sh vncviewer
pwd
ls -l vncviewer.sh vncviewer
(cd ../Darwin.i386; .cpover)
#!/bin/sh
# copy "vncviewer.sh" back over to "vncviewer" in case you delete or overwrite it
# via build.unix. etc
dir=`dirname "$0"`
if [ "X$DISPLAY" != "X" ]; then
"$dir/vncviewer.x11" "$@"
else
args=""
for a in "$@"
do
if echo "$a" | grep '^-' > /dev/null; then
args="$args $a"
elif echo "$a" | grep ':' > /dev/null; then
h=`echo "$a" | awk -F: '{print $1}'`
p=`echo "$a" | awk -F: '{print $2}'`
if [ "X$p" != "X" ]; then
if [ $p -lt 5900 ]; then
p=`expr $p + 5900`
fi
fi
args="$args $h:$p"
else
args="$args $a"
fi
done
"$dir/../../MacOSX/Chicken of the VNC.app/Contents/MacOS/Chicken of the VNC" $args
fi
#!/bin/sh
cp -p ../Darwin.Power.Macintosh/vncviewer.sh .
cp -p vncviewer.sh vncviewer
pwd
ls -l vncviewer.sh vncviewer
......@@ -36,6 +36,10 @@
# -grab
#
#
# If the *very first* argument is "-cotvnc" then it is assumed you are on
# Darwin and want to run the Chicken of the VNC viewer via our wrapper.
#
#
# See the TightVNC viewer documentation for on its cmdline arguments.
#
# For convenience, here is the current (7/2006) TightVNC viewer -help output:
......@@ -73,7 +77,7 @@
#
if [ "X$1" = "X-h" -o "X$1" = "X-help" -o "X$1" = "X--help" ]; then
head -70 "$0" | grep -v bin/sh
head -76 "$0" | grep -v bin/sh
exit
fi
......@@ -84,26 +88,44 @@ export PATH
# Set this for ssl_vncviewer to pick up:
#
VNCVIEWERCMD="vncviewer"
export VNCVIEWERCMD
use_ours=0
if [ "X$1" = "X-cotvnc" ]; then
shift
DARWIN_COTVNC=1
export DARWIN_COTVNC
fi
if [ "X$VNCVIEWERCMD" = "X" ]; then
VNCVIEWERCMD="vncviewer"
export VNCVIEWERCMD
if [ "X$DARWIN_COTVNC" = "X" ]; then
use_ours=1
fi
fi
# work out os.arch platform string and check for binaries:
#
name=$UNAME
if [ "X$name" = "X" ]; then
name=`uname -sm | sed -e 's/ /./'`
name=`uname -sm | sed -e 's/ /./g'`
fi
if [ -L "$0" ]; then
d=`dirname "\`ls -l "$0" | sed -e 's/^.* -> //'\`"`
if echo "$d" | grep '^/' > /dev/null; then
dir="$d"
f="$0"
for t in 1 2 3 4 5
do
if [ -L "$f" ]; then
f0="$f"
f=`ls -l "$f" | sed -e 's/^.* -> //'`
if echo "$f" | grep '^/' > /dev/null; then
:
else
f="`dirname "$f0"`/$f"
fi
else
dir="`dirname "$0"`/$d"
break
fi
else
dir=`dirname "$0"`
fi
done
dir=`dirname "$f"`
if [ ! -d "$dir/$name" ]; then
echo "cannot find platform dir: $dir/$name for your OS:"
uname -sm
......@@ -115,10 +137,22 @@ fi
# pick them up:
#
PATH="$dir:$dir/$name:$dir/util:$PATH"
if echo "$dir" | grep '^/' > /dev/null; then
:
else
dir=`pwd`/$dir
PATH="$dir:$dir/$name:$dir/util:$PATH"
fi
STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"}
export STUNNEL_EXTRA_OPTS
# Force the use of tight encoding for localhost redir connection:
# If ours (and not cotvnc), force the use of tight encoding for localhost
# redir connection:
#
ssl_vncviewer "$@" -encodings 'copyrect tight zrle zlib hextile'
#
if [ $use_ours = 1 ]; then
ssl_vncviewer "$@" -encodings 'copyrect tight zrle zlib hextile'
else
ssl_vncviewer "$@"
fi
......@@ -21,6 +21,7 @@ fi
PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin
export PATH
SSL_VNC_GUI_CMD="$0 $*"
export SSL_VNC_GUI_CMD
SSL_VNC_LAUNCH=$SSL_VNC_GUI_CMD
......@@ -30,19 +31,26 @@ export SSL_VNC_LAUNCH
#
name=$UNAME
if [ "X$name" = "X" ]; then
name=`uname -sm | sed -e 's/ /./'`
name=`uname -sm | sed -e 's/ /./g'`
fi
if [ -L "$0" ]; then
d=`dirname "\`ls -l "$0" | sed -e 's/^.* -> //'\`"`
if echo "$d" | grep '^/' > /dev/null; then
dir="$d"
f="$0"
for t in 1 2 3 4 5
do
if [ -L "$f" ]; then
f0="$f"
f=`ls -l "$f" | sed -e 's/^.* -> //'`
if echo "$f" | grep '^/' > /dev/null; then
:
else
f="`dirname "$f0"`/$f"
fi
else
dir="`dirname "$0"`/$d"
break
fi
else
dir=`dirname "$0"`
fi
done
dir=`dirname "$f"`
if [ ! -d "$dir/$name" ]; then
echo "cannot find platform dir: $dir/$name for your OS:"
uname -sm
......@@ -54,6 +62,12 @@ fi
# pick them up:
#
PATH="$dir:$dir/$name:$dir/util:$PATH"
if echo "$dir" | grep '^/' > /dev/null; then
:
else
dir=`pwd`/$dir
PATH="$dir:$dir/$name:$dir/util:$PATH"
fi
SSL_VNC_BASEDIR="$dir"
export SSL_VNC_BASEDIR
......
......@@ -32,7 +32,10 @@
#
# "hostname:N" is the host and VNC display to connect to, e.g. snoopy:0
#
# If the first argument is "-ssl" then ssl_tightvncviewer is called
# If the *very first* argument is "-cotvnc" then it is assumed you are on
# Darwin and want to run the Chicken of the VNC viewer via our wrapper.
#
# If the next argument is "-ssl" then ssl_tightvncviewer is called
# instead. See that script for details.
#
# See the TightVNC viewer documentation for on its cmdline arguments.
......@@ -72,7 +75,7 @@
#
if [ "X$1" = "X-h" -o "X$1" = "X-help" -o "X$1" = "X--help" ]; then
head -69 "$0" | grep -v bin/sh
head -76 "$0" | grep -v bin/sh
exit
fi
......@@ -83,26 +86,44 @@ export PATH
# Set this for ssl_vncviewer to pick up:
#
VNCVIEWERCMD="vncviewer"
export VNCVIEWERCMD
use_ours=0
if [ "X$1" = "X-cotvnc" ]; then
shift
DARWIN_COTVNC=1
export DARWIN_COTVNC
fi
if [ "X$VNCVIEWERCMD" = "X" ]; then
VNCVIEWERCMD="vncviewer"
export VNCVIEWERCMD
if [ "X$DARWIN_COTVNC" = "X" ]; then
use_ours=1
fi
fi
# work out os.arch platform string and check for binaries:
#
name=$UNAME
if [ "X$name" = "X" ]; then
name=`uname -sm | sed -e 's/ /./'`
name=`uname -sm | sed -e 's/ /./g'`
fi
if [ -L "$0" ]; then
d=`dirname "\`ls -l "$0" | sed -e 's/^.* -> //'\`"`
if echo "$d" | grep '^/' > /dev/null; then
dir="$d"
f="$0"
for t in 1 2 3 4 5
do
if [ -L "$f" ]; then
f0="$f"
f=`ls -l "$f" | sed -e 's/^.* -> //'`
if echo "$f" | grep '^/' > /dev/null; then
:
else
f="`dirname "$f0"`/$f"
fi
else
dir="`dirname "$0"`/$d"
break
fi
else
dir=`dirname "$0"`
fi
done
dir=`dirname "$f"`
if [ ! -d "$dir/$name" ]; then
echo "cannot find platform dir: $dir/$name for your OS:"
uname -sm
......@@ -114,6 +135,15 @@ fi
# pick them up:
#
PATH="$dir:$dir/$name:$dir/util:$PATH"
if echo "$dir" | grep '^/' > /dev/null; then
:
else
dir=`pwd`/$dir
PATH="$dir:$dir/$name:$dir/util:$PATH"
fi
STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"}
export STUNNEL_EXTRA_OPTS
if [ "X$1" = "X-ssl" ]; then
shift
......@@ -121,9 +151,13 @@ if [ "X$1" = "X-ssl" ]; then
exit $?
fi
STUNNEL_EXTRA_OPTS=${STUNNEL_EXTRA_OPTS:-"maxconn = 1"}
export STUNNEL_EXTRA_OPTS
# Force the use of tight encoding for localhost redir connection:
#
vncviewer -encodings 'copyrect tight zrle zlib hextile' "$@"
# If ours (and not doing cotvnc), force the use of tight encoding for
# the connection:
#
if [ $use_ours = 1 ]; then
"$VNCVIEWERCMD" -encodings 'copyrect tight zrle zlib hextile' "$@"
else
"$VNCVIEWERCMD" "$@"
fi
......@@ -126,6 +126,7 @@ help() {
gotalpha=""
use_ssh=""
use_sshssl=""
direct_connect=""
ssh_sleep=15
ssh_cmd="sleep $ssh_sleep"
if [ "X$SSL_VNCVIEWER_SSH_CMD" != "X" ]; then
......@@ -181,6 +182,15 @@ if [ "X$use_ssh" = "X1" -a "X$use_sshssl" = "X" ]; then
fi
fi
if echo "$orig" | grep '^vnc://' > /dev/null; then
orig=`echo "$orig" | sed -e 's,vnc://,,'`
verify=""
mycert=""
use_ssh=""
use_sshssl=""
direct_connect=1
fi
# play around with host:display port:
if echo "$orig" | grep ':' > /dev/null; then
:
......@@ -277,8 +287,8 @@ if [ "X$use_ssh" = "X1" ]; then
proxport=`findfree 3500`
echo
echo "Running 1st ssh proxy:"
echo "$ssh -f -p $ssh_port1 -t -e none -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 \"sleep 30\""
$ssh -f -p $ssh_port1 -t -e none -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 "sleep 30"
echo "$ssh -f -x -p $ssh_port1 -t -e none -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 \"sleep 30\""
$ssh -f -x -p $ssh_port1 -t -e none -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 "sleep 30"
ssh_args="$ssh_args -o NoHostAuthenticationForLocalhost=yes"
sleep 1
stty sane
......@@ -307,18 +317,18 @@ if [ "X$use_ssh" = "X1" ]; then
fi
# the -t option actually speeds up typing response via VNC!!
if [ "X$SSL_VNCVIEWER_SSH_ONLY" != "X" ]; then
echo "$ssh -p $ssh_port -t $C $ssh_args $ssh_host \"$info\""
echo "$ssh -x -p $ssh_port -t $C $ssh_args $ssh_host \"$info\""
echo ""
$ssh -p $ssh_port -t $C $ssh_args $ssh_host "$ssh_cmd"
$ssh -x -p $ssh_port -t $C $ssh_args $ssh_host "$ssh_cmd"
exit $?
elif [ "X$SSL_VNCVIEWER_NO_F" != "X" ]; then
echo "$ssh -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host \"$info\""
echo "$ssh -x -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host \"$info\""
echo ""
$ssh -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host "$ssh_cmd"
$ssh -x -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host "$ssh_cmd"
else
echo "$ssh -f -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host \"$info\""
echo "$ssh -x -f -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host \"$info\""
echo ""
$ssh -f -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host "$ssh_cmd"
$ssh -x -f -p $ssh_port -t $C -L ${use}:${vnc_host}:${port} $ssh_args $ssh_host "$ssh_cmd"
fi
if [ "$?" != "0" ]; then
echo ""
......@@ -337,9 +347,9 @@ if [ "X$use_ssh" = "X1" ]; then
stty sane
if [ "X$use_sshssl" = "X" ]; then
echo "Running viewer:"
echo $VNCVIEWERCMD "$@" localhost:$N
echo "$VNCVIEWERCMD" "$@" localhost:$N
echo ""
$VNCVIEWERCMD "$@" localhost:$N
"$VNCVIEWERCMD" "$@" localhost:$N
exit $?
else
......@@ -408,6 +418,23 @@ print STDERR "proxy_host: $proxy_host\n";
print STDERR "proxy_port: $proxy_port\n";
print STDERR "proxy_connect: $connect\n";
my $listen_handle = "";
if ($ENV{SSL_VNC_LISTEN} != "") {
my $listen_sock = IO::Socket::INET->new(
Listen => 2,
LocalAddr => "localhost",
LocalPort => $ENV{SSL_VNC_LISTEN},
Proto => "tcp");
if (! $listen_sock) {
die "perl proxy: $!\n";
}
my $ip;
($listen_handle, $ip) = $listen_sock->accept();
if (! $listen_handle) {
die "perl proxy: $!\n";
}
}
my $sock = IO::Socket::INET->new(
PeerAddr => $proxy_host,
PeerPort => $proxy_port,
......@@ -462,10 +489,18 @@ if ($second ne "") {
if (fork) {
print STDERR "parent\[$$] STDIN -> socket\n\n";
xfer(STDIN, $sock);
if ($listen_handle) {
xfer($listen_handle, $sock);
} else {
xfer(STDIN, $sock);
}
} else {
print STDERR "child \[$$] socket -> STDOUT\n\n";
xfer($sock, STDOUT);
if ($listen_handle) {
xfer($sock, $listen_handle);
} else {
xfer($sock, STDOUT);
}
}
exit;
......@@ -523,6 +558,35 @@ else
connect="connect = $host:$port"
fi
if [ "X$direct_connect" != "X" ]; then
echo ""
echo "Running viewer for direct connection:"
echo ""
echo "** NOTE: THERE WILL BE NO SSL OR SSH ENCRYPTION **"
echo ""
if type printf > /dev/null 2>&1; then
printf "Are you sure you want to continue? [y]/n "
else
echo -n "Are you sure you want to continue? [y]/n "
fi
read x
if [ "X$x" = "Xn" ]; then
exit 1
fi
echo ""
if [ "X$ptmp" != "X" ]; then
SSL_VNC_LISTEN=$use
export SSL_VNC_LISTEN
$ptmp &
sleep 2
host="localhost"
disp="$N"
fi
echo "$VNCVIEWERCMD" "$@" $host:$disp
echo ""
"$VNCVIEWERCMD" "$@" $host:$disp
exit $?
fi
##debug = 7
tmp=/tmp/ssl_vncviewer${RANDOM}.$$
......@@ -566,9 +630,9 @@ rm -f "$tmp"
echo ""
echo "Running viewer:"
echo $VNCVIEWERCMD "$@" localhost:$N
echo "$VNCVIEWERCMD" "$@" localhost:$N
echo ""
$VNCVIEWERCMD "$@" localhost:$N
"$VNCVIEWERCMD" "$@" localhost:$N
kill $pid
sleep 1
#!/bin/sh
# Notes: to customize locations, e.g. for libjpeg, set LDFLAGS_OS and/or CPPFLAGS_OS
#
# e.g. on Darwin we did:
#
# env LDFLAGS_OS="-L/Volumes/someplace/common/lib/" CPPFLAGS_OS="-I /Volumes/someplace/common/include" ./build.unix
#
# Add useful directories to PATH:
#
PATH=$PATH:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/sfw/bin:/usr/ccs/bin
......@@ -17,7 +25,7 @@ fi
#
name=$UNAME
if [ "X$name" = "X" ]; then
name=`uname -sm | sed -e 's/ /./'`
name=`uname -sm | sed -e 's/ /./g'`
fi
if [ "X$name" = "X" ]; then
echo "cannot determine platform: os.arch, e.g. Linux.i686"
......@@ -25,6 +33,11 @@ if [ "X$name" = "X" ]; then
exit 1
fi
LDD="ldd"
if [ `uname` = "Darwin" ]; then
LDD="otool -L"
fi
# Work out main destination:
#
dest=./bin/$name
......@@ -167,13 +180,17 @@ sync
wc $src
sum $src
sleep 2
echo cp -p $src $dest/vncviewer
cp -p $src $dest/vncviewer || exit 1
suff=""
if [ `uname` = "Darwin" ]; then
suff=".x11"
fi
echo cp -p $src $dest/vncviewer$suff
sleep 1
cp -p $src $dest/vncviewer || exit 1
ls -l $src $dest/vncviewer
$dest/vncviewer -h
ldd $dest/vncviewer
cp -p $src $dest/vncviewer$suff || exit 1
ls -l $src $dest/vncviewer$suff
$dest/vncviewer$suff -h
$LDD $dest/vncviewer$suff
echo ""
# Do stunnel:
......@@ -237,8 +254,8 @@ sleep 1
cp -p $src $dest/stunnel || exit 1
ls -l $src $dest/stunnel
$dest/stunnel -help
ldd $dest/stunnel
$LDD $dest/stunnel
echo ""
$dest/vncviewer -h
ldd $dest/vncviewer
$dest/vncviewer$suff -h
$LDD $dest/vncviewer$suff
#!/bin/sh
rm -rf ./src/tmp/* || exit 1
vers=1.0.5
vers=1.0.7
cd .. || exit 1
......@@ -24,6 +24,8 @@ rm -rf enhanced_tightvnc_viewer_windows_only-${vers}*
cp -pR enhanced_tightvnc_viewer enhanced_tightvnc_viewer_windows_only-$vers
rm -rf enhanced_tightvnc_viewer_windows_only-$vers/{src,bin,man}/*
rm -rf enhanced_tightvnc_viewer_windows_only-$vers/bin/.linkin
rm -rf enhanced_tightvnc_viewer_windows_only-$vers/MacOSX
rm -rf enhanced_tightvnc_viewer_windows_only-$vers/Unix
cp -p enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tcl enhanced_tightvnc_viewer_windows_only-$vers/Windows/util
rm -f enhanced_tightvnc_viewer_windows_only-$vers.zip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment