Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
a8453eea
Commit
a8453eea
authored
Nov 18, 2009
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ssvnc/enhanced_tightvnc_viewer update.
parent
09f63f03
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
4226 additions
and
1250 deletions
+4226
-1250
README
x11vnc/misc/enhanced_tightvnc_viewer/README
+30
-19
connect_br.tcl
...misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl
+720
-115
ssvnc
x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
+42
-4
ssvnc_cmd
x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd
+6
-5
ss_vncviewer
x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer
+779
-132
ssvnc.tcl
x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl
+1821
-471
ssvncviewer.1
x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1
+14
-8
_bundle
x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
+1
-1
tight-vncviewer-full.patch
...ed_tightvnc_viewer/src/patches/tight-vncviewer-full.patch
+813
-495
No files found.
x11vnc/misc/enhanced_tightvnc_viewer/README
View file @
a8453eea
...
...
@@ -64,19 +64,29 @@ The enhanced TightVNC viewer features are:
- Ability to Save and Load VNC profiles for different hosts.
- You can also use your own VNC Viewer, e.g. UltraVNC or RealVNC,
with the front-end GUI or scripts if you like.
- Create or Import SSL Certificates and Private Keys.
- Reverse (viewer listening) VNC connections via SSL and SSH.
- VeNCrypt SSL/TLS VNC encryption support (used by VeNCrypt,
QEMU, ggi, libvirt/virt-manager/xen, vinagre/gvncviewer/gtk-vnc)
- ANONTLS SSL/TLS VNC encryption support (used by Vino)
- VeNCrypt and ANONTLS are also enabled for any 3rd party VNC
Viewer (e.g. RealVNC, TightVNC, UltraVNC ...) on Unix, MacOSX,
and Windows via the provided SSVNC VeNCrypt Viewer Bridge tool
(use 'Change VNC Viewer' to select the one you want.)
- Support for Web Proxies, SOCKS Proxies, and the UltraVNC
repeater proxy (e.g. repeater://host:port+ID:1234). Multiple
proxies may be chained together (3 max).
- Support for SSH Gateway connections and non-standard SSH ports.
- You can also use your own VNC Viewer, e.g. UltraVNC or RealVNC,
with the front-end GUI or scripts if you like.
- Automatic Service tunnelling via SSH for CUPS and SMB Printing,
ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting.
...
...
@@ -131,11 +141,6 @@ The enhanced TightVNC viewer features are:
- Option "-unixpw ..." for use with "x11vnc -unixpw" login dialogs.
- VeNCrypt SSL/TLS VNC encryption support (used by VeNCrypt,
QEMU, ggi, libvirt/virt-manager/xen, vinagre/gvncviewer/gtk-vnc)
- ANONTLS SSL/TLS VNC encryption support (used by vino)
- Support for UltraVNC extensions: Single Window, Disable
Server-side Input, 1/n Server side scaling, Text Chat (shell
terminal UI). Both UltraVNC and x11vnc servers support these
...
...
@@ -152,12 +157,13 @@ The enhanced TightVNC viewer features are:
SC I, and SSL encrypted: SC III)
- Support for UltraVNC DSM Encryption Plugin mode. (ARC4 and
AESV2,
and MSRC4
)
AESV2,
MSRC4, and SecureVNC
)
- Support for UltraVNC MS-Logon authentication (NOTE: the UltraVNC
MS-Logon key exchange implementation is very weak; an eavesdropper
on the network can recover your Windows password easily; you
need to use an additional encrypted tunnel with MS-Logon.)
- Support for UltraVNC MS-Logon authentication (NOTE: the
UltraVNC MS-Logon key exchange implementation is very weak; an
eavesdropper on the network can recover your Windows password
easily in a few seconds; you need to use an additional encrypted
tunnel with MS-Logon.)
- Support for symmetric encryption (including blowfish and 3des
ciphers) to Non-UltraVNC Servers. Any server using the same
...
...
@@ -173,6 +179,11 @@ The enhanced TightVNC viewer features are:
long periods of time a listening port on the the local (VNC
viewer) side that redirects to the remote side.
- Reverse (viewer listening) VNC connections can show a
Popup dialog asking whether to accept the connection or not
(-acceptpopup.) The extra info provided by UltraVNC Single Click
reverse connections is also supported (-acceptpopupsc)
- Extremely low color modes: 64 and 8 colors in 8bpp
(-use64/-bgr222, -use8/-bgr111)
...
...
@@ -244,7 +255,7 @@ Unix and Mac OS X:
Unpack the archive:
% gzip -dc ssvnc-1.0.2
4
.tar.gz | tar xvf -
% gzip -dc ssvnc-1.0.2
5
.tar.gz | tar xvf -
Run the GUI:
...
...
@@ -252,7 +263,7 @@ Unix and Mac OS X:
% ./ssvnc/MacOSX/ssvnc (for Mac OS X)
The smaller file "ssvnc_no_windows-1.0.2
4
.tar.gz"
The smaller file "ssvnc_no_windows-1.0.2
5
.tar.gz"
could have been used as well.
On MacOSX you could also click on the SSVNC app icon in the Finder.
...
...
@@ -298,8 +309,8 @@ Unix/MacOSX Install:
For the conventional source tarball it will compile and install, e.g.:
gzip -dc ssvnc-1.0.2
4
.src.tar.gz | tar xvf -
cd ssvnc-1.0.2
4
gzip -dc ssvnc-1.0.2
5
.src.tar.gz | tar xvf -
cd ssvnc-1.0.2
5
make config
make all
make PREFIX=/my/install/dir install
...
...
@@ -311,7 +322,7 @@ Windows:
Unzip, using WinZip or a similar utility, the zip file:
ssvnc-1.0.2
4
.zip
ssvnc-1.0.2
5
.zip
Run the GUI, e.g.:
...
...
@@ -323,7 +334,7 @@ Windows:
select Open, and then OK to launch it.
The smaller file "ssvnc_windows_only-1.0.2
4
.zip"
The smaller file "ssvnc_windows_only-1.0.2
5
.zip"
could have been used as well.
You can make a Windows shortcut to this program if you want to.
...
...
x11vnc/misc/enhanced_tightvnc_viewer/Windows/util/connect_br.tcl
View file @
a8453eea
...
...
@@ -16,10 +16,12 @@ proc getout {} {
catch
{
flush
$client
_fh
}
after
$delay
catch
{
close
$client
_fh
}
set client_fh
""
after
$delay
catch
{
flush
$server
_fh
}
after
$delay
catch
{
close
$server
_fh
}
set server_fh
""
after
$delay
global bmesg_cnt
...
...
@@ -37,54 +39,78 @@ proc check_closed {} {
if
{
!
$got
_connection
}
{
return
}
if
{
$client
_fh !=
""
&&
[
eof
$client
_fh
]}
{
if
{
$client
_fh !=
""
}
{
set ef
""
catch
{
set
ef
[
eof
$client
_fh
]}
if
{
$ef
== 1
}
{
if
{
$debug
}
{
puts stderr
"client_fh EOF"
}
getout
}
if
{
$server
_fh !=
""
&&
[
eof
$server
_fh
]}
{
}
if
{
$server
_fh !=
""
}
{
set ef
""
catch
{
set
ef
[
eof
$server
_fh
]}
if
{
$ef
== 1
}
{
if
{
$debug
}
{
puts stderr
"server_fh EOF"
}
getout
}
}
}
proc
xfer_in_to_out
{}
{
global client_fh server_fh debug
global client_fh server_fh debug
do_bridge
if
{
$client
_fh !=
""
&& !
[
eof
$client
_fh
]}
{
set ef
""
catch
{
set
ef
[
eof
$client
_fh
]}
if
{
$ef
== 0
}
{
set str
""
catch
{
set
str
[
read
$client
_fh 4096
]}
if
{
$debug
}
{
puts stderr
"xfer_in_to_out:
$str
"
#puts stderr
"xfer_in_to_out:
$str
"
puts stderr
"xfer_in_to_out:
[
string
length
$str
]
"
}
if
{
$server
_fh !=
""
&&
$str
!=
""
}
{
puts -nonewline
$server
_fh
$str
flush
$server
_fh
catch
{
puts
-nonewline
$server
_fh
$str
}
catch
{
flush
$server
_fh
}
}
}
}
check_closed
}
proc
xfer_out_to_in
{}
{
global client_fh server_fh debug
if
{
$server
_fh !=
""
&& !
[
eof
$server
_fh
]}
{
global client_fh server_fh debug do_bridge
if
{
$server
_fh !=
""
}
{
set ef
""
catch
{
set
ef
[
eof
$server
_fh
]}
if
{
$ef
== 0
}
{
set str
""
catch
{
set
str
[
read
$server
_fh 4096
]}
if
{
$debug
}
{
puts stderr
"xfer_out_to_in:
$str
"
#puts stderr
"xfer_out_to_in:
$str
"
puts stderr
"xfer_out_to_in:
[
string
length
$str
]
"
}
if
{
$client
_fh !=
""
&&
$str
!=
""
}
{
puts -nonewline
$client
_fh
$str
flush
$client
_fh
catch
{
puts
-nonewline
$client
_fh
$str
}
catch
{
flush
$client
_fh
}
}
}
}
check_closed
}
proc
bmesg
{
msg
}
{
global env
if
{
!
[
info
exists env
(
BMESG
)]}
{
return
}
if
{
$env
(
BMESG
)
== 0
}
{
return
}
global bmesg_cnt
if
{
!
[
info
exists bmesg_cnt
]}
{
...
...
@@ -380,6 +406,560 @@ proc do_connect_repeater {sock hostport which repeater} {
}
}
proc
vread
{
n sock
}
{
set str
""
set max 3000
set dt 10
set i 0
set cnt 0
while
{
$cnt
<
$max
&&
$i
<
$n
}
{
incr cnt
set c
[
read
$sock
1
]
if
{
$c
==
""
}
{
check_closed
after
$dt
continue
}
incr i
append str
$c
}
if
{
$i
!=
$n
}
{
puts stderr
"vread failure
$n
$i
"
destroy .
;
exit 1
}
return
$str
}
proc
append_handshake
{
str
}
{
global env
if
[
info
exists env
(
SSVNC_PREDIGESTED_HANDSHAKE
)]
{
set file
$env
(
SSVNC_PREDIGESTED_HANDSHAKE
)
set fh
""
catch
{
set
fh
[
open
$file
a
]}
if
{
$fh
!=
""
}
{
puts
$fh
$str
catch
{
close
$fh
}
}
}
}
proc
vencrypt_bridge_connection
{
fh host port
}
{
puts stderr
"vencrypt_bridge_connection: got connection
$fh
$host
$port
"
bmesg
"vencrypt_bridge_connection: got connection
$fh
$host
$port
"
global viewer_sock
set viewer_sock
$fh
}
proc
center_win
{
w
}
{
update
set W
[
winfo screenwidth
$w
]
set W
[
expr
$W + 1
]
wm geometry
$w
+$W+0
update
set x
[
expr
[
winfo screenwidth
$w
]
/2 -
[
winfo width
$w
]
/2
]
set y
[
expr
[
winfo screenheight
$w
]
/2 -
[
winfo height
$w
]
/2
]
wm geometry
$w
+$x+$y
wm deiconify
$w
update
}
proc
get_user_pass
{}
{
global env
set up
""
if
[
info
exists env
(
SSVNC_UNIXPW
)]
{
set rm 0
set up
$env
(
SSVNC_UNIXPW
)
if
[
regexp
{
^rm:
}
$up
]
{
set rm 1
regsub
{
^rm:
}
$up
""
up
}
if
[
file
exists
$up
]
{
set fh
""
set f
$up
catch
{
set
fh
[
open
$up
r
]}
if
{
$fh
!=
""
}
{
gets
$fh
u
gets
$fh
p
catch
{
close
$fh
}
set up
"
$u
@
$p
"
}
if
{
$rm
}
{
catch
{
file
delete
$f
}
}
}
}
else
if
[
info
exists env
(
SSVNC_VENCRYPT_USERPASS
)]
{
set up
$env
(
SSVNC_VENCRYPT_USERPASS
)
}
if
{
$up
!=
""
}
{
return
$up
}
toplevel .t
wm title .t
{
VeNCrypt Viewer Bridge User/Pass
}
global user pass
set user
""
set pass
""
label .t.l -text
{
SSVNC VeNCrypt Viewer Bridge
}
frame .t.f0
frame .t.f0.fL
label .t.f0.fL.la -text
{
Username:
}
label .t.f0.fL.lb -text
{
Password:
}
pack .t.f0.fL.la .t.f0.fL.lb -side top
frame .t.f0.fR
entry .t.f0.fR.ea -width 24 -textvariable user
entry .t.f0.fR.eb -width 24 -textvariable pass -show *
pack .t.f0.fR.ea .t.f0.fR.eb -side top -fill x
pack .t.f0.fL -side left
pack .t.f0.fR -side right -expand 1 -fill x
button .t.no -text Cancel -command
{
set
user
""
;
set pass
""
;
destroy .t
}
button .t.ok -text Done -command
{
destroy .t
}
center_win .t
pack .t.l .t.f0 .t.no .t.ok -side top -fill x
update
wm deiconify .t
bind .t.f0.fR.ea <Return>
{
focus .t.f0.fR.eb
}
bind .t.f0.fR.eb <Return>
{
destroy .t
}
focus .t.f0.fR.ea
wm resizable .t 1 0
wm minsize .t
[
winfo reqwidth .t
]
[
winfo reqheight .t
]
tkwait window .t
if
{
$user
==
""
||
$pass
==
""
}
{
return
""
}
else
{
return
"
$user
@
$pass
"
}
}
proc
do_vencrypt_viewer_bridge
{
listen connect
}
{
global env
#set env
(
BMESG
)
1
vencrypt_constants
set backwards 0
if
{
!
[
info
exists env
(
SSVNC_PREDIGESTED_HANDSHAKE
)]}
{
puts stderr
"no SSVNC_PREDIGESTED_HANDSHAKE filename in environment."
destroy .
;
exit 1
}
set handshake
$env
(
SSVNC_PREDIGESTED_HANDSHAKE
)
bmesg
$handshake
if
{
$listen
< 0
}
{
set backwards 1
set listen
[
expr
-$listen
]
}
# listen on
$listen
global viewer_sock
set viewer_sock
""
set lsock
""
set rc
[
catch
{
set
lsock
[
socket
-myaddr 127.0.0.1 -server vencrypt_bridge_connection
$listen
]}]
if
{
$rc
!= 0
}
{
puts stderr
"error listening on 127.0.0.1:
$listen
"
destroy .
;
exit 1
}
bmesg
"listen on
$listen
OK"
# accept
vwait viewer_sock
catch
{
close
$lsock
}
fconfigure
$viewer
_sock -translation binary -blocking 0
global got_connection
set got_connection 1
# connect to
$connect
set server_sock
""
set rc
[
catch
{
set
server_sock
[
socket
127.0.0.1
$connect
]}]
if
{
$rc
!= 0
}
{
puts stderr
"error connecting to 127.0.0.1:
$connect
"
destroy .
;
exit 1
}
bmesg
"made connection to
$connect
"
fconfigure
$server
_sock -translation binary -blocking 0
if
{
$backwards
}
{
puts stderr
"reversing roles of viewer and server"
set t
$viewer
_sock
set viewer_sock
$server
_sock
set server_sock
$t
}
# wait for SSVNC_PREDIGESTED_HANDSHAKE
"done"
, put in hash.
set dt 200
set slept 0
set maxwait 20000
set hs
(
mode
)
init
while
{
$slept
<
$maxwait
}
{
after
$dt
set slept
[
expr
$slept
+
$dt
]
set done 0
set fh
""
catch
{
set
fh
[
open
$handshake
r
]}
set str
""
if
{
$fh
!=
""
}
{
array unset hs
while
{[
gets
$fh
line
]
> -1
}
{
set line
[
string
trim
$line
]
set str
"
$str$line
\n
"
;
if
{
$line
==
"done"
}
{
set done 1
}
else
if
[
regexp
{
=
}
$line
]
{
set s
[
split
$line
"="
]
set key
[
lindex
$s
0
]
set val
[
lindex
$s
1
]
set hs
(
$key
)
$val
}
}
catch
{
close
$fh
}
}
if
{
$done
}
{
puts stderr
$str
bmesg
"
$str
"
break
}
}
catch
[
file
delete
$handshake
]
if
{
!
[
info
exists hs
(
sectype
)]}
{
puts stderr
"no hs(sectype) found"
destroy .
;
exit 1
}
# read viewer RFB
if
{
!
[
info
exists hs
(
server
)]}
{
set hs
(
server
)
"RFB 003.008"
}
puts -nonewline
$viewer
_sock
"
$hs
(server)
\n
"
flush
$viewer
_sock
puts stderr
"sent
$hs
(server) to viewer sock."
set viewer_rfb
[
vread 12
$viewer
_sock
]
puts stderr
"read viewer_rfb
$viewer
_rfb"
set viewer_major 3
set viewer_minor 8
if
[
regexp
{
^RFB 003
\.
0*
([
0-9
][
0-9
]
*
)}
$viewer
_rfb m v
]
{
set viewer_minor
$v
}
if
{
$hs
(
sectype
)
==
$rfb
SecTypeAnonTls
}
{
puts stderr
"handling rfbSecTypeAnonTls"
if
{
$viewer
_major > 3 ||
$viewer
_minor >= 7
}
{
puts stderr
"viewer >= 3.7, nothing to set up."
}
else
{
puts stderr
"viewer <= 3.3, faking things up."
set t
[
vread 1
$server
_sock
]
binary scan
$t
c nsectypes
puts stderr
"nsectypes=
$nsectypes
"
for
{
set
i 0
}
{
$i
<
$nsectypes
}
{
incr
i
}
{
set t
[
vread 1
$server
_sock
]
binary scan
$t
c st
puts stderr
"
$i:
$st
"
set types
(
$st
)
$i
}
set use 1
if
[
info
exists types
(
1
)]
{
set use 1
}
else
if
[
info
exists types
(
2
)]
{
set use 2
}
else
{
puts stderr
"no valid sectypes"
destroy .
;
exit 1
}
# this should be MSB:
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock
$use
vsend_uchar
$server
_sock
$use
if
{
$use
== 1
}
{
set t
[
vread 4
$server
_sock
]
}
}
}
else
if
{
$hs
(
sectype
)
==
$rfb
SecTypeVencrypt
}
{
puts stderr
"handling rfbSecTypeVencrypt"
if
{
!
[
info
exists hs
(
subtype
)]}
{
puts stderr
"no subtype"
destroy .
;
exit 1
}
set fake_type
"None"
set plain 0
set sub_type
$hs
(
subtype
)
if
{
$sub
_type ==
$rfb
VencryptTlsNone
}
{
set fake_type
"None"
}
else
if
{
$sub
_type ==
$rfb
VencryptTlsVnc
}
{
set fake_type
"VncAuth"
}
else
if
{
$sub
_type ==
$rfb
VencryptTlsPlain
}
{
set fake_type
"None"
set plain 1
}
else
if
{
$sub
_type ==
$rfb
VencryptX509None
}
{
set fake_type
"None"
}
else
if
{
$sub
_type ==
$rfb
VencryptX509Vnc
}
{
set fake_type
"VncAuth"
}
else
if
{
$sub
_type ==
$rfb
VencryptX509Plain
}
{
set fake_type
"None"
set plain 1
}
if
{
$plain
}
{
set up
[
get_user_pass
]
if
[
regexp
{
@
}
$up
]
{
set user
$up
set pass
$up
regsub
{
@.*$
}
$user
""
user
regsub
{
^
[
^@
]
*@
}
$pass
""
pass
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock
[
string
length
$user
]
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock 0
vsend_uchar
$server
_sock
[
string
length
$pass
]
puts stderr
"sending VencryptPlain user and pass."
puts -nonewline
$server
_sock
$user
puts -nonewline
$server
_sock
$pass
flush
$server
_sock
}
}
set ft 0
if
{
$fake
_type ==
"None"
}
{
set ft 1
}
else
if
{
$fake
_type ==
"VncAuth"
}
{
set ft 2
}
else
{
puts stderr
"no valid fake_type"
destroy .
;
exit 1
}
if
{
$viewer
_major > 3 ||
$viewer
_minor >= 7
}
{
vsend_uchar
$viewer
_sock 1
vsend_uchar
$viewer
_sock
$ft
set t
[
vread 1
$viewer
_sock
]
binary scan
$t
c cr
if
{
$cr
!=
$ft
}
{
puts stderr
"client selected wront type
$cr
$ft
"
destroy .
;
exit 1
}
}
else
{
puts stderr
"viewer <= 3.3, faking things up."
# this should be MSB:
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock 0
vsend_uchar
$viewer
_sock
$ft
if
{
$ft
== 1
}
{
set t
[
vread 4
$server
_sock
]
}
}
}
global client_fh server_fh
set client_fh
$viewer
_sock
set server_fh
$server
_sock
fileevent
$client
_fh readable xfer_in_to_out
fileevent
$server
_fh readable xfer_out_to_in
}
proc
vsend_uchar
{
sock n
}
{
set s
[
binary
format c
$n
]
puts -nonewline
$sock
$s
flush
$sock
}
proc
vencrypt_constants
{}
{
uplevel
{
set rfbSecTypeAnonTls 18
set rfbSecTypeVencrypt 19
set rfbVencryptPlain 256
set rfbVencryptTlsNone 257
set rfbVencryptTlsVnc 258
set rfbVencryptTlsPlain 259
set rfbVencryptX509None 260
set rfbVencryptX509Vnc 261
set rfbVencryptX509Plain 262
}
}
proc
do_vencrypt
{
sock which
}
{
vencrypt_constants
set t
[
vread 1
$sock
]
binary scan
$t
c vs_major
set t
[
vread 1
$sock
]
binary scan
$t
c vs_minor
if
{
$vs
_minor ==
""
||
$vs
_major ==
""
||
$vs
_major != 0 ||
$vs
_minor < 2
}
{
puts stderr
"vencrypt failure bad vs version major=
$major
minor=
$minor
"
destroy .
;
exit 1
}
puts stderr
"server vencrypt version
$vs
_major.
$vs
_minor"
bmesg
"server vencrypt version
$vs
_major.
$vs
_minor"
append_handshake
"subversion=0.2"
vsend_uchar
$sock
0
vsend_uchar
$sock
2
set t
[
vread 1
$sock
]
binary scan
$t
c result
if
{
$result
!= 0
}
{
puts stderr
"vencrypt failed result:
$result
"
bmesg
"vencrypt failed result:
$result
"
destroy .
;
exit 1
}
set t
[
vread 1
$sock
]
binary scan
$t
c nsubtypes
puts stderr
"nsubtypes:
$nsubtypes
"
bmesg
"nsubtypes:
$nsubtypes
"
for
{
set
i 0
}
{
$i
<
$nsubtypes
}
{
incr
i
}
{
set t
[
vread 4
$sock
]
binary scan
$t
I stype
puts stderr
"subtypes:
$i:
$stype
"
append_handshake
"sst
$i
=
$stype
"
set subtypes
(
$stype
)
$i
}
set subtype 0
if
[
info
exists subtypes
(
$rfb
VencryptX509None
)]
{
set subtype
$rfb
VencryptX509None
puts stderr
"selected rfbVencryptX509None"
}
else
if
[
info
exists subtypes
(
$rfb
VencryptX509Vnc
)]
{
set subtype
$rfb
VencryptX509Vnc
puts stderr
"selected rfbVencryptX509Vnc"
}
else
if
[
info
exists subtypes
(
$rfb
VencryptX509Plain
)]
{
set subtype
$rfb
VencryptX509Plain
puts stderr
"selected rfbVencryptX509Plain"
}
else
if
[
info
exists subtypes
(
$rfb
VencryptTlsNone
)]
{
set subtype
$rfb
VencryptTlsNone
puts stderr
"selected rfbVencryptTlsNone"
}
else
if
[
info
exists subtypes
(
$rfb
VencryptTlsVnc
)]
{
set subtype
$rfb
VencryptTlsVnc
puts stderr
"selected rfbVencryptTlsVnc"
}
else
if
[
info
exists subtypes
(
$rfb
VencryptTlsPlain
)]
{
set subtype
$rfb
VencryptTlsPlain
puts stderr
"selected rfbVencryptTlsPlain"
}
append_handshake
"subtype=
$subtype
"
set st
[
binary
format I
$subtype
]
puts -nonewline
$sock
$st
flush
$sock
if
{
$subtype
== 0
}
{
puts stderr
"vencrypt could not find an acceptable subtype:
$subtype
"
destroy .
;
exit 1
}
set t
[
vread 1
$sock
]
binary scan
$t
c result
puts stderr
"result=
$result
"
append_handshake
"done"
if
{
$result
== 0
}
{
puts stderr
"vencrypt failure result:
$result
"
destroy .
;
exit 1
}
}
proc
do_connect_vencrypt
{
sock hostport which
}
{
global debug cur_proxy
vencrypt_constants
puts stderr
"pxy=
$which
vencrypt
$hostport
via
$cur
_proxy"
bmesg
"V:
$which
vencrypt
$hostport
via
$cur
_proxy"
append_handshake
"mode=connect"
set srfb
[
vread 12
$sock
]
puts stderr
"srfb:
$srfb
"
bmesg
"srfb:
$srfb
"
set srfb
[
string
trim
$srfb
]
append_handshake
"server=
$srfb
"
set minor
""
if
[
regexp
{
^RFB 00
[
456
]
\.
}
$srfb
]
{
set minor 8
}
else
if
[
regexp
{
^RFB 003
\.
0*
([
0-9
][
0-9
]
*
)}
$srfb
mvar minor
]
{
;
}
if
{
$minor
==
""
||
$minor
< 7
}
{
puts stderr
"vencrypt failure bad minor=
$minor
"
destroy .
;
exit 1
}
set vrfb
"RFB 003.008
\n
"
if
{
$minor
== 7
}
{
set vrfb
"RFB 003.007
\n
"
}
puts -nonewline
$sock
$vrfb
flush
$sock
set vrfb
[
string
trim
$vrfb
]
append_handshake
"viewer=
$vrfb
"
append_handshake
"latency=0.10"
set str
[
vread 1
$sock
]
binary scan
$str
c nsec
puts stderr
"nsec:
$nsec
"
bmesg
"nsec:
$nsec
"
for
{
set
i 0
}
{
$i
<
$nsec
}
{
incr
i
}
{
set str
[
vread 1
$sock
]
binary scan
$str
c sec
puts stderr
"sec:
$sec
"
bmesg
"sec:
$sec
"
set sectypes
(
$i
)
$sec
}
for
{
set
i 0
}
{
$i
<
$nsec
}
{
incr
i
}
{
if
{
$sectypes
(
$i
)
==
$rfb
SecTypeVencrypt
}
{
append_handshake
"sectype=
$rfb
SecTypeVencrypt"
vsend_uchar
$sock
$rfb
SecTypeVencrypt
after 500
bmesg
"do_vencrypt
$sock
$which
"
do_vencrypt
$sock
$which
return
}
}
for
{
set
i 0
}
{
$i
<
$nsec
}
{
incr
i
}
{
if
{
$sectypes
(
$i
)
==
$rfb
SecTypeAnonTls
}
{
append_handshake
"sectype=
$rfb
SecTypeAnonTls"
vsend_uchar
$sock
$rfb
SecTypeAnonTls
bmesg
"rfbSecTypeAnonTls"
after 500
append_handshake
"done"
return
}
}
}
proc
do_connect
{
sock type hostport which
}
{
if
{
$type
==
"http"
}
{
do_connect_http
$sock
$hostport
$which
...
...
@@ -390,6 +970,8 @@ proc do_connect {sock type hostport which} {
}
else
if
[
regexp
-nocase
{
^repeater:
}
$type
]
{
regsub -nocase
{
^repeater:
}
$type
""
repeater
do_connect_repeater
$sock
$hostport
$which
$repeater
}
else
if
{
$type
==
"vencrypt"
}
{
do_connect_vencrypt
$sock
$hostport
$which
}
}
...
...
@@ -431,9 +1013,6 @@ proc handle_connection {fh host port} {
fconfigure
$fh
-translation binary -blocking 0
fconfigure
$sock
-translation binary -blocking 0
fileevent
$fh
readable xfer_in_to_out
fileevent
$sock
readable xfer_out_to_in
set cur_proxy
$proxy1
if
{
$proxy2
!=
""
}
{
do_connect
$sock
$proxy1
_type
"
$proxy2
_host:
$proxy2
_port"
1
...
...
@@ -451,6 +1030,9 @@ proc handle_connection {fh host port} {
}
else
{
do_connect
$sock
$proxy1
_type
$dest
1
}
fileevent
$fh
readable xfer_in_to_out
fileevent
$sock
readable xfer_out_to_in
}
proc
proxy_type
{
proxy
}
{
...
...
@@ -468,6 +1050,8 @@ proc proxy_type {proxy} {
return
"http"
}
else
if
[
regexp
-nocase
{
^repeater://.*
\+
(
.*
)
$
}
$proxy
mat idstr
]
{
return
"repeater:
$idstr
"
}
else
if
[
regexp
-nocase
{
^vencrypt://
}
$proxy
]
{
return
"vencrypt"
}
else
{
return
"http"
}
...
...
@@ -482,16 +1066,43 @@ proc proxy_hostport {proxy} {
return
$hp
}
proc
setb
{}
{
wm withdraw .
button .b -text
"CONNECT_BR"
-command
{
destroy .
}
pack .b
after 1000 check_callback
}
global
env
set
got_connection 0
set
proxy1
""
set
proxy2
""
set
proxy3
""
set
client_fh
""
set
server_fh
""
set
do_bridge 0
set
debug 0
if
{
$debug
}
{
if
[
info
exists env
(
CONNECT_BR_DEBUG
)]
{
set debug 1
}
if
[
info
exists env
(
SSVNC_VENCRYPT_VIEWER_BRIDGE
)]
{
set s
[
split
$env
(
SSVNC_VENCRYPT_VIEWER_BRIDGE
)
","
]
set listen
[
lindex
$s
0
]
set connect
[
lindex
$s
1
]
setb
do_vencrypt_viewer_bridge
$listen
$connect
set do_bridge 1
}
if
{
$do
_bridge
}
{
;
}
else
{
if
{
$debug
&& 0
}
{
if
{
!
[
info
exists env
(
SSVNC_DEST
)]}
{
set env
(
SSVNC_DEST
)
"haystack:2037"
}
...
...
@@ -501,7 +1112,7 @@ if {$debug} {
if
{
!
[
info
exists env
(
SSVNC_LISTEN
)]}
{
set env
(
SSVNC_LISTEN
)
"6789"
}
}
else
{
}
else
{
if
{
!
[
info
exists env
(
SSVNC_DEST
)]}
{
destroy .
;
exit
;
}
...
...
@@ -511,64 +1122,57 @@ if {$debug} {
if
{
!
[
info
exists env
(
SSVNC_LISTEN
)]
&& !
[
info
exists env
(
SSVNC_REVERSE
)]}
{
destroy .
;
exit
;
}
}
}
#set env
(
BMESG
)
1
set
dest
$env
(
SSVNC_DEST
)
set dest
$env
(
SSVNC_DEST
)
if
[
regexp
{
,
}
$env
(
SSVNC_PROXY
)]
{
if
[
regexp
{
,
}
$env
(
SSVNC_PROXY
)]
{
set s
[
split
$env
(
SSVNC_PROXY
)
","
]
set proxy1
[
lindex
$s
0
]
set proxy2
[
lindex
$s
1
]
set proxy3
[
lindex
$s
2
]
}
else
{
}
else
{
set proxy1
$env
(
SSVNC_PROXY
)
}
}
set
proxy1_type
[
proxy_type
$proxy1
]
set
proxy1_hp
[
proxy_hostport
$proxy1
]
set proxy1_type
[
proxy_type
$proxy1
]
set proxy1_hp
[
proxy_hostport
$proxy1
]
set
s
[
split
$proxy1
_hp
":"
]
set
proxy1_host
[
lindex
$s
0
]
set
proxy1_port
[
lindex
$s
1
]
set s
[
split
$proxy1
_hp
":"
]
set proxy1_host
[
lindex
$s
0
]
set proxy1_port
[
lindex
$s
1
]
set
proxy2_type
""
set
proxy2_host
""
set
proxy2_port
""
set proxy2_type
""
set proxy2_host
""
set proxy2_port
""
if
{
$proxy2
!=
""
}
{
if
{
$proxy2
!=
""
}
{
set proxy2_type
[
proxy_type
$proxy2
]
set proxy2_hp
[
proxy_hostport
$proxy2
]
set s
[
split
$proxy2
_hp
":"
]
set proxy2_host
[
lindex
$s
0
]
set proxy2_port
[
lindex
$s
1
]
}
}
set
proxy3_type
""
set
proxy3_host
""
set
proxy3_port
""
set proxy3_type
""
set proxy3_host
""
set proxy3_port
""
if
{
$proxy3
!=
""
}
{
if
{
$proxy3
!=
""
}
{
set proxy3_type
[
proxy_type
$proxy3
]
set proxy3_hp
[
proxy_hostport
$proxy3
]
set s
[
split
$proxy3
_hp
":"
]
set proxy3_host
[
lindex
$s
0
]
set proxy3_port
[
lindex
$s
1
]
}
bmesg
"1: '
$proxy1
_host' '
$proxy1
_port' '
$proxy1
_type'"
;
bmesg
"2: '
$proxy2
_host' '
$proxy2
_port' '
$proxy2
_type'"
;
bmesg
"3: '
$proxy3
_host' '
$proxy3
_port' '
$proxy3
_type'"
;
set
got_connection 0
}
proc
setb
{}
{
wm withdraw .
button .b -text
"CONNECT_BR"
-command
{
destroy .
}
pack .b
after 1000 check_callback
}
bmesg
"1: '
$proxy1
_host' '
$proxy1
_port' '
$proxy1
_type'"
;
bmesg
"2: '
$proxy2
_host' '
$proxy2
_port' '
$proxy2
_type'"
;
bmesg
"3: '
$proxy3
_host' '
$proxy3
_port' '
$proxy3
_type'"
;
if
[
info
exists env
(
SSVNC_REVERSE
)]
{
if
[
info
exists env
(
SSVNC_REVERSE
)]
{
set s
[
split
$env
(
SSVNC_REVERSE
)
":"
]
set rhost
[
lindex
$s
0
]
set rport
[
lindex
$s
1
]
...
...
@@ -580,7 +1184,7 @@ if [info exists env(SSVNC_REVERSE)] {
puts stderr
"SSVNC_REVERSE to
$rhost
$rport
OK"
;
setb
handle_connection
$lsock
$rhost
$rport
}
else
{
}
else
{
set lport
$env
(
SSVNC_LISTEN
)
set rc
[
catch
{
set
lsock
[
socket
-myaddr 127.0.0.1 -server handle_connection
$lport
]}]
if
{
$rc
!= 0
}
{
...
...
@@ -589,4 +1193,5 @@ if [info exists env(SSVNC_REVERSE)] {
}
puts stderr
"SSVNC_LISTEN on
$lport
OK"
;
setb
}
}
x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
View file @
a8453eea
...
...
@@ -97,6 +97,42 @@ OPTIONS
END
exit
0
fi
if
[
"X
$1
"
=
"X-ssh"
]
;
then
if
[
"X
$2
"
=
"X-help"
-o
"X
$2
"
=
"X-h"
]
;
then
cat
<<
END
sshvnc - a GUI wrapper for SSH VNC connections.
SYNOPSIS
sshvnc
sshvnc [host][:display]
sshvnc [saved-profile-name]
sshvnc [options] [host-or-profile]
sshvnc --help
See 'ssvnc
$2
' and 'ssvnc --help' for more information.
END
exit
0
fi
fi
if
[
"X
$1
"
=
"X-ts"
-o
"X
$1
"
=
"X-tso"
]
;
then
if
[
"X
$2
"
=
"X-help"
-o
"X
$2
"
=
"X-h"
]
;
then
cat
<<
END
tsvnc - a GUI wrapper for SSH VNC connections using x11vnc Terminal Services.
SYNOPSIS
tsvnc
tsvnc [host][:display]
tsvnc [saved-profile-name]
tsvnc [options] [host-or-profile]
tsvnc --help
See 'ssvnc
$2
' and 'tsvnc --help' for more information.
END
exit
0
fi
fi
if
[
"X
$XTERM_PRINT
"
!=
"X"
]
;
then
XTERM_PRINT
=
""
...
...
@@ -113,9 +149,10 @@ PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin:/usr/sfw/b
export
PATH
if
[
"X
$FULLNAME
"
=
"XKarl J. Runge"
]
;
then
if
[
"X
$NOPOPUFIX
"
=
"X"
]
;
then
VNCVIEWER_POPUP_FIX
=
1
export
VNCVIEWER_POPUP_FIX
fi
PATH
=
`
echo
"
$PATH
"
|
sed
-e
's,runge/bin/override,-------------,'
`
fi
...
...
@@ -123,11 +160,12 @@ if [ "X$WISH" = "X" ]; then
WISH
=
wish
for
try
in
wish8.4 wish wish8.3 wish8.5 wish8.6
do
if
type
$try
>
/dev/null
;
then
if
type
$try
>
/dev/null
2>&1
;
then
WISH
=
$try
break
fi
done
export
WISH
fi
...
...
x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd
View file @
a8453eea
#!/bin/sh
#
# Copyright (c) 2006-200
8
by Karl J. Runge <runge@karlrunge.com>
# Copyright (c) 2006-200
9
by Karl J. Runge <runge@karlrunge.com>
#
# ssvnc_cmd:
#
...
...
@@ -50,7 +50,7 @@
#
# See the TightVNC viewer documentation for on its cmdline arguments.
#
# For convenience, here is the
current (7/2006) TightVNC
viewer -help output:
# For convenience, here is the
TightVNC 1.3dev5
viewer -help output:
#
# TightVNC viewer version 1.3dev5
#
...
...
@@ -98,9 +98,10 @@ PATH=$PATH:/usr/bin:/bin
export
PATH
if
[
"X
$FULLNAME
"
=
"XKarl J. Runge"
]
;
then
if
[
"X
$NOPOPUFIX
"
=
"X"
]
;
then
VNCVIEWER_POPUP_FIX
=
1
export
VNCVIEWER_POPUP_FIX
fi
PATH
=
`
echo
"
$PATH
"
|
sed
-e
's,runge/bin/override,-------------,'
`
fi
...
...
x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ss_vncviewer
View file @
a8453eea
...
...
@@ -3,7 +3,23 @@
# ss_vncviewer: wrapper for vncviewer to use an stunnel SSL tunnel
# or an SSH tunnel.
#
# Copyright (c) 2006-2008 by Karl J. Runge <runge@karlrunge.com>
# Copyright (c) 2006-2009 by Karl J. Runge <runge@karlrunge.com>
#
# ss_vncviewer is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# ss_vncviewer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ss_vncviewer; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
# or see <http://www.gnu.org/licenses/>.
#
#
# You must have stunnel(8) installed on the system and in your PATH
# (however, see the -ssh option below, in which case you will need ssh(1)
...
...
@@ -129,7 +145,7 @@ fi
#
# turn on verbose debugging output
if [ "X$SS_DEBUG" != "X" ]; then
if [ "X$SS_DEBUG" != "X"
-a "X$SS_DEBUG" != "X0"
]; then
set -xv
fi
...
...
@@ -219,10 +235,12 @@ if [ "X$1" = "X-viewerflavor" ]; then
str=`$VNCVIEWERCMD -h 2>&1 | head -n 5`
if echo "$str" | grep -i 'TightVNC.viewer' > /dev/null; then
echo "tightvnc"
elif echo "$str" | grep -i 'RealVNC.Ltd' > /dev/null; then
echo "realvnc4"
elif echo "$str" | grep -i 'VNC viewer version 3' > /dev/null; then
echo "realvnc3"
elif echo "$str" | grep -i 'VNC viewer .*Edition 4' > /dev/null; then
echo "realvnc4"
elif echo "$str" | grep -i 'RealVNC.Ltd' > /dev/null; then
echo "realvnc4"
else
echo "unknown"
fi
...
...
@@ -442,7 +460,12 @@ if echo "$proxy" | egrep "vencrypt://" > /dev/null; then
vtmp=`mytmp "$vtmp"`
SSVNC_PREDIGESTED_HANDSHAKE="$vtmp"
export SSVNC_PREDIGESTED_HANDSHAKE
#echo "SSVNC_PREDIGESTED_HANDSHAKE=$SSVNC_PREDIGESTED_HANDSHAKE"
if [ "X$SSVNC_USE_OURS" = "X" ]; then
NEED_VENCRYPT_VIEWER_BRIDGE=1
fi
fi
if [ "X$SSVNC_USE_OURS" = "X" ]; then
VNCVIEWERCMD_EXTRA_OPTS=""
fi
...
...
@@ -658,6 +681,9 @@ final() {
if [ "X$tail_pid" != "X" ]; then
kill -TERM $tail_pid
fi
if [ "X$tail_pid2" != "X" ]; then
kill -TERM $tail_pid2
fi
}
if [ "X$reverse" = "X" ]; then
...
...
@@ -755,17 +781,30 @@ pcode() {
cod='#!/usr/bin/perl
# A hack to glue stunnel to a Web proxy or SOCKS for client connections.
# A hack to glue stunnel to a Web or SOCKS proxy, UltraVNC repeater for
# client connections.
# Also acts as a VeNCrypt bridge (by redirecting to stunnel.)
use IO::Socket::INET;
if (exists $ENV{PPROXY_SLEEP}) {
if (exists $ENV{PPROXY_SLEEP}
&& $ENV{PPROXY_SLEEP} > 0
) {
print STDERR "PPROXY_PID: $$\n";
sleep $ENV{PPROXY_SLEEP};
}
foreach my $var (qw(PPROXY_PROXY PPROXY_SOCKS PPROXY_DEST PPROXY_LISTEN
PPROXY_REVERSE PPROXY_REPEATER PPROXY_REMOVE PPROXY_KILLPID PPROXY_SLEEP)) {
foreach my $var (qw(
PPROXY_DEST
PPROXY_KILLPID
PPROXY_LISTEN
PPROXY_PROXY
PPROXY_REMOVE
PPROXY_REPEATER
PPROXY_REVERSE
PPROXY_SLEEP
PPROXY_SOCKS
PPROXY_VENCRYPT
PPROXY_VENCRYPT_VIEWER_BRIDGE
)) {
if (0 || $ENV{SS_DEBUG} || $ENV{SSVNC_VENCRYPT_DEBUG}) {
print STDERR "$var: $ENV{$var}\n";
}
...
...
@@ -808,14 +847,14 @@ sub gettime {
return $t;
}
sub append_handshake {
my $str = shift
;
if ($handshake_file) {
if (open(HSF, ">>$handshake_file")) {
print HSF $str;
close HSF
;
}
}
my $listen_handle = "";
my $sock = ""
;
my $parent = $$;
if ($ENV{PPROXY_VENCRYPT_VIEWER_BRIDGE}) {
my ($from, $to) = split(/,/, $ENV{PPROXY_VENCRYPT_VIEWER_BRIDGE})
;
do_vencrypt_viewer_bridge($from, $to);
exit 0;
}
my ($first, $second, $third) = split(/,/, $ENV{PPROXY_PROXY}, 3);
...
...
@@ -836,7 +875,7 @@ if ($third ne "") {
print STDERR "\n";
print STDERR "PPROXY v0.
2: a tool for Web proxies and SOCKS connections
.\n";
print STDERR "PPROXY v0.
3: a tool for Web, SOCKS, and UltraVNC proxies and VeNCrypt bridging
.\n";
print STDERR "proxy_host: $proxy_host\n";
print STDERR "proxy_port: $proxy_port\n";
print STDERR "proxy_connect: $connect\n";
...
...
@@ -851,7 +890,12 @@ if (1) {
print STDERR "\n";
}
my $listen_handle = "";
sub pdie {
my $msg = shift;
kill_proxy_pids();
die "$msg";
}
if ($ENV{PPROXY_REVERSE} ne "") {
my ($rhost, $rport) = split(/:/, $ENV{PPROXY_REVERSE});
$rport = 5900 unless $rport;
...
...
@@ -861,20 +905,26 @@ if ($ENV{PPROXY_REVERSE} ne "") {
Proto => "tcp"
);
if (! $listen_handle) {
die "pproxy: $! -- PPROXY_REVERSE\n";
p
die "pproxy: $! -- PPROXY_REVERSE\n";
}
print STDERR "PPROXY_REVERSE: connected to $rhost $rport\n";
} elsif ($ENV{PPROXY_LISTEN} ne "") {
my $listen_sock = "";
my $maxtry = 12;
my $sleep = 5;
my $p2 = "";
for (my $i=0; $i < $maxtry; $i++) {
if ($ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:(.*)/) {
my $p = $1;
$p2 = "*:$p";
$listen_sock = IO::Socket::INET->new(
Listen => 2,
LocalPort => $p,
Proto => "tcp"
);
} else {
$p2 = "localhost:$ENV{PPROXY_LISTEN}";
$listen_sock = IO::Socket::INET->new(
Listen => 2,
LocalAddr => "127.0.0.1",
...
...
@@ -883,17 +933,29 @@ if ($ENV{PPROXY_REVERSE} ne "") {
);
}
if (! $listen_sock) {
die "pproxy: $! -- PPROXY_LISTEN\n";
if ($i < $maxtry - 1) {
warn "pproxy: $!\n";
warn "Could not listen on port $p2, retrying in $sleep seconds... (Ctrl-C to quit)\n";
sleep $sleep;
}
} else {
last;
}
}
if (! $listen_sock) {
pdie "pproxy: $! -- PPROXY_LISTEN\n";
}
print STDERR "pproxy: listening on $p2\n";
my $ip;
($listen_handle, $ip) = $listen_sock->accept();
my $err = $!;
close $listen_sock;
if (! $listen_handle) {
die "pproxy: $!
\n";
pdie "pproxy: $err
\n";
}
close $listen_sock;
}
my
$sock = IO::Socket::INET->new(
$sock = IO::Socket::INET->new(
PeerAddr => $proxy_host,
PeerPort => $proxy_port,
Proto => "tcp"
...
...
@@ -902,13 +964,13 @@ my $sock = IO::Socket::INET->new(
if (! $sock) {
my $err = $!;
unlink($0) if $ENV{PPROXY_REMOVE};
die "pproxy: $err\n";
p
die "pproxy: $err\n";
}
unlink($0) if $ENV{PPROXY_REMOVE};
if ($ENV{PPROXY_PROXY} =~ /^vencrypt:/ && $ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:/) {
print STDERR "PPROXY: vencrypt+reverse: swapping listen socket with connect socket.\n";
print STDERR "
\n
PPROXY: vencrypt+reverse: swapping listen socket with connect socket.\n";
my $tmp_swap = $sock;
$sock = $listen_handle;
$listen_handle = $tmp_swap;
...
...
@@ -935,58 +997,123 @@ if ($second ne "") {
connection($connect, 1);
}
$parent = $$;
$child = fork;
if (! defined $child) {
sub kill_proxy_pids() {
if ($ENV{PPROXY_VENCRYPT_VIEWER_BRIDGE}) {
return;
}
if ($ENV{PPROXY_KILLPID}) {
foreach my $p (split(/,/, $ENV{PPROXY_KILLPID})) {
if ($p =~ /^(\+|-)/) {
$p = $parent + $p;
}
print STDERR "kill TERM, $p (PPROXY_KILLPID)\n";
kill "TERM", $p;
}
}
exit 1;
}
if ($child) {
print STDERR "pproxy parent\[$$] STDIN -> socket\n";
sub xfer {
my($in, $out) = @_;
$RIN = $WIN = $EIN = "";
$ROUT = "";
vec($RIN, fileno($in), 1) = 1;
vec($WIN, fileno($in), 1) = 1;
$EIN = $RIN | $WIN;
while (1) {
my $nf = 0;
while (! $nf) {
$nf = select($ROUT=$RIN, undef, undef, undef);
}
my $len = sysread($in, $buf, 8192);
if (! defined($len)) {
next if $! =~ /^Interrupted/;
print STDERR "pproxy[$$]: $!\n";
last;
} elsif ($len == 0) {
print STDERR "pproxy[$$]: Input is EOF.\n";
last;
}
my $offset = 0;
my $quit = 0;
while ($len) {
my $written = syswrite($out, $buf, $len, $offset);
if (! defined $written) {
print STDERR "pproxy[$$]: Output is EOF. $!\n";
$quit = 1;
last;
}
$len -= $written;
$offset += $written;
}
last if $quit;
}
close($out);
close($in);
print STDERR "pproxy[$$]: finished xfer.\n";
}
sub handler {
print STDERR "pproxy[$$]: got SIGTERM.\n";
close $listen_handle if $listen_handle;
close $sock if $sock;
exit;
}
sub xfer_both {
$child = fork;
if (! defined $child) {
kill_proxy_pids();
exit 1;
}
$SIG{TERM} = "handler";
if ($child) {
if ($listen_handle) {
print STDERR "pproxy parent[$$] listen_handle -> socket\n";
xfer($listen_handle, $sock);
} else {
print STDERR "pproxy parent[$$] STDIN -> socket\n";
xfer(STDIN, $sock);
}
select(undef, undef, undef, 0.25);
if (kill 0, $child) {
select(undef, undef, undef, 1.5);
print STDERR "pproxy\[$$]: kill TERM $child\n";
select(undef, undef, undef, 0.9);
if (kill 0, $child) {
print STDERR "pproxy[$$]: kill TERM child $child\n";
kill "TERM", $child;
} else {
print STDERR "pproxy[$$]: child $child gone.\n";
}
} else {
print STDERR "pproxy child \[$$] socket -> STDOUT\n";
}
} else {
select(undef, undef, undef, 0.05);
if ($listen_handle) {
print STDERR "pproxy child [$$] socket -> listen_handle\n\n";
xfer($sock, $listen_handle);
} else {
print STDERR "pproxy child [$$] socket -> STDOUT\n\n";
xfer($sock, STDOUT);
}
select(undef, undef, undef, 0.25);
if (kill 0, $parent) {
select(undef, undef, undef, 1.5);
print STDERR "pproxy\[$$]: kill TERM $parent\n";
select(undef, undef, undef, 0.8);
if (kill 0, $parent) {
print STDERR "pproxy[$$]: kill TERM parent $parent\n";
kill "TERM", $parent;
} else {
print STDERR "pproxy[$$]: parent $parent gone.\n";
}
}
if ($ENV{PPROXY_KILLPID} ne "") {
if ($ENV{PPROXY_KILLPID}) {
foreach my $p (split(/,/, $ENV{PPROXY_KILLPID})) {
if ($p =~ /^(\+|-)/) {
$p = $parent + $p;
}
print STDERR "kill TERM, $p (PPROXY_KILLPID)\n";
kill "TERM", $p;
}
}
kill_proxy_pids();
}
xfer_both();
exit;
sub url_parse {
...
...
@@ -1215,13 +1342,14 @@ sub connection {
sub vdie {
append_handshake("done\n");
close $sock;
kill_proxy_pids();
exit(1);
}
sub anontls_handshake {
my ($vmode, $db) = @_;
print STDERR "PPROXY: Doing ANONTLS Handshake\n";
print STDERR "
\n
PPROXY: Doing ANONTLS Handshake\n";
my $psec = pack("C", $rfbSecTypeAnonTls);
syswrite($sock, $psec, 1);
...
...
@@ -1233,7 +1361,7 @@ sub vencrypt_handshake {
my ($vmode, $db) = @_;
print STDERR "PPROXY: Doing VeNCrypt Handshake\n";
print STDERR "
\n
PPROXY: Doing VeNCrypt Handshake\n";
my $psec = pack("C", $rfbSecTypeVencrypt);
...
...
@@ -1426,44 +1554,407 @@ sub vencrypt_dialog {
}
}
sub xfer {
my($in, $out) = @_;
$RIN = $WIN = $EIN = "";
$ROUT = "";
vec($RIN, fileno($in), 1) = 1;
vec($WIN, fileno($in), 1) = 1;
$EIN = $RIN | $WIN;
sub append_handshake {
my $str = shift;
if ($handshake_file) {
if (open(HSF, ">>$handshake_file")) {
print HSF $str;
close HSF;
}
}
}
while (1) {
my $nf = 0;
while (! $nf) {
$nf = select($ROUT=$RIN, undef, undef, undef);
sub do_vencrypt_viewer_bridge {
my ($listen, $connect) = @_;
print STDERR "\npproxy: starting vencrypt_viewer_bridge[$$]: $listen \-> $connect\n";
my $db = 0;
my $backwards = 0;
if ($listen < 0) {
$backwards = 1;
$listen = -$listen;
}
my $len = sysread($in, $buf, 8192);
if (! defined($len)) {
next if $! =~ /^Interrupted/;
print STDERR "pproxy\[$$]: $!\n";
last;
} elsif ($len == 0) {
print STDERR "pproxy\[$$]: Input is EOF.\n";
if ($handshake_file eq "") {
die "pproxy: vencrypt_viewer_bridge[$$]: no SSVNC_PREDIGESTED_HANDSHAKE\n";
}
my $listen_sock;
my $maxtry = 12;
my $sleep = 5;
for (my $i=0; $i < $maxtry; $i++) {
$listen_sock = IO::Socket::INET->new(
Listen => 2,
LocalAddr => "127.0.0.1",
LocalPort => $listen,
Proto => "tcp"
);
if (! $listen_sock) {
if ($i < $maxtry - 1) {
warn "pproxy: vencrypt_viewer_bridge[$$]: $!\n";
warn "Could not listen on port $listen, retrying in $sleep seconds... (Ctrl-C to quit)\n";
sleep $sleep;
}
} else {
last;
}
my $offset = 0;
my $quit = 0;
while ($len) {
my $written = syswrite($out, $buf, $len, $offset);
if (! defined $written) {
print STDERR "pproxy\[$$]: Output is EOF. $!\n";
$quit = 1;
}
if (! $listen_sock) {
die "pproxy: vencrypt_viewer_bridge[$$]: $!\n";
}
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: listening on port $listen\n\n";
my ($viewer_sock, $ip) = $listen_sock->accept();
my $err = $!;
close $listen_sock;
if (! $viewer_sock) {
die "pproxy: vencrypt_viewer_bridge[$$]: $err\n";
}
print STDERR "vencrypt_viewer_bridge[$$]: viewer_sock $viewer_sock\n" if $db;
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: connecting to 127.0.0.1:$connect\n";
my $server_sock = IO::Socket::INET->new(
PeerAddr => "127.0.0.1",
PeerPort => $connect,
Proto => "tcp"
);
print STDERR "vencrypt_viewer_bridge[$$]: server_sock $server_sock\n" if $db;
if (! $server_sock) {
my $err = $!;
die "pproxy: vencrypt_viewer_bridge[$$]: $err\n";
}
if ($backwards) {
print STDERR "vencrypt_viewer_bridge[$$]: reversing roles of viewer and server.\n";
my $t = $viewer_sock;
$viewer_sock = $server_sock;
$server_sock = $t;
}
my %hs = ();
my $dt = 0.2;
my $slept = 0.0;
while ($slept < 20.0) {
select(undef, undef, undef, $dt);
$slept += $dt;
if (-f $handshake_file && open(HSF, "<$handshake_file")) {
my $done = 0;
%hs = ();
my $str = "";
while (<HSF>) {
print STDERR "vencrypt_viewer_bridge[$$]: $_" if $ENV{VENCRYPT_VIEWER_BRIDGE_DEBUG};
$str .= "vencrypt_viewer_bridge[$$]: $_";
chomp;
if ($_ eq "done") {
$done = 1;
} else {
my ($k, $v) = split(/=/, $_, 2);
if ($k ne "" && $v ne "") {
$hs{$k} = $v;
}
}
}
close HSF;
if ($done) {
print STDERR "\n" . $str;
last;
}
$len -= $written;
$offset += $written;
}
last if $quit;
}
close($in);
close($out);
if (! exists $hs{server}) {
$hs{server} = "RFB 003.008";
}
if (! exists $hs{sectype}) {
unlink($handshake_file);
die "pproxy: vencrypt_viewer_bridge[$$]: no sectype.\n";
}
syswrite($viewer_sock, "$hs{server}\n", length($hs{server}) + 1);
my $viewer_rfb = "";
for (my $i = 0; $i < 12; $i++) {
my $c;
sysread($viewer_sock, $c, 1);
$viewer_rfb .= $c;
print STDERR $c;
}
my $viewer_major = 3;
my $viewer_minor = 8;
if ($viewer_rfb =~ /RFB (\d+)\.(\d+)/) {
$viewer_major = $1;
$viewer_minor = $2;
}
my $u0 = pack("C", 0);
my $u1 = pack("C", 1);
my $u2 = pack("C", 2);
if ($hs{sectype} == $rfbSecTypeAnonTls) {
unlink($handshake_file);
print STDERR "\npproxy: vencrypt_viewer_bridge[$$]: rfbSecTypeAnonTls\n";
if ($viewer_major > 3 || $viewer_minor >= 7) {
; # setup ok, proceed to xfer.
} else {
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: faking RFB version 3.3 to viewer.\n";
my $n;
sysread($server_sock, $n, 1);
$n = unpack("C", $n);
if ($n == 0) {
die "pproxy: vencrypt_viewer_bridge[$$]: nsectypes == $n.\n";
}
my %types;
for (my $i = 0; $i < $n; $i++) {
my $t;
sysread($server_sock, $t, 1);
$t = unpack("C", $t);
$types{$t} = 1;
}
my $use = 1; # None
if (exists $types{1}) {
$use = 1; # None
} elsif (exists $types{2}) {
$use = 2; # VncAuth
} else {
die "pproxy: vencrypt_viewer_bridge[$$]: no valid sectypes" . join(",", keys %types) . "\n";
}
# send 4 bytes sectype to viewer:
# (note this should be MSB, network byte order...)
my $up = pack("C", $use);
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $up, 1);
# and tell server the one we selected:
syswrite($server_sock, $up, 1);
if ($use == 1) {
# even None has security result, so read it here and discard it.
my $sr = "";
sysread($server_sock, $sr, 4);
}
}
} elsif ($hs{sectype} == $rfbSecTypeVencrypt) {
print STDERR "\npproxy: vencrypt_viewer_bridge[$$]: rfbSecTypeVencrypt\n";
if (! exists $hs{subtype}) {
unlink($handshake_file);
die "pproxy: vencrypt_viewer_bridge[$$]: no subtype.\n";
}
my $fake_type = "None";
my $plain = 0;
my $sub_type = $hs{subtype};
if ($sub_type == $rfbVencryptTlsNone) {
$fake_type = "None";
} elsif ($sub_type == $rfbVencryptTlsVnc) {
$fake_type = "VncAuth";
} elsif ($sub_type == $rfbVencryptTlsPlain) {
$fake_type = "None";
$plain = 1;
} elsif ($sub_type == $rfbVencryptX509None) {
$fake_type = "None";
} elsif ($sub_type == $rfbVencryptX509Vnc) {
$fake_type = "VncAuth";
} elsif ($sub_type == $rfbVencryptX509Plain) {
$fake_type = "None";
$plain = 1;
}
if ($plain) {
if (!open(W, ">$handshake_file")) {
unlink($handshake_file);
die "pproxy: vencrypt_viewer_bridge[$$]: $handshake_file $!\n";
}
print W <<"END";
proc print_out {} {
global user pass env
if [info exists env(SSVNC_UP_DEBUG)] {
toplevel .b
button .b.b -text "user=\$user pass=\$pass" -command {destroy .b}
pack .b.b
update
tkwait window .b
}
if [info exists env(SSVNC_UP_FILE)] {
set fh ""
catch {set fh [open \$env(SSVNC_UP_FILE) w]}
if {\$fh != ""} {
puts \$fh user=\$user\\npass=\$pass
flush \$fh
close \$fh
return
}
}
puts stdout user=\$user\\npass=\$pass
flush stdout
}
proc center_win {w} {
update
set W [winfo screenwidth \$w]
set W [expr \$W + 1]
wm geometry \$w +\$W+0
update
set x [expr [winfo screenwidth \$w]/2 - [winfo width \$w]/2]
set y [expr [winfo screenheight \$w]/2 - [winfo height \$w]/2]
wm geometry \$w +\$x+\$y
wm deiconify \$w
update
}
wm withdraw .
global env
set up {}
if [info exists env(SSVNC_UNIXPW)] {
set rm 0
set up \$env(SSVNC_UNIXPW)
if [regexp {^rm:} \$up] {
set rm 1
regsub {^rm:} \$up {} up
}
if [file exists \$up] {
set fh ""
set f \$up
catch {set fh [open \$up r]}
if {\$fh != ""} {
gets \$fh u
gets \$fh p
close \$fh
set up "\$u@\$p"
}
if {\$rm} {
catch {file delete \$f}
}
}
} elseif [info exists env(SSVNC_VENCRYPT_USERPASS)] {
set up \$env(SSVNC_VENCRYPT_USERPASS)
}
#puts stderr up=\$up
if {\$up != ""} {
if [regexp {@} \$up] {
global user pass
set user \$up
set pass \$up
regsub {@.*\$} \$user "" user
regsub {^[^@]*@} \$pass "" pass
print_out
exit
}
}
wm title . {VeNCrypt Viewer Bridge User/Pass}
set user {}
set pass {}
label .l -text {SSVNC VeNCrypt Viewer Bridge}
frame .f0
frame .f0.fL
label .f0.fL.la -text {Username: }
label .f0.fL.lb -text {Password: }
pack .f0.fL.la .f0.fL.lb -side top
frame .f0.fR
entry .f0.fR.ea -width 24 -textvariable user
entry .f0.fR.eb -width 24 -textvariable pass -show *
pack .f0.fR.ea .f0.fR.eb -side top -fill x
pack .f0.fL -side left
pack .f0.fR -side right -expand 1 -fill x
button .no -text Cancel -command {destroy .}
button .ok -text Done -command {print_out; destroy .}
center_win .
pack .l .f0 .no .ok -side top -fill x
update
wm deiconify .
bind .f0.fR.ea <Return> {focus .f0.fR.eb}
bind .f0.fR.eb <Return> {print_out; destroy .}
focus .f0.fR.ea
wm resizable . 1 0
wm minsize . [winfo reqwidth .] [winfo reqheight .]
END
close W;
#system("cat $handshake_file");
my $w = "wish";
if ($ENV{WISH}) {
$w = $ENV{WISH};
}
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: prompt VencryptPlain user and passwd.\n";
my $res = "";
if (`uname` =~ /Darwin/) {
my $mtmp = `mktemp /tmp/hsup.XXXXXX`;
chomp $mtmp;
system("env SSVNC_UP_FILE=$mtmp $w $handshake_file");
$res = `cat $mtmp`;
unlink $mtmp;
} else {
$res = `$w $handshake_file`;
}
my $user = "";
my $pass = "";
if ($res =~ /user=(\S*)/) {
$user = $1;
}
if ($res =~ /pass=(\S*)/) {
$pass = $1;
}
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: sending VencryptPlain user and passwd.\n";
my $ulen = pack("C", length($user));
my $plen = pack("C", length($pass));
# (note this should be MSB, network byte order...)
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $ulen, 1);
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $u0, 1);
syswrite($server_sock, $plen, 1);
syswrite($server_sock, $user, length($user));
syswrite($server_sock, $pass, length($pass));
}
unlink($handshake_file);
my $ft = 0;
if ($fake_type eq "None") {
$ft = 1;
} elsif ($fake_type eq "VncAuth") {
$ft = 2;
} else {
die "pproxy: vencrypt_viewer_bridge[$$]: unknown fake type: $fake_type\n";
}
my $fp = pack("C", $ft);
if ($viewer_major > 3 || $viewer_minor >= 7) {
syswrite($viewer_sock, $u1, 1);
syswrite($viewer_sock, $fp, 1);
my $cr;
sysread($viewer_sock, $cr, 1);
$cr = unpack("C", $cr);
if ($cr != $ft) {
die "pproxy: vencrypt_viewer_bridge[$$]: client selected wrong type: $cr / $ft\n";
}
} else {
print STDERR "pproxy: vencrypt_viewer_bridge[$$]: faking RFB version 3.3 to viewer.\n";
# send 4 bytes sect type to viewer:
# (note this should be MSB, network byte order...)
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $u0, 1);
syswrite($viewer_sock, $fp, 1);
if ($ft == 1) {
# even None has security result, so read it here and discard it.
my $sr = "";
sysread($server_sock, $sr, 4);
}
}
}
$listen_handle = $viewer_sock;
$sock = $server_sock;
xfer_both();
}
'
# '
...
...
@@ -1549,11 +2040,33 @@ END
}
Kecho() {
if [ "X$USER" = "Xrunge" ]; then
NO_KECHO=1
if [ "X$USER" = "Xrunge" -a "X$NO_KECHO" = "X" ]; then
echo "dbg: $*"
fi
}
NHAFL_warning() {
echo ""
echo "** Warning: For the proxy: $proxy"
echo "** Warning: the ssh(1) option: $ssh_NHAFL"
echo "** Warning: will be used to avoid frequent 'ssh key has changed for localhost'"
echo "** Warning: dialogs and connection failures (for example, ssh will exit asking"
echo "** Warning: you to manually remove a key from ~/.ssh/known_hosts.)"
echo "** Warning: "
echo "** Warning: This decreases security: a Man-In-The-Middle attack is possible."
echo "** Warning: You can set the SSVNC_SSH_LOCALHOST_AUTH=1 env. var. to disable"
echo "** Warning: using the NoHostAuthenticationForLocalhost ssh option."
echo "** Warning: "
echo "** Warning: A better solution is to configure (in the SSVNC GUI) the setting:"
echo "** Warning: 'Options -> Advanced -> Private SSH KnownHosts file' (or set"
echo "** Warning: SSVNC_KNOWN_HOSTS_FILE directly) to a per-connection known hosts"
echo "** Warning: file. This yields a both secure and convenient solution."
echo ""
}
# handle ssh case:
#
if [ "X$use_ssh" = "X1" ]; then
#
# USING SSH
...
...
@@ -1561,6 +2074,8 @@ if [ "X$use_ssh" = "X1" ]; then
ssh_port="22"
ssh_host="$host"
vnc_host="$localhost"
ssh_UKHF=""
localhost_extra=""
# let user override ssh via $SSH
ssh=${SSH:-"ssh -x"}
...
...
@@ -1584,6 +2099,22 @@ if [ "X$use_ssh" = "X1" ]; then
fi
fi
ssh_NHAFL="-o NoHostAuthenticationForLocalhost=yes"
if [ "X$SSVNC_SSH_LOCALHOST_AUTH" = "X1" ]; then
ssh_NHAFL=""
fi
if [ "X$SSVNC_KNOWN_HOSTS_FILE" != "X" ]; then
ssh_NHAFL=""
ssh_UKHF="-o UserKnownHostsFile=$SSVNC_KNOWN_HOSTS_FILE"
ssh_args="$ssh_args $ssh_UKHF"
if [ ! -f "$SSVNC_KNOWN_HOSTS_FILE" ]; then
touch "$SSVNC_KNOWN_HOSTS_FILE" >/dev/null 2>&1
fi
chmod 600 "$SSVNC_KNOWN_HOSTS_FILE" >/dev/null 2>&1
fi
did_ssh_NHAFL=""
if [ "X$SSVNC_LIM_ACCEPT_PRELOAD" != "X" ]; then
SSVNC_LIM_ACCEPT_PRELOAD="$SSVNC_BASEDIR/$SSVNC_UNAME/$SSVNC_LIM_ACCEPT_PRELOAD"
fi
...
...
@@ -1602,6 +2133,29 @@ if [ "X$use_ssh" = "X1" ]; then
SSVNC_LIM_ACCEPT_PRELOAD=""
fi
ssh_vencrypt_proxy=""
# We handle vencrypt for SSH+SSL mode.
if echo "$proxy" | grep 'vencrypt://' > /dev/null; then
proxynew=""
for part in `echo "$proxy" | tr ',' ' '`
do
if echo "$part" | egrep -i '^vencrypt://' > /dev/null; then
ssh_vencrypt_proxy=$part
else
if [ "X$proxynew" = "X" ]; then
proxynew="$part"
else
proxynew="$proxynew,$part"
fi
fi
done
proxy=$proxynew
fi
Kecho ssh_vencrypt_proxy=$ssh_vencrypt_proxy
# note that user must supply http:// for web proxy in SSH and SSH+SSL.
# No xxxx:// implies ssh server+port.
#
if echo "$proxy" | egrep '(http|https|socks|socks4|socks5)://' > /dev/null; then
# Handle Web or SOCKS proxy(ies) for the initial connect.
Kecho host=$host
...
...
@@ -1687,11 +2241,16 @@ if [ "X$use_ssh" = "X1" ]; then
port=$port_save
host=$host_save
nd=`findfree 6
7
00`
nd=`findfree 6
6
00`
PPROXY_LISTEN=$nd; export PPROXY_LISTEN
$ptmp &
sleep 2
ssh_args="$ssh_args -o NoHostAuthenticationForLocalhost=yes"
sleep 1
if [ "X$ssh_NHAFL" != "X" -a "X$did_ssh_NHAFL" != "X1" ]; then
NHAFL_warning
ssh_args="$ssh_args $ssh_NHAFL"
did_ssh_NHAFL=1
fi
sleep 1
if [ "X$sproxy1" = "X" ]; then
u=""
if echo "$host" | grep '@' > /dev/null; then
...
...
@@ -1702,6 +2261,7 @@ if [ "X$use_ssh" = "X1" ]; then
else
proxy="${sproxy1_user}$localhost:$nd"
fi
localhost_extra=".2"
if [ "X$sproxy_rest" != "X" ]; then
proxy="$proxy,$sproxy_rest"
fi
...
...
@@ -1733,12 +2293,21 @@ if [ "X$use_ssh" = "X1" ]; then
ssh_port2="22"
fi
proxport=`findfree 3500`
if [ "X$ssh_NHAFL" != "X" -a "X$did_ssh_NHAFL" != "X1" ]; then
NHAFL_warning
did_ssh_NHAFL=1
sleep 1
fi
echo
echo "Running 1st ssh proxy:"
echo "$ssh -f -x $ssh_port1 $targ -e none -o NoHostAuthenticationForLocalhost=yes -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 \"sleep 30\""
ukhf=""
if [ "X$ssh_UKHF" != "X" ]; then
ukhf="$ssh_UKHF$localhost_extra"
fi
echo "$ssh -f -x $ssh_port1 $targ -e none $ssh_NHAFL $ukhf -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 \"sleep 30\""
echo ""
$ssh -f -x $ssh_port1 $targ -e none
-o NoHostAuthenticationForLocalhost=yes
-L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 "sleep 30"
ssh_args="$ssh_args
-o NoHostAuthenticationForLocalhost=yes
"
$ssh -f -x $ssh_port1 $targ -e none
$ssh_NHAFL $ukhf
-L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 "sleep 30"
ssh_args="$ssh_args
$ssh_NHAFL
"
sleep 1
stty sane
proxy="${ssh_user2}$localhost:$proxport"
...
...
@@ -1813,6 +2382,8 @@ if [ "X$use_ssh" = "X1" ]; then
elif [ "X$getport" != "X" ]; then
tport=/tmp/ss_vncviewer_tport${RANDOM}.$$
tport=`mytmp "$tport"`
tport2=/tmp/ss_vncviewer_tport2${RANDOM}.$$
tport2=`mytmp "$tport2"`
if [ "X$rsh" != "X1" ]; then
if echo "$ssh_cmd" | grep "sudo " > /dev/null; then
...
...
@@ -1826,10 +2397,12 @@ if [ "X$use_ssh" = "X1" ]; then
fi
echo "$ssh -x -f $ssh_port $targ $C $ssh_redir $ssh_args $ssh_host \"$info\""
echo ""
$ssh -x -f $ssh_port $targ $C $ssh_redir $ssh_args $ssh_host "$ssh_cmd" > $tport
$ssh -x -f $ssh_port $targ $C $ssh_redir $ssh_args $ssh_host "$ssh_cmd" > $tport
2> $tport2
if [ "X$teeport" = "X1" ]; then
tail -f $tport 1>&2 &
tail_pid=$!
tail -f $tport2 1>&2 &
tail_pid2=$!
fi
rc=$?
else
...
...
@@ -1858,11 +2431,11 @@ if [ "X$use_ssh" = "X1" ]; then
while [ $i -lt $imax ]; do
#echo $sleepit
eval $sleepit
PORT=`grep "^PORT=" $tport |
head -n 1 | sed -e 's/PORT=//' -e 's/\r//g
'`
PORT=`grep "^PORT=" $tport |
tr '\r' ' ' | head -n 1 | sed -e 's/PORT=//' -e 's/\r//g' -e 's/ *$//
'`
if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then
break
fi
vnss=`sed -e 's/\r//g' $tport | egrep -i '^(New.* desktop is|A VNC server is already running).*:[0-9[0-9]*$' | head -n 1 | awk '{print $NF}'`
vnss=`sed -e 's/\r//g' $tport
$tport2
| egrep -i '^(New.* desktop is|A VNC server is already running).*:[0-9[0-9]*$' | head -n 1 | awk '{print $NF}'`
if [ "X$vnss" != "X" ]; then
PORT=`echo "$vnss" | awk -F: '{print $2}'`
if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then
...
...
@@ -1871,14 +2444,16 @@ if [ "X$use_ssh" = "X1" ]; then
fi
fi
if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then
vnss=`sed -e 's/\r//g' $tport | egrep -i '^(New.* desktop is|A VNC server is already running).*:[0-9[0-9]*$' | head -n 1`
echo "vncserver string: $vnss" 1>&2
break
fi
fi
i=`expr $i + 1`
done
echo "
PORT=$PORT
" 1>&2
rm -f $tport
echo "
found: PORT='$PORT'
" 1>&2
rm -f $tport
$tport2
if [ "X$rsh" = "X1" ]; then
rsh_viewer "$@"
exit $?
...
...
@@ -2004,6 +2579,16 @@ if [ "X$use_ssh" = "X1" ]; then
else
proxy=""
fi
if [ "X$ssh_vencrypt_proxy" != "X" ]; then
ssh_vencrypt_proxy="vencrypt://$host:$port"
if [ "X$proxy" = "X" ]; then
proxy=$ssh_vencrypt_proxy
else
proxy="$proxy,$ssh_vencrypt_proxy"
fi
Kecho "proxy_now=$proxy"
unset PPROXY_LISTEN
fi
fi
fi
...
...
@@ -2034,6 +2619,9 @@ if [ "X$verify" != "X" ]; then
verify="$verify
verify = 2"
fi
if [ "X$SSVNC_STUNNEL_VERIFY3" != "X" ]; then
verify=`echo "$verify" | sed -e 's/verify = 2/verify = 3/'`
fi
if [ "X$mycert" != "X" ]; then
cert="cert = $mycert"
fi
...
...
@@ -2063,7 +2651,6 @@ if [ "X$proxy" != "X" ]; then
PPROXY_LISTEN=$nd
export PPROXY_LISTEN
if [ "X$reverse" = "X" ]; then
#$ptmp 2>/dev/null &
$ptmp &
fi
sleep 2
...
...
@@ -2082,6 +2669,8 @@ else
connect="connect = $host:$port"
fi
# handle showcert case:
#
if [ "X$showcert" = "X1" ]; then
if [ "X$proxy" != "X" ]; then
PPROXY_LISTEN=$use
...
...
@@ -2092,6 +2681,23 @@ if [ "X$showcert" = "X1" ]; then
$ptmp 2>/dev/null &
fi
sleep 1
more_sleep=1
if uname | grep Linux > /dev/null; then
if netstat -ant | grep LISTEN | grep "127.0.0.1:$use" > /dev/null; then
more_sleep=""
fi
elif uname | grep SunOS > /dev/null; then
if netstat -an -f inet -P tcp | grep LISTEN | grep "127.0.0.1.$use" > /dev/null; then
more_sleep=""
fi
elif uname | egrep -i 'bsd|darwin' > /dev/null; then
if netstat -ant -f inet | grep LISTEN | grep "127.0.0.1.$use" > /dev/null; then
more_sleep=""
fi
fi
if [ "X$more_sleep" = "X1" ]; then
sleep 1
fi
host="$localhost"
port="$use"
fi
...
...
@@ -2114,6 +2720,15 @@ if [ "X$showcert" = "X1" ]; then
fi
#echo "openssl s_client $cipher_args -connect $host:$port"
if [ "X$reverse" = "X" ]; then
host $host >/dev/null 2>&1
host $host >/dev/null 2>&1
timeout=15
if [ "X$SSVNC_FETCH_TIMEOUT" != "X" ]; then
timeout=$SSVNC_FETCH_TIMEOUT
fi
if type pkill >/dev/null 2>&1; then
(sleep $timeout; if kill -0 $$; then pkill -TERM -f "openssl.*s_client.*$host.*$port"; fi) >/dev/null 2>&1 &
fi
openssl s_client $cipher_args -prexit -connect $host:$port 2>&1 < /dev/null
rc=$?
else
...
...
@@ -2183,6 +2798,8 @@ if [ "X$showcert" = "X1" ]; then
fi
fi
# handle direct connect case:
#
if [ "X$direct_connect" != "X" ]; then
if [ "X$SSVNC_ULTRA_DSM" != "X" ]; then
SSVNC_NO_ENC_WARN=1
...
...
@@ -2199,7 +2816,7 @@ if [ "X$direct_connect" != "X" ]; then
:
else
echo ""
echo "**
NOTE
: THERE WILL BE NO SSL OR SSH ENCRYPTION **"
echo "**
WARNING
: THERE WILL BE NO SSL OR SSH ENCRYPTION **"
echo ""
fi
fi
...
...
@@ -2420,6 +3037,14 @@ echo "Using this stunnel configuration:"
echo ""
cat "$tmp_cfg" | uniq
echo ""
if egrep -i '^[ ]*(CApath|CAfile) =' "$tmp_cfg" > /dev/null ; then
:
else
echo "** WARNING: THE STUNNEL CONFIG HAS NO SERVER CERTIFICATE SPECIFIED **"
echo "** WARNING: (the CApath or CAfile stunnel option) THE VNC SERVER WILL **"
echo "** WARNING: NOT BE AUTHENTICATED. A MAN-IN-THE-MIDDLE ATTACK IS POSSIBLE **"
echo ""
fi
sleep 1
if [ "X$stunnel_exec" = "X" ]; then
...
...
@@ -2462,8 +3087,16 @@ if [ "X$SSVNC_EXTRA_SLEEP" != "X" ]; then
echo "sleep $SSVNC_EXTRA_SLEEP"
sleep $SSVNC_EXTRA_SLEEP
fi
echo "Running viewer:"
if [ "X$reverse" = "X" ]; then
if [ "X$NEED_VENCRYPT_VIEWER_BRIDGE" = "X1" -a "X$ptmp" != "X" ] ; then
port1=`expr 5900 + $N` # stunnel port
port2=`findfree 5970` # bridge port (viewer connects to it.)
N=`expr $port2 - 5900`
env PPROXY_REMOVE=0 PPROXY_SLEEP=0 PPROXY_VENCRYPT_VIEWER_BRIDGE="$port2,$port1" $ptmp &
sleep 1
fi
echo "Running viewer:"
vnc_hp=$localhost:$N
if [ "X$stunnel_exec" != "X" ]; then
vnc_hp="exec=$STUNNEL $tmp_cfg"
...
...
@@ -2480,19 +3113,16 @@ if [ "X$reverse" = "X" ]; then
fi
fi
else
echo "Running viewer:"
echo ""
echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode."
echo ""
trap "final" 0 2 15
N2=$N
if [ "X$VNCVIEWER_IS_REALVNC4" = "X1" ]; then
N2=`echo "$N2" | sed -e 's/://g'`
if [ $N2 -le 200 ]; then
N2=`expr $N2 + 5500`
fi
N2_trim=`echo "$N2" | sed -e 's/://g'`
if [ $N2_trim -le 200 ]; then
N2_trim=`expr $N2_trim + 5500`
fi
echo "$VNCVIEWERCMD" "$@" -listen $N2
trap "final" 0 2 15
echo ""
if [ "X$proxy" != "X" ]; then
if echo "$proxy" | grep -i '^vencrypt:' > /dev/null; then
pstunnel=`echo "$proxy" | awk -F: '{print $2}'`
...
...
@@ -2502,13 +3132,30 @@ else
PPROXY_DEST="$localhost:$pstunnel"; export PPROXY_DEST
STUNNEL_ONCE=1; export STUNNEL_ONCE
STUNNEL_MAX_CLIENTS=1; export STUNNEL_MAX_CLIENTS
if [ "X$NEED_VENCRYPT_VIEWER_BRIDGE" = "X1" -a "X$ptmp" != "X" ] ; then
port1=`expr 5500 + $N2`
port2=`findfree 5580`
N2=`expr $port2 - 5500`
N2_trim=`echo "$N2" | sed -e 's/://g'`
if [ $N2_trim -le 200 ]; then
N2_trim=`expr $N2_trim + 5500`
fi
env PPROXY_REMOVE=0 PPROXY_SLEEP=0 PPROXY_VENCRYPT_VIEWER_BRIDGE="-$port1,$port2" $ptmp &
sleep 1
fi
else
PPROXY_REVERSE="$localhost:$port"; export PPROXY_REVERSE
PPROXY_SLEEP=1; export PPROXY_SLEEP;
fi
PPROXY_KILLPID=+1; export PPROXY_KILLPID;
$ptmp &
# Important to have no extra pids generated between here and VNCVIEWERCMD
fi
if [ "X$VNCVIEWER_IS_REALVNC4" = "X1" ]; then
N2=$N2_trim
fi
echo "$VNCVIEWERCMD" "$@" -listen $N2
echo ""
$VNCVIEWERCMD "$@" -listen $N2
fi
...
...
x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl
View file @
a8453eea
This source diff could not be displayed because it is too large. You can
view the blob
instead.
x11vnc/misc/enhanced_tightvnc_viewer/man/man1/ssvncviewer.1
View file @
a8453eea
...
...
@@ -119,13 +119,13 @@ authentication.
TightVNC supports several different compression methods to encode
screen updates; this option specifies a set of them to use in order of
preference. Encodings are specified separated with spaces, and must
thus be enclosed in quotes if more than one is specified.
Available
encodings, in default order for a remote connection, are "copyrect
tight hextile zlib corre rre raw". For a local connection (to the same
machine), the default order to try is "raw copyrect tight hextile zlib
corre rre". Raw encoding is always assumed as a last option if no
other encoding can be used for some reason. For more information
on
encodings, see the section ENCODINGS below.
thus be enclosed in quotes if more than one is specified.
Commas may be used to avoid spaces.
Available encodings, in default order for a remote connection, are
"copyrect tight hextile zlib corre rre raw". For a local connection
(to the same machine), the default order to try is "raw copyrect tight
hextile zlib corre rre". Raw encoding is always assumed as a last option
if no other encoding can be used for some reason. For more informati
on
on
encodings, see the section ENCODINGS below.
.TP
\fB\-bgr233\fR
Always use the BGR233 format to encode pixel data. This reduces
...
...
@@ -312,6 +312,11 @@ Disable bell.
Prefer raw encoding for localhost, default is
no, i.e. assumes you have a SSH tunnel instead.
.TP
\fB\-notty\fR
Try to avoid using the terminal for interactive
responses: use windows for messages and prompting
instead. Messages will also be printed to terminal.
.TP
\fB\-sendclipboard\fR
Send the X CLIPBOARD selection (i.e. Ctrl+C,
Ctrl+V) instead of the X PRIMARY selection (mouse
...
...
@@ -530,7 +535,8 @@ Meta_R Super_L Super_R Hyper_L Hyper_R or Mode_switch.
Cursor Shape: ~ -nocursorshape
X11 Cursor: ~ -x11cursor
Cursor Alphablend: ~ -alpha
Toggle Tight/ZRLE: ~ -encodings ...
Toggle Tight/Hextile: ~ -encodings hextile...
Toggle Tight/ZRLE: ~ -encodings zrle...
Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
Quality Level ~ -quality (both Tight and ZYWRLE)
Compress Level ~ -compresslevel
...
...
x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
View file @
a8453eea
#!/bin/sh
rm
-rf
./src/tmp/
*
||
exit
1
vers
=
1.0.2
4
vers
=
1.0.2
5
cd
..
||
exit
1
...
...
x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch
View file @
a8453eea
...
...
@@ -664,7 +664,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/Vncviewer vnc_unixsrc/vncview
+
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/vncviewer/argsresources.c
--- vnc_unixsrc.orig/vncviewer/argsresources.c 2007-02-04 17:10:31.000000000 -0500
+++ vnc_unixsrc/vncviewer/argsresources.c 2009-10-
03 12:27:50
.000000000 -0400
+++ vnc_unixsrc/vncviewer/argsresources.c 2009-10-
26 23:26:12
.000000000 -0400
@@ -31,9 +31,9 @@
char *fallback_resources[] = {
...
...
@@ -739,12 +739,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
<ButtonPress>: SendRFBEvent()\\n\
<ButtonRelease>: SendRFBEvent()\\n\
<Motion>: SendRFBEvent()\\n\
@@ -58,23 +110,123 @@
@@ -55,26 +107,129 @@
"*serverDialog.dialog.label: VNC server:",
"*serverDialog.dialog.value:",
+ "*serverDialog.dialog.value.width: 150",
"*serverDialog.dialog.value.translations: #override\\n\
<Key>Return: ServerDialogDone()",
+ "*userDialog.dialog.label: Username:",
- "*passwordDialog.dialog.label: Password:",
+ "*userDialog.dialog.label: SSVNC: Enter Username",
+ "*userDialog.dialog.value:",
+ "*userDialog.dialog.value.width: 150",
+ "*userDialog.dialog.value.translations: #override\\n\
+ <Key>Return: UserDialogDone()",
+
...
...
@@ -817,8 +823,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ "*scaleNDialog.dialog.value.translations: #override\\n\
+ <KeyRelease>Return: ScaleNDialogDone()",
+
"*passwordDialog.dialog.label: Password:
",
+ "*passwordDialog.dialog.label: SSVNC: Enter Password
",
"*passwordDialog.dialog.value:",
+ "*passwordDialog.dialog.value.width: 150",
"*passwordDialog.dialog.value.AsciiSink.echo: False",
"*passwordDialog.dialog.value.translations: #override\\n\
<Key>Return: PasswordDialogDone()",
...
...
@@ -863,12 +870,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
<KeyPress>: SendRFBEvent() HidePopup()",
- "*popupButtonCount: 8",
+ "*popupButtonCount: 4
2
",
+ "*popupButtonBreak: 2
1
",
+ "*popupButtonCount: 4
4
",
+ "*popupButtonBreak: 2
2
",
"*popup*button1.label: Dismiss popup",
"*popup*button1.translations: #override\\n\
@@ -84,7 +23
6
,7 @@
@@ -84,7 +23
9
,7 @@
"*popup*button2.translations: #override\\n\
<Btn1Down>,<Btn1Up>: Quit()",
...
...
@@ -877,7 +884,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
"*popup*button3.type: toggle",
"*popup*button3.translations: #override\\n\
<Visible>: SetFullScreenState()\\n\
@@ -105,16 +2
57,418
@@
@@ -105,16 +2
60,426
@@
"*popup*button7.label: Send ctrl-alt-del",
"*popup*button7.translations: #override\\n\
<Btn1Down>,<Btn1Up>: SendRFBEvent(keydown,Control_L)\
...
...
@@ -930,156 +937,164 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ <Visible>: SetCursorAlphaState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleCursorAlpha() HidePopup()",
+
+ "*popup*button15.label: Toggle Tight/
ZRLE
",
+ "*popup*button15.label: Toggle Tight/
Hextile
",
+ "*popup*button15.type: toggle",
+ "*popup*button15.translations: #override\\n\
+ <Visible>: Set
ZRLE
State()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTight
ZRLE
() HidePopup()",
+ <Visible>: Set
Hextile
State()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTight
Hextile
() HidePopup()",
+
+ "*popup*button16.label: Toggle
ZRLE/ZYW
RLE",
+ "*popup*button16.label: Toggle
Tight/Z
RLE",
+ "*popup*button16.type: toggle",
+ "*popup*button16.translations: #override\\n\
+ <Visible>: SetZRLEState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTightZRLE() HidePopup()",
+
+ "*popup*button17.label: Toggle ZRLE/ZYWRLE",
+ "*popup*button17.type: toggle",
+ "*popup*button17.translations: #override\\n\
+ <Visible>: SetZYWRLEState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleZRLEZYWRLE() HidePopup()",
+
+ "*popup*button1
7
.label: Quality Level",
+ "*popup*button1
7
.translations: #override\\n\
+ "*popup*button1
8
.label: Quality Level",
+ "*popup*button1
8
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowQuality()",
+
+ "*popup*button1
8
.label: Compress Level",
+ "*popup*button1
8
.translations: #override\\n\
+ "*popup*button1
9
.label: Compress Level",
+ "*popup*button1
9
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowCompress()",
+
+ "*popup*button
19
.label: Disable JPEG",
+ "*popup*button
19
.type: toggle",
+ "*popup*button
19
.translations: #override\\n\
+ "*popup*button
20
.label: Disable JPEG",
+ "*popup*button
20
.type: toggle",
+ "*popup*button
20
.translations: #override\\n\
+ <Visible>: SetNOJPEGState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleJPEG() HidePopup()",
+
+ "*popup*button2
0
.label: TurboVNC Settings",
+ "*popup*button2
0
.translations: #override\\n\
+ "*popup*button2
1
.label: TurboVNC Settings",
+ "*popup*button2
1
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowTurboVNC()",
+
+ "*popup*button2
1
.label: Pipeline Updates",
+ "*popup*button2
1
.type: toggle",
+ "*popup*button2
1
.translations: #override\\n\
+ "*popup*button2
2
.label: Pipeline Updates",
+ "*popup*button2
2
.type: toggle",
+ "*popup*button2
2
.translations: #override\\n\
+ <Visible>: SetPipelineUpdates()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() TogglePipelineUpdates() HidePopup()",
+
+ "*popup*button2
2
.label: Full Color",
+ "*popup*button2
2
.type: toggle",
+ "*popup*button2
2
.translations: #override\\n\
+ "*popup*button2
3
.label: Full Color",
+ "*popup*button2
3
.type: toggle",
+ "*popup*button2
3
.translations: #override\\n\
+ <Visible>: SetFullColorState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleFullColor() HidePopup()",
+
+ "*popup*button2
3
.label: Grey Scale (16 & 8-bpp)",
+ "*popup*button2
3
.type: toggle",
+ "*popup*button2
3
.translations: #override\\n\
+ "*popup*button2
4
.label: Grey Scale (16 & 8-bpp)",
+ "*popup*button2
4
.type: toggle",
+ "*popup*button2
4
.translations: #override\\n\
+ <Visible>: SetGreyScaleState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleGreyScale() HidePopup()",
+
+ "*popup*button2
4
.label: 16 bit color (BGR565)",
+ "*popup*button2
4
.type: toggle",
+ "*popup*button2
4
.translations: #override\\n\
+ "*popup*button2
5
.label: 16 bit color (BGR565)",
+ "*popup*button2
5
.type: toggle",
+ "*popup*button2
5
.translations: #override\\n\
+ <Visible>: Set16bppState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle16bpp() HidePopup()",
+
+ "*popup*button2
5
.label: 8 bit color (BGR233)",
+ "*popup*button2
5
.type: toggle",
+ "*popup*button2
5
.translations: #override\\n\
+ "*popup*button2
6
.label: 8 bit color (BGR233)",
+ "*popup*button2
6
.type: toggle",
+ "*popup*button2
6
.translations: #override\\n\
+ <Visible>: Set8bppState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle8bpp() HidePopup()",
+
+ "*popup*button2
6
.label: - 256 colors",
+ "*popup*button2
6
.type: toggle",
+ "*popup*button2
6
.translations: #override\\n\
+ "*popup*button2
7
.label: - 256 colors",
+ "*popup*button2
7
.type: toggle",
+ "*popup*button2
7
.translations: #override\\n\
+ <Visible>: Set256ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle256Colors() HidePopup()",
+
+ "*popup*button2
7
.label: - 64 colors",
+ "*popup*button2
7
.type: toggle",
+ "*popup*button2
7
.translations: #override\\n\
+ "*popup*button2
8
.label: - 64 colors",
+ "*popup*button2
8
.type: toggle",
+ "*popup*button2
8
.translations: #override\\n\
+ <Visible>: Set64ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle64Colors() HidePopup()",
+
+ "*popup*button2
8
.label: - 8 colors",
+ "*popup*button2
8
.type: toggle",
+ "*popup*button2
8
.translations: #override\\n\
+ "*popup*button2
9
.label: - 8 colors",
+ "*popup*button2
9
.type: toggle",
+ "*popup*button2
9
.translations: #override\\n\
+ <Visible>: Set8ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle8Colors() HidePopup()",
+
+ "*popup*button
29
.label: Scale Viewer",
+ "*popup*button
29
.translations: #override\\n\
+ "*popup*button
30
.label: Scale Viewer",
+ "*popup*button
30
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetScale()",
+
+ "*popup*button3
0
.label: Escape Keys: Toggle",
+ "*popup*button3
0
.type: toggle",
+ "*popup*button3
0
.translations: #override\\n\
+ "*popup*button3
1
.label: Escape Keys: Toggle",
+ "*popup*button3
1
.type: toggle",
+ "*popup*button3
1
.translations: #override\\n\
+ <Visible>: SetEscapeKeysState()\\n\
+ <Btn1Down>, <Btn1Up>: toggle() ToggleEscapeActive() HidePopup()",
+
+ "*popup*button3
1
.label: Escape Keys: Help+Set",
+ "*popup*button3
1
.translations: #override\\n\
+ "*popup*button3
2
.label: Escape Keys: Help+Set",
+ "*popup*button3
2
.translations: #override\\n\
+ <Btn1Down>, <Btn1Up>: HidePopup() SetEscapeKeys()",
+
+ "*popup*button3
2
.label: Set Y Crop (y-max)",
+ "*popup*button3
2
.translations: #override\\n\
+ "*popup*button3
3
.label: Set Y Crop (y-max)",
+ "*popup*button3
3
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetYCrop()",
+
+ "*popup*button3
3
.label: Set Scrollbar Width",
+ "*popup*button3
3
.translations: #override\\n\
+ "*popup*button3
4
.label: Set Scrollbar Width",
+ "*popup*button3
4
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetScbar()",
+
+ "*popup*button3
4
.label: XGrabServer",
+ "*popup*button3
4
.type: toggle",
+ "*popup*button3
4
.translations: #override\\n\
+ "*popup*button3
5
.label: XGrabServer",
+ "*popup*button3
5
.type: toggle",
+ "*popup*button3
5
.translations: #override\\n\
+ <Visible>: SetXGrabState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleXGrab() HidePopup()",
+
+ "*popup*button3
5
.label: UltraVNC Extensions:",
+ "*popup*button3
5
.translations: #override\\n\
+ "*popup*button3
6
.label: UltraVNC Extensions:",
+ "*popup*button3
6
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup()",
+
+ "*popup*button3
6
.label: - Set 1/n Server Scale",
+ "*popup*button3
6
.translations: #override\\n\
+ "*popup*button3
7
.label: - Set 1/n Server Scale",
+ "*popup*button3
7
.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowScaleN()",
+
+ "*popup*button3
7
.label: - Text Chat",
+ "*popup*button3
7
.type: toggle",
+ "*popup*button3
7
.translations: #override\\n\
+ "*popup*button3
8
.label: - Text Chat",
+ "*popup*button3
8
.type: toggle",
+ "*popup*button3
8
.translations: #override\\n\
+ <Visible>: SetTextChatState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTextChat() HidePopup()",
+
+ "*popup*button3
8
.label: - File Transfer",
+ "*popup*button3
8
.type: toggle",
+ "*popup*button3
8
.translations: #override\\n\
+ "*popup*button3
9
.label: - File Transfer",
+ "*popup*button3
9
.type: toggle",
+ "*popup*button3
9
.translations: #override\\n\
+ <Visible>: SetFileXferState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleFileXfer() HidePopup()",
+
+ "*popup*button
39
.label: - Single Window",
+ "*popup*button
39
.type: toggle",
+ "*popup*button
39
.translations: #override\\n\
+ "*popup*button
40
.label: - Single Window",
+ "*popup*button
40
.type: toggle",
+ "*popup*button
40
.translations: #override\\n\
+ <Visible>: SetSingleWindowState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSingleWindow() HidePopup()",
+
+ "*popup*button4
0
.label: - Disable Remote Input",
+ "*popup*button4
0
.type: toggle",
+ "*popup*button4
0
.translations: #override\\n\
+ "*popup*button4
1
.label: - Disable Remote Input",
+ "*popup*button4
1
.type: toggle",
+ "*popup*button4
1
.translations: #override\\n\
+ <Visible>: SetServerInputState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleServerInput() HidePopup()",
+
+ "*popup*button4
1
.label: Send Clipboard not Primary",
+ "*popup*button4
1
.type: toggle",
+ "*popup*button4
1
.translations: #override\\n\
+ "*popup*button4
2
.label: Send Clipboard not Primary",
+ "*popup*button4
2
.type: toggle",
+ "*popup*button4
2
.translations: #override\\n\
+ <Visible>: SetSendClipboard()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSendClipboard() HidePopup()",
+
+ "*popup*button4
2
.label: Send Selection Every time",
+ "*popup*button4
2
.type: toggle",
+ "*popup*button4
2
.translations: #override\\n\
+ "*popup*button4
3
.label: Send Selection Every time",
+ "*popup*button4
3
.type: toggle",
+ "*popup*button4
3
.translations: #override\\n\
+ <Visible>: SetSendAlways()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSendAlways() HidePopup()",
+
+ "*popup*button44.label: ",
+
+ "*turboVNC*button0.label: Dismiss",
+ "*turboVNC*button0.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HideTurboVNC()",
...
...
@@ -1301,7 +1316,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
NULL
};
@@ -124,7 +6
78
,7 @@
@@ -124,7 +6
89
,7 @@
* from a dialog box.
*/
...
...
@@ -1310,7 +1325,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
int vncServerPort = 0;
@@ -135,6 +
689
,7 @@
@@ -135,6 +
700
,7 @@
*/
AppData appData;
...
...
@@ -1318,7 +1333,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
static XtResource appDataResourceList[] = {
{"shareDesktop", "ShareDesktop", XtRBool, sizeof(Bool),
@@ -155,14 +7
10
,44 @@
@@ -155,14 +7
21
,44 @@
{"userLogin", "UserLogin", XtRString, sizeof(String),
XtOffsetOf(AppData, userLogin), XtRImmediate, (XtPointer) 0},
...
...
@@ -1365,7 +1380,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"nColours", "NColours", XtRInt, sizeof(int),
XtOffsetOf(AppData, nColours), XtRImmediate, (XtPointer) 256},
@@ -179,9 +7
64
,12 @@
@@ -179,9 +7
75
,12 @@
{"requestedDepth", "RequestedDepth", XtRInt, sizeof(int),
XtOffsetOf(AppData, requestedDepth), XtRImmediate, (XtPointer) 0},
...
...
@@ -1379,7 +1394,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"wmDecorationWidth", "WmDecorationWidth", XtRInt, sizeof(int),
XtOffsetOf(AppData, wmDecorationWidth), XtRImmediate, (XtPointer) 4},
@@ -191,6 +7
79
,9 @@
@@ -191,6 +7
90
,9 @@
{"popupButtonCount", "PopupButtonCount", XtRInt, sizeof(int),
XtOffsetOf(AppData, popupButtonCount), XtRImmediate, (XtPointer) 0},
...
...
@@ -1389,7 +1404,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"debug", "Debug", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, debug), XtRImmediate, (XtPointer) False},
@@ -206,11 +
797
,13 @@
@@ -206,11 +
808
,13 @@
{"bumpScrollPixels", "BumpScrollPixels", XtRInt, sizeof(int),
XtOffsetOf(AppData, bumpScrollPixels), XtRImmediate, (XtPointer) 20},
...
...
@@ -1404,7 +1419,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"enableJPEG", "EnableJPEG", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, enableJPEG), XtRImmediate, (XtPointer) True},
@@ -218,14 +8
11,85
@@
@@ -218,14 +8
22,88
@@
{"useRemoteCursor", "UseRemoteCursor", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, useRemoteCursor), XtRImmediate, (XtPointer) True},
...
...
@@ -1413,6 +1428,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+
+ {"useRawLocal", "UseRawLocal", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, useRawLocal), XtRImmediate, (XtPointer) False},
+
+ {"notty", "NoTty", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, notty), XtRImmediate, (XtPointer) False},
+
{"useX11Cursor", "UseX11Cursor", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, useX11Cursor), XtRImmediate, (XtPointer) False},
...
...
@@ -1492,7 +1510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
};
@@ -242,8 +9
06,28
@@
@@ -242,8 +9
20,29
@@
{"-noraiseonbeep", "*raiseOnBeep", XrmoptionNoArg, "False"},
{"-passwd", "*passwordFile", XrmoptionSepArg, 0},
{"-user", "*userLogin", XrmoptionSepArg, 0},
...
...
@@ -1518,11 +1536,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"-env", "*envDummy", XrmoptionSepArg, 0},
+ {"-ycrop", "*yCrop", XrmoptionSepArg, 0},
+ {"-rawlocal", "*useRawLocal", XrmoptionNoArg, "True"},
+ {"-notty", "*notty", XrmoptionNoArg, "True"},
+ {"-alpha", "*useCursorAlpha", XrmoptionNoArg, "True"},
{"-owncmap", "*forceOwnCmap", XrmoptionNoArg, "True"},
{"-truecolor", "*forceTrueColour", XrmoptionNoArg, "True"},
{"-truecolour", "*forceTrueColour", XrmoptionNoArg, "True"},
@@ -253,8 +9
37
,27 @@
@@ -253,8 +9
52
,27 @@
{"-nojpeg", "*enableJPEG", XrmoptionNoArg, "False"},
{"-nocursorshape", "*useRemoteCursor", XrmoptionNoArg, "False"},
{"-x11cursor", "*useX11Cursor", XrmoptionNoArg, "True"},
...
...
@@ -1552,7 +1571,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
};
int numCmdLineOptions = XtNumber(cmdLineOptions);
@@ -267,16 +9
70,98
@@
@@ -267,16 +9
85,100
@@
static XtActionsRec actions[] = {
{"SendRFBEvent", SendRFBEvent},
{"ShowPopup", ShowPopup},
...
...
@@ -1589,6 +1608,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"Toggle8Colors", Toggle8Colors},
+ {"ToggleGreyScale", ToggleGreyScale},
+ {"ToggleTightZRLE", ToggleTightZRLE},
+ {"ToggleTightHextile", ToggleTightHextile},
+ {"ToggleZRLEZYWRLE", ToggleZRLEZYWRLE},
+ {"ToggleViewOnly", ToggleViewOnly},
+ {"ToggleJPEG", ToggleJPEG},
...
...
@@ -1625,6 +1645,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"Set8ColorsState", Set8ColorsState},
+ {"SetGreyScaleState", SetGreyScaleState},
+ {"SetZRLEState", SetZRLEState},
+ {"SetHextileState", SetHextileState},
+ {"SetZYWRLEState", SetZYWRLEState},
+ {"SetNOJPEGState", SetNOJPEGState},
+ {"SetScaleNState", SetScaleNState},
...
...
@@ -1651,7 +1672,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
};
@@ -302,11 +1
087
,14 @@
@@ -302,11 +1
104
,14 @@
void
usage(void)
{
...
...
@@ -1668,7 +1689,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
" %s [<OPTIONS>] -listen [<DISPLAY#>]\n"
" %s -help\n"
"\n"
@@ -332,10 +1120,349 @@
@@ -319,7 +1124,7 @@
" -noraiseonbeep\n"
" -passwd <PASSWD-FILENAME> (standard VNC authentication)\n"
" -user <USERNAME> (Unix login authentication)\n"
- " -encodings <ENCODING-LIST> (e.g. \"tight copyrect\")\n"
+ " -encodings <ENCODING-LIST> (e.g. \"tight,copyrect\")\n"
" -bgr233\n"
" -owncmap\n"
" -truecolour\n"
@@ -332,10 +1137,374 @@
" -autopass\n"
"\n"
"Option names may be abbreviated, e.g. -bgr instead of -bgr233.\n"
...
...
@@ -1782,6 +1812,30 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ " -rawlocal Prefer raw encoding for localhost, default is\n"
+ " no, i.e. assumes you have a SSH tunnel instead.\n"
+ "\n"
+ " -notty Try to avoid using the terminal for interactive\n"
+ " responses: use windows for messages and prompting\n"
+ " instead. Messages will also be printed to terminal.\n"
+ "\n"
+ " -sendclipboard Send the X CLIPBOARD selection (i.e. Ctrl+C,\n"
+ " Ctrl+V) instead of the X PRIMARY selection (mouse\n"
+ " select and middle button paste.)\n"
+ "\n"
+ " -sendalways Whenever the mouse enters the VNC viewer main\n"
+ " window, send the selection to the VNC server even if\n"
+ " it has not changed. This is like the Xt resource\n"
+ " translation SelectionToVNC(always)\n"
+ "\n"
+ " -recvtext str When cut text is received from the VNC server,\n"
+ " ssvncviewer will set both the X PRIMARY and the\n"
+ " X CLIPBOARD local selections. To control which\n"
+ " is set, specify 'str' as 'primary', 'clipboard',\n"
+ " or 'both' (the default.)\n"
+ "\n"
+ " -graball Grab the entire X server when in fullscreen mode,\n"
+ " needed by some old window managers like fvwm2.\n"
+ "\n"
+ " -popupfix Warp the popup back to the pointer position,\n"
+ " needed by some old window managers like fvwm2.\n"
+ " -sendclipboard Send the X CLIPBOARD selection (i.e. Ctrl+C,\n"
+ " Ctrl+V) instead of the X PRIMARY selection (mouse\n"
+ " select and middle button paste.)\n"
...
...
@@ -1974,7 +2028,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ " Cursor Shape: ~ -nocursorshape\n"
+ " X11 Cursor: ~ -x11cursor\n"
+ " Cursor Alphablend: ~ -alpha\n"
+ " Toggle Tight/ZRLE: ~ -encodings ...\n"
+ " Toggle Tight/Hextile: ~ -encodings hextile...\n"
+ " Toggle Tight/ZRLE: ~ -encodings zrle...\n"
+ " Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...\n"
+ " Quality Level ~ -quality (both Tight and ZYWRLE)\n"
+ " Compress Level ~ -compresslevel\n"
...
...
@@ -2020,7 +2075,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/*
@@ -347,73 +1
474,214
@@
@@ -347,73 +1
516,223
@@
void
GetArgsAndResources(int argc, char **argv)
{
...
...
@@ -2048,8 +2103,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ appData.useCursorAlpha = True;
+ }
+ if (getenv("VNCVIEWER_POPUP_FIX")) {
+ if (getenv("NOPOPUPFIX")) {
+ ;
+ } else if (!strcmp(getenv("VNCVIEWER_POPUP_FIX"), "0")) {
+ ;
+ } else {
+ appData.popupFix = True;
+ }
+ }
+ if (getenv("VNCVIEWER_GRAB_SERVER")) {
+ appData.grabAll = True;
+ }
...
...
@@ -2074,6 +2135,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ if (getenv("VNCVIEWER_RAWLOCAL")) {
+ appData.useRawLocal = True;
+ }
+ if (getenv("VNCVIEWER_NOTTY") || getenv("SSVNC_VNCVIEWER_NOTTY")) {
+ appData.notty = True;
+ }
+ if (getenv("VNCVIEWER_SBWIDTH")) {
+ int n = atoi(getenv("VNCVIEWER_SBWIDTH"));
+ if (n != 0) {
...
...
@@ -2231,7 +2295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+
+ if (argc == 1) {
+ vncServerName = DoServerDialog();
+ if (!
isatty(0
)) {
+ if (!
use_tty(
)) {
+ appData.passwordDialog = True;
+ }
+ } else if (argc != 2) {
...
...
@@ -2239,7 +2303,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ } else {
+ vncServerName = argv[1];
+
+ if (!
isatty(0
)) {
+ if (!
use_tty(
)) {
+ appData.passwordDialog = True;
+ }
+ if (vncServerName[0] == '-') {
...
...
@@ -3623,7 +3687,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/cursor.c vnc_unixsrc/vncviewe
-
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncviewer/desktop.c
--- vnc_unixsrc.orig/vncviewer/desktop.c 2004-05-28 13:29:29.000000000 -0400
+++ vnc_unixsrc/vncviewer/desktop.c 2009-
03-26 23:27:45
.000000000 -0400
+++ vnc_unixsrc/vncviewer/desktop.c 2009-
10-16 22:04:39
.000000000 -0400
@@ -28,28 +28,487 @@
#include <X11/extensions/XShm.h>
#endif
...
...
@@ -4215,8 +4279,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ }
+
+ create_image();
}
+
}
+
+static Widget scrollbar_y = NULL;
+
+static int xsst = 2;
...
...
@@ -4255,8 +4319,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ XtVaSetValues(w, XtNtopOfThumb, *(XtArgVal*)&t, XtNshown, *(XtArgVal*)&s, NULL);
+ }
+ }
+
}
+
}
+extern double dnow(void);
+
+void check_things() {
...
...
@@ -4519,18 +4583,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+#else
+#define nfix(i, n) ( i < 0 ? 0 : ( (i >= n) ? (n - 1) : i ) )
+#endif
- XChangeWindowAttributes(dpy, desktopWin, valuemask, &attr);
+
+int scale_round(int len, double fac) {
+ double eps = 0.000001;
+
- XChangeWindowAttributes(dpy, desktopWin, valuemask, &attr);
+ len = (int) (len * fac + eps);
+ if (len < 1) {
+ len = 1;
+ }
+ return len;
+
}
+
}
+static void scale_rect(double factor_x, double factor_y, int blend, int interpolate,
+ int *px, int *py, int *pw, int *ph, int solid) {
+
...
...
@@ -5058,8 +5122,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ markit:
+/* End taken from x11vnc scale: */
+ if (0) {}
}
+
}
+
+void do_scale_stats(int width, int height) {
+ static double calls = 0.0, sum = 0.0, var = 0.0, last = 0.0;
+ double A = width * height;
...
...
@@ -5237,6 +5301,13 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (y + height < si.framebufferHeight) height++;
+ }
+ }
+
+ if (x + width > si.framebufferWidth) {
+ width = si.framebufferWidth - x;
+ if (width <= 0) {
+ break;
+ }
+ }
- if (ev->xexpose.x + ev->xexpose.width > si.framebufferWidth) {
- ev->xexpose.width = si.framebufferWidth - ev->xexpose.x;
...
...
@@ -5251,13 +5322,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
- SendFramebufferUpdateRequest(ev->xexpose.x, ev->xexpose.y,
- ev->xexpose.width, ev->xexpose.height, False);
- break;
+ if (x + width > si.framebufferWidth) {
+ width = si.framebufferWidth - x;
+ if (width <= 0) {
+ break;
+ }
+ }
+
+ if (y + height > si.framebufferHeight) {
+ height = si.framebufferHeight - y;
+ if (height <= 0) {
...
...
@@ -5337,8 +5401,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ break;
}
+ check_things();
+
}
+
}
+extern Position desktopX, desktopY;
+
+void scroll_desktop(int horiz, int vert, double amount) {
...
...
@@ -5405,8 +5469,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ } else if (amount == -1.0) {
+ XSync(dpy, False);
+ }
}
+
}
+
+void scale_desktop(int bigger, double frac) {
+ double current, new;
+ char tmp[100];
...
...
@@ -5622,7 +5686,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
/*
* SendRFBEvent is an action which sends an RFB event. It can be used in two
@@ -201,127 +1948,32
2
@@
@@ -201,127 +1948,32
4
@@
* button2 down, 3 for both, etc).
*/
...
...
@@ -5719,7 +5783,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (!do_escape) {
+ escape_drag_in_progress = 0;
+ }
+
- if (appData.viewOnly) return;
+ if (do_escape) {
+ int W = si.framebufferWidth;
+ int H = si.framebufferHeight;
...
...
@@ -5779,6 +5844,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ ToggleX11Cursor(w, ev, params, num_params);
+ } else if (ks == XK_z || ks == XK_Z) {
+ ToggleTightZRLE(w, ev, params, num_params);
+ } else if (ks == XK_h || ks == XK_H) {
+ ToggleTightHextile(w, ev, params, num_params);
+ } else if (ks == XK_f || ks == XK_F) {
+ ToggleFileXfer(w, ev, params, num_params);
+ } else if (ks == XK_V) {
...
...
@@ -5840,8 +5907,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (appData.viewOnly) {
+ return;
+ }
- if (appData.viewOnly) return;
+
+ if (*num_params != 0) {
+ if (strncasecmp(params[0],"key",3) == 0) {
+ if (*num_params != 2) {
...
...
@@ -6005,11 +6071,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ XLookupString(&ev->xkey, keyname, 256, &ks, NULL);
- switch (ev->type) {
+ if (IsModifierKey(ks)) {
+ ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
+ modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
+ }
-
- case MotionNotify:
- while (XCheckTypedWindowEvent(dpy, desktopWin, MotionNotify, ev))
- ; /* discard all queued motion notify events */
...
...
@@ -6038,12 +6100,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
- ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
- modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
- }
+ SendKeyEvent(ks, (ev->type == KeyPress));
+ return;
+ if (IsModifierKey(ks)) {
+ ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
+ modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
+ }
- SendKeyEvent(ks, (ev->type == KeyPress));
- return;
-
+ SendKeyEvent(ks, (ev->type == KeyPress));
+ return;
- default:
- fprintf(stderr,"Invalid event passed to SendRFBEvent\n");
- }
...
...
@@ -6053,7 +6119,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
}
@@ -329,26 +227
1,194
@@
@@ -329,26 +227
3,207
@@
* CreateDotCursor.
*/
...
...
@@ -6120,7 +6186,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ cursor = XCreatePixmapCursor(dpy, src, msk, &fg, &bg, 1, 1);
+ XFreePixmap(dpy, src);
+ XFreePixmap(dpy, msk);
+
- return cursor;
+ return cursor;
+}
+#endif
...
...
@@ -6128,7 +6195,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+int skip_maybe_sync = 0;
+void maybe_sync(int width, int height) {
+ static int singles = 0, always_skip = -1;
+ int singles_max =
32
;
+ int singles_max =
64
;
+
+ if (always_skip < 0) {
+ if (getenv("SSVNC_NO_MAYBE_SYNC")) {
...
...
@@ -6140,6 +6207,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (skip_maybe_sync || always_skip) {
+ return;
+ }
+#if 0
+ if (width > 1 || height > 1) {
+ XSync(dpy, False);
+ singles = 0;
...
...
@@ -6149,6 +6217,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ XSync(dpy, False);
+ }
+ }
+#else
+ if (width * height >= singles_max) {
+ XSync(dpy, False);
+ singles = 0;
+ } else {
+ singles += width * height;
+ if (singles >= singles_max) {
+ XSync(dpy, False);
+ singles = 0;
+ }
+ }
+#endif
+}
+/*
+ * FillImage.
...
...
@@ -6244,8 +6324,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ dst -= Bpl;
+ }
+ }
- return cursor;
+
+ if (image_scale && !did2) {
+ im = image;
+ Bpp = im->bits_per_pixel / 8;
...
...
@@ -6264,7 +6343,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
}
@@ -359,38 +24
69
,37 @@
@@ -359,38 +24
84
,37 @@
void
CopyDataToScreen(char *buf, int x, int y, int width, int height)
{
...
...
@@ -6332,7 +6411,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
}
@@ -401,62 +25
10
,297 @@
@@ -401,62 +25
25
,297 @@
static void
CopyBGR233ToScreen(CARD8 *buf, int x, int y, int width, int height)
{
...
...
@@ -6686,8 +6765,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncviewer/dialogs.c
--- vnc_unixsrc.orig/vncviewer/dialogs.c 2000-10-26 15:19:19.000000000 -0400
+++ vnc_unixsrc/vncviewer/dialogs.c 2009-
04-15 14:12:13
.000000000 -0400
@@ -25,7
+25,395
@@
+++ vnc_unixsrc/vncviewer/dialogs.c 2009-
10-27 00:14:05
.000000000 -0400
@@ -25,7
5 +25,549
@@
#include <X11/Xaw/Dialog.h>
static Bool serverDialogDone = False;
...
...
@@ -6703,6 +6782,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+extern void popupFixer(Widget wid);
+
+int use_tty(void) {
+ if (appData.notty) {
+ return 0;
+ } else if (!isatty(0)) {
+ return 0;
+ }
+ return 1;
+}
+
+void
+ScaleDialogDone(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
...
...
@@ -6758,6 +6846,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ }
+}
+
+static void xtmove(Widget w) {
+ XtMoveWidget(w, WidthOfScreen(XtScreen(w))*2/5, HeightOfScreen(XtScreen(w))*2/5);
+}
+
+char *
+DoScaleDialog()
+{
...
...
@@ -6771,8 +6863,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if (0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
...
...
@@ -6787,8 +6878,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ }
+
+
+ if (appData.popupFix) {
+ if (
1 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "ScaleDialogDone()");
...
...
@@ -6821,8 +6914,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
...
...
@@ -6838,6 +6930,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ if (appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ /* too big */
+ if (0) xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "EscapeDialogDone()");
...
...
@@ -6875,13 +6970,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+
if (
appData.popupFix) {
+
if (1 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "YCropDialogDone()");
...
...
@@ -6919,13 +7015,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+
if (
appData.popupFix) {
+
if (1 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "ScbarDialogDone()");
...
...
@@ -6964,13 +7061,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ dialog_over(pshell);
+ wm_delete(pshell, "ScaleNDialogDone()");
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+ if (appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "ScaleNDialogDone()");
...
...
@@ -7008,13 +7106,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+
if (
appData.popupFix) {
+
if (1 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "QualityDialogDone() HideQuality()");
...
...
@@ -7046,7 +7145,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ char *compressValue;
+ char *valueString;
+
+fprintf(stderr, "compress start:\n");
+
fprintf(stderr, "compress start:\n");
+
+ pshell = XtVaCreatePopupShell("compressDialog", transientShellWidgetClass,
+ toplevel, NULL);
...
...
@@ -7054,13 +7153,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+
if (
appData.popupFix) {
+
if (1 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ dialog_input(pshell);
+ wm_delete(pshell, "CompressDialogDone() HideCompress()");
...
...
@@ -7075,7 +7175,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ rmNL(valueString);
+ compressValue = XtNewString(valueString);
+
+fprintf(stderr, "compress done: %s\n", compressValue);
+
fprintf(stderr, "compress done: %s\n", compressValue);
+
+ XtPopdown(pshell);
+ return compressValue;
...
...
@@ -7083,43 +7183,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
void
ServerDialogDone(Widget w, XEvent *event, String *params, Cardinal *num_params)
@@ -44,11 +432,19 @@
{
- serverDialogDone = True;
+ serverDialogDone = True;
}
char *
DoServerDialog()
{
- Widget pshell, dialog;
- char *vncServerName;
- char *valueString;
+ Widget pshell, dialog;
+ char *vncServerName;
+ char *valueString;
- pshell = XtVaCreatePopupShell("serverDialog", transientShellWidgetClass,
+ pshell = XtVaCreatePopupShell("serverDialog", transientShellWidgetClass,
toplevel, NULL);
dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
- dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
+ dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
- XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
- HeightOfScreen(XtScreen(pshell))*2/5);
- XtPopup(pshell, XtGrabNonexclusive);
- XtRealizeWidget(pshell);
+ dialog_over(pshell);
+
XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
HeightOfScreen(XtScreen(pshell))*2/5);
XtPopup(pshell, XtGrabNonexclusive);
XtRealizeWidget(pshell);
+ if (appData.popupFix) {
- serverDialogDone = False;
+ if (0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+ if (0 && appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ //dialog_input(pshell);
+ wm_delete(pshell, "ServerDialogDone()");
+
serverDialogDone = False;
while (!serverDialogDone) {
@@ -56,6 +452,7 @@
}
valueString = XawDialogGetValueString(dialog);
+
serverDialogDone = False;
+
+
while (!serverDialogDone) {
+ XtAppProcessEvent(appContext, XtIMAll);
+
}
+
+
valueString = XawDialogGetValueString(dialog);
+ rmNL(valueString);
vncServerName = XtNewString(valueString);
+
vncServerName = XtNewString(valueString);
XtPopdown(pshell);
@@ -63,6 +460,50 @@
}
- while (!serverDialogDone) {
- XtAppProcessEvent(appContext, XtIMAll);
- }
+ XtPopdown(pshell);
+ return vncServerName;
+}
void
- valueString = XawDialogGetValueString(dialog);
- vncServerName = XtNewString(valueString);
+void
+UserDialogDone(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ userDialogDone = True;
+}
+
- XtPopdown(pshell);
- return vncServerName;
+char *
+DoUserDialog()
+{
...
...
@@ -7133,13 +7263,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ dialog_over(pshell);
+
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+
if (
appData.popupFix) {
+
if (0 &&
appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ //dialog_input(pshell);
+ wm_delete(pshell, "UserDialogDone()");
...
...
@@ -7156,40 +7287,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+
+ XtPopdown(pshell);
+ return userName;
+
}
+
+
void
}
void
PasswordDialogDone(Widget w, XEvent *event, String *params,
Cardinal *num_params)
{
@@ -80,11 +521,19 @@
- passwordDialogDone = True;
+ passwordDialogDone = True;
}
char *
DoPasswordDialog()
{
- Widget pshell, dialog;
- char *password;
- char *valueString;
+ Widget pshell, dialog;
+ char *password;
+ char *valueString;
- pshell = XtVaCreatePopupShell("passwordDialog", transientShellWidgetClass,
+ pshell = XtVaCreatePopupShell("passwordDialog", transientShellWidgetClass,
toplevel, NULL);
dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
- dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
-
- XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
- HeightOfScreen(XtScreen(pshell))*2/5);
- XtPopup(pshell, XtGrabNonexclusive);
- XtRealizeWidget(pshell);
-
- passwordDialogDone = False;
+ dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass, pshell, NULL);
- while (!passwordDialogDone) {
- XtAppProcessEvent(appContext, XtIMAll);
- }
+ dialog_over(pshell);
+
XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5,
HeightOfScreen(XtScreen(pshell))*2/5);
XtPopup(pshell, XtGrabNonexclusive);
XtRealizeWidget(pshell);
+ if (appData.popupFix) {
- valueString = XawDialogGetValueString(dialog);
- password = XtNewString(valueString);
+ if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell);
+
+ if (0 && appData.popupFix) {
+ popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ }
+ //dialog_input(pshell);
+ wm_delete(pshell, "PasswordDialogDone()");
+
passwordDialogDone = False;
while (!passwordDialogDone) {
@@ -92,6 +541,7 @@
}
valueString = XawDialogGetValueString(dialog);
+
passwordDialogDone = False;
+
+
while (!passwordDialogDone) {
+ XtAppProcessEvent(appContext, XtIMAll);
+
}
+
+
valueString = XawDialogGetValueString(dialog);
+ rmNL(valueString);
password = XtNewString(valueString);
+
password = XtNewString(valueString);
XtPopdown(pshell);
- XtPopdown(pshell);
- return password;
+ XtPopdown(pshell);
+ return password;
}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/fullscreen.c vnc_unixsrc/vncviewer/fullscreen.c
--- vnc_unixsrc.orig/vncviewer/fullscreen.c 2003-10-09 05:23:49.000000000 -0400
+++ vnc_unixsrc/vncviewer/fullscreen.c 2008-10-25 18:22:14.000000000 -0400
...
...
@@ -8217,8 +8381,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/h2html.pl vnc_unixsrc/vncview
+}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncviewer/hextile.c
--- vnc_unixsrc.orig/vncviewer/hextile.c 2007-02-17 22:33:46.000000000 -0500
+++ vnc_unixsrc/vncviewer/hextile.c 200
8-10-05 15:16:24
.000000000 -0400
@@ -30,6 +30,
18
@@
+++ vnc_unixsrc/vncviewer/hextile.c 200
9-10-16 22:54:40
.000000000 -0400
@@ -30,6 +30,
21
@@
#define CARDBPP CONCAT2E(CARD,BPP)
#define GET_PIXEL CONCAT2E(GET_PIXEL,BPP)
...
...
@@ -8233,11 +8397,62 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
+ XFillRectangle(dpy, desktopWin, gc, x, y, w, h); \
+ } \
+ }
+
+extern int skip_maybe_sync;
+extern void maybe_sync(int w, int h);
+
static Bool
HandleHextileBPP (int rx, int ry, int rw, int rh)
{
@@ -66,14 +78,25 @@
@@ -41,21 +56,43 @@
int sx, sy, sw, sh;
CARD8 subencoding;
CARD8 nSubrects;
+ int irect = 0, nrects = (rw * rh) / (16 * 16);
+ static int nosync_ycrop = -1;
+
+ if (nosync_ycrop < 0) {
+ nosync_ycrop = 0;
+ if (getenv("HEXTILE_YCROP_TOO")) {
+ nosync_ycrop = 1;
+ }
+ }
for (y = ry; y < ry+rh; y += 16) {
for (x = rx; x < rx+rw; x += 16) {
w = h = 16;
- if (rx+rw - x < 16)
+ if (rx+rw - x < 16) {
w = rx+rw - x;
- if (ry+rh - y < 16)
+ }
+ if (ry+rh - y < 16) {
h = ry+rh - y;
+ }
+
+ if (nrects > 400 && (appData.yCrop == 0 || nosync_ycrop)) {
+ skip_maybe_sync = 0;
+ if (irect++ % 2000 != 0) {
+ if (x < rx+rw-16 || y < ry+rh-16) {
+ skip_maybe_sync = 1;
+ }
+ }
+ }
- if (!ReadFromRFBServer((char *)&subencoding, 1))
+ if (!ReadFromRFBServer((char *)&subencoding, 1)) {
return False;
+ }
if (subencoding & rfbHextileRaw) {
- if (!ReadFromRFBServer(buffer, w * h * (BPP / 8)))
+ if (!ReadFromRFBServer(buffer, w * h * (BPP / 8))) {
return False;
+ }
CopyDataToScreen(buffer, x, y, w, h);
continue;
@@ -66,14 +103,25 @@
return False;
#if (BPP == 8)
...
...
@@ -8246,12 +8461,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
gcv.foreground = BGR233ToPixel[bg];
- else
+ } else
#endif
+
#endif
+#if (BPP == 16)
+ if (appData.useBGR565) {
+ gcv.foreground = BGR565ToPixel[bg];
+ } else
+
#endif
#endif
+ {
gcv.foreground = bg;
+ }
...
...
@@ -8267,7 +8482,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
if (subencoding & rfbHextileForegroundSpecified)
if (!ReadFromRFBServer((char *)&fg, sizeof(fg)))
@@ -101,14 +1
24
,25 @@
@@ -101,14 +1
49
,25 @@
sh = rfbHextileExtractH(*ptr);
ptr++;
#if (BPP == 8)
...
...
@@ -8276,12 +8491,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
gcv.foreground = BGR233ToPixel[fg];
- else
+ } else
+
#endif
#endif
+#if (BPP == 16)
+ if (appData.useBGR565) {
+ gcv.foreground = BGR565ToPixel[fg];
+ } else
#endif
+
#endif
+ {
gcv.foreground = fg;
+ }
...
...
@@ -8297,7 +8512,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
}
} else {
@@ -116,13 +1
50
,22 @@
@@ -116,13 +1
75
,22 @@
return False;
#if (BPP == 8)
...
...
@@ -8322,7 +8537,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
for (i = 0; i < nSubrects; i++) {
sx = rfbHextileExtractX(*ptr);
@@ -131,7 +1
74
,11 @@
@@ -131,7 +1
99
,11 @@
sw = rfbHextileExtractW(*ptr);
sh = rfbHextileExtractH(*ptr);
ptr++;
...
...
@@ -8334,7 +8549,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
}
}
}
@@ -139,3 +
186
,5 @@
@@ -139,3 +
211
,5 @@
return True;
}
...
...
@@ -8342,7 +8557,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
+#undef FillRectangle
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewer/listen.c
--- vnc_unixsrc.orig/vncviewer/listen.c 2001-01-16 03:07:57.000000000 -0500
+++ vnc_unixsrc/vncviewer/listen.c 2009-
07-28 21:44:32
.000000000 -0400
+++ vnc_unixsrc/vncviewer/listen.c 2009-
10-23 11:48:38
.000000000 -0400
@@ -32,6 +32,7 @@
#define FLASHDELAY 1 /* seconds */
...
...
@@ -8351,10 +8566,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
int listenPort = 0, flashPort = 0;
static Font flashFont;
@@ -40,6 +41,7
5
@@
@@ -40,6 +41,7
7
@@
static void flashDisplay(Display *d, char *user);
static Bool AllXEventsPredicate(Display *d, XEvent *ev, char *arg);
+void raiseme(int force);
+
+static int accept_popup_check(int *argc, char **argv, char *sip, char *sih) {
+ char line[16];
...
...
@@ -8365,7 +8581,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
+ return 1;
+ }
+
+ if (!dopopup) {
+ if (!dopopup && use_tty()) {
+ raiseme(1);
+ fprintf(stderr, "Accept VNC connection? y/[n] ");
+ fgets(line, sizeof(line), stdin);
+ if (!strchr(line, 'y') && !strchr(line, 'Y')) {
...
...
@@ -8427,7 +8644,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
/*
* listenForIncomingConnections() - listen for incoming connections from
* servers, and fork a new process to deal with each connection. We must do
@@ -58,8 +1
28
,11 @@
@@ -58,8 +1
30
,11 @@
int n;
int i;
char *displayname = NULL;
...
...
@@ -8439,7 +8656,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
for (i = 1; i < *argc; i++) {
if (strcmp(argv[i], "-display") == 0 && i+1 < *argc) {
@@ -108,23 +18
1
,40 @@
@@ -108,23 +18
3
,40 @@
exit(1);
}
...
...
@@ -8486,7 +8703,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
/* discard any X events */
while (XCheckIfEvent(d, &ev, AllXEventsPredicate, NULL))
@@ -132,12 +22
2
,24 @@
@@ -132,12 +22
4
,24 @@
FD_ZERO(&fds);
...
...
@@ -8512,7 +8729,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
if (FD_ISSET(flashSocket, &fds)) {
sock = AcceptTcpConnection(flashSocket);
@@ -151,11 +25
3
,66 @@
@@ -151,11 +25
5
,66 @@
}
close(sock);
}
...
...
@@ -8582,7 +8799,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
XCloseDisplay(d);
@@ -170,18 +32
7
,28 @@
@@ -170,18 +32
9
,28 @@
case 0:
/* child - return to caller */
close(listenSocket);
...
...
@@ -8613,7 +8830,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
break;
}
}
@@ -200,6 +36
7
,13 @@
@@ -200,6 +36
9
,13 @@
char **fontNames;
int nFontNames;
...
...
@@ -8627,7 +8844,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
sprintf(fontName,"-*-courier-bold-r-*-*-%d-*-*-*-*-*-iso8859-1",
FLASHWIDTH);
fontNames = XListFonts(d, fontName, 1, &nFontNames);
@@ -209,6 +38
3
,9 @@
@@ -209,6 +38
5
,9 @@
sprintf(fontName,"fixed");
}
flashFont = XLoadFont(d, fontName);
...
...
@@ -8637,7 +8854,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
}
@@ -222,6 +
399
,11 @@
@@ -222,6 +
401
,11 @@
Window w1, w2, w3, w4;
XSetWindowAttributes attr;
...
...
@@ -8649,7 +8866,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
XBell(d, 0);
XForceScreenSaver(d, ScreenSaverReset);
@@ -284,6 +46
6
,9 @@
@@ -284,6 +46
8
,9 @@
XDestroyWindow(d, w3);
XDestroyWindow(d, w4);
XFlush(d);
...
...
@@ -9056,7 +9273,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/misc.c vnc_unixsrc/vncviewer/
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer/popup.c
--- vnc_unixsrc.orig/vncviewer/popup.c 2000-06-11 08:00:53.000000000 -0400
+++ vnc_unixsrc/vncviewer/popup.c 2009-
07-29 20:05
:17.000000000 -0400
+++ vnc_unixsrc/vncviewer/popup.c 2009-
10-27 00:14
:17.000000000 -0400
@@ -25,22 +25,59 @@
#include <X11/Xaw/Form.h>
...
...
@@ -9123,7 +9340,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
}
@@ -52,42 +89,78
9
@@
@@ -52,42 +89,78
6
@@
};
void
...
...
@@ -9180,7 +9397,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{
+ if (appData.popupFix) {
+ popupFixer(scaleN);
+
+ } else {
+ XtMoveWidget(scaleN, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(scaleN, XtGrabNone);
...
...
@@ -9372,7 +9588,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{
+ if (appData.popupFix) {
+ popupFixer(qualityW);
+
+ } else {
+ XtMoveWidget(qualityW, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(qualityW, XtGrabNone);
...
...
@@ -9430,7 +9645,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{
+ if (appData.popupFix) {
+ popupFixer(compressW);
+
+ } else {
+ XtMoveWidget(compressW, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(compressW, XtGrabNone);
...
...
@@ -9956,7 +10170,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup_ad vnc_unixsrc/vncviewe
+}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncviewer/rfbproto.c
--- vnc_unixsrc.orig/vncviewer/rfbproto.c 2008-09-05 19:51:24.000000000 -0400
+++ vnc_unixsrc/vncviewer/rfbproto.c 2009-1
0-03 12:28:22.000000000 -04
00
+++ vnc_unixsrc/vncviewer/rfbproto.c 2009-1
1-02 10:02:00.000000000 -05
00
@@ -23,6 +23,7 @@
* rfbproto.c - functions to deal with client side of RFB protocol.
*/
...
...
@@ -10020,7 +10234,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
static void ReadConnFailedReason(void);
static long ReadCompactLen (void);
@@ -67,6 +109,2
0
@@
@@ -67,6 +109,2
2
@@
static void JpegSetSrcManager(j_decompress_ptr cinfo, CARD8 *compressedData,
int compressedLen);
...
...
@@ -10038,10 +10252,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+static double dt_out_sc = 0.0;
+double latency = 0.0;
+double connect_time = 0.0;
+
+void raiseme(int force);
int rfbsock;
char *desktopName;
@@ -75,6 +13
1
,14 @@
@@ -75,6 +13
3
,14 @@
char *serverCutText = NULL;
Bool newServerCutText = False;
...
...
@@ -10056,7 +10272,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
int endianTest = 1;
static Bool tightVncProtocol = False;
@@ -177,8 +24
1
,26 @@
@@ -177,8 +24
3
,26 @@
sig_rfbEncodingPointerPos, "Pointer position update");
CapsAdd(encodingCaps, rfbEncodingLastRect, rfbTightVncVendor,
sig_rfbEncodingLastRect, "LastRect protocol extension");
...
...
@@ -10076,14 +10292,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+
+static void wmsg(char *msg, int wait) {
+ fprintf(stderr, "%s", msg);
+ if (!
isatty(0
) && !getenv("SSVNC_NO_MESSAGE_POPUP")) {
+ if (!
use_tty(
) && !getenv("SSVNC_NO_MESSAGE_POPUP")) {
+ CreateMsg(msg, wait);
+ }
+}
/*
* ConnectToRFBServer.
@@ -187,24 +2
69
,167 @@
@@ -187,24 +2
71
,167 @@
Bool
ConnectToRFBServer(const char *hostname, int port)
{
...
...
@@ -10263,7 +10479,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/*
* InitialiseRFBConnection.
*/
@@ -212,211 +43
7
,620 @@
@@ -212,211 +43
9
,620 @@
Bool
InitialiseRFBConnection(void)
{
...
...
@@ -10748,7 +10964,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+
+ switch (secType) {
+ case rfbSecTypeNone:
+ fprintf(stderr, "No authentication needed\n");
+ fprintf(stderr, "No
VNC
authentication needed\n");
+ if (viewer_minor == 8) {
+ CARD32 authResult;
+
...
...
@@ -11039,7 +11255,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -451,6 +108
5
,9 @@
@@ -451,6 +108
7
,9 @@
return True;
}
...
...
@@ -11049,7 +11265,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/*
* Negotiate authentication scheme (protocol version 3.7t)
@@ -459,58 +109
6,384
@@
@@ -459,58 +109
8,388
@@
static Bool
PerformAuthenticationTight(void)
{
...
...
@@ -11079,7 +11295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- return True;
- }
+ if (!caps.nAuthTypes) {
+ fprintf(stderr, "No authentication needed\n\n");
+ fprintf(stderr, "No
VNC
authentication needed\n\n");
+ return True;
+ }
...
...
@@ -11145,14 +11361,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return False;
+ }
+ }
- fprintf(stderr, "No suitable authentication schemes offered by server\n");
- return False;
+
+ sprintf(msgbuf, "No suitable authentication schemes offered by server\n");
+ wmsg(msgbuf, 1);
+ return False;
}
+
}
+
+#if 0
+unsigned char encPasswd[8];
+unsigned char encPasswd_MSLOGON[32];
...
...
@@ -11164,6 +11378,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ /* code from the old uvnc way (1.0.2?) that would go into AuthenticateVNC() template */
+
+ if (appData.msLogon != NULL) {
+ raiseme(1);
+ if (!strcmp(appData.msLogon, "1")) {
+ char tmp[256];
+ fprintf(stderr, "\nUltraVNC MS Logon Username[@Domain]: ");
...
...
@@ -11235,14 +11450,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+static unsigned long long bytes_to_uint64(char *bytes) {
+ unsigned long long result = 0;
+ int i;
+
- fprintf(stderr, "No suitable authentication schemes offered by server\n");
- return False;
+ for (i=0; i < 8; i++) {
+ result <<= 8;
+ result += (unsigned char) bytes[i];
+ }
+ return result;
+
}
+
}
+static void uint64_to_bytes(unsigned long long n, char *bytes) {
+ int i;
+
...
...
@@ -11381,10 +11598,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+
+ if (appData.msLogon == NULL || !strcmp(appData.msLogon, "1")) {
+ char tmp[256], *q, *s;
+
fprintf(stderr, "\nUltraVNC MS-Logon Username[@Domain]: ");
+
if (!isatty(0)) {
+
if (!use_tty()) {
+
fprintf(stderr, "\nEnter UltraVNC MS-Logon Username[@Domain] in the popup.\n");
+ s = DoUserDialog();
+ } else {
+ raiseme(1);
+ fprintf(stderr, "\nUltraVNC MS-Logon Username[@Domain]: ");
+ if (fgets(tmp, 256, stdin) == NULL) {
+ exit(1);
+ }
...
...
@@ -11395,9 +11614,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ appData.msLogon = strdup(s);
+ }
+
+ if (!
isatty(0
)) {
+ if (!
use_tty(
)) {
+ gpw = DoPasswordDialog();
+ } else {
+ raiseme(1);
+ gpw = getpass("UltraVNC MS-Logon Password: ");
+ }
+ if (! gpw) {
...
...
@@ -11476,7 +11696,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/*
* Standard VNC authentication.
@@ -519,80 +148
2,113
@@
@@ -519,80 +148
8,115
@@
static Bool
AuthenticateVNC(void)
{
...
...
@@ -11516,6 +11736,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ }
+ } else if (appData.autoPass) {
+ passwd = buffer;
+ raiseme(1);
+ cstatus = fgets(buffer, sizeof buffer, stdin);
+ if (cstatus == NULL) {
+ buffer[0] = '\0';
...
...
@@ -11527,9 +11748,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ }
+ } else if (getenv("VNCVIEWER_PASSWORD")) {
+ passwd = strdup(getenv("VNCVIEWER_PASSWORD"));
+ } else if (appData.passwordDialog) {
+ } else if (appData.passwordDialog
|| !use_tty()
) {
+ passwd = DoPasswordDialog();
+ } else {
+ raiseme(1);
+ passwd = getpass("VNC Password: ");
+ }
...
...
@@ -11653,7 +11875,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
/*
@@ -602,68 +1
598,74
@@
@@ -602,68 +1
606,75
@@
static Bool
AuthenticateUnixLogin(void)
{
...
...
@@ -11696,9 +11918,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- fprintf(stderr, "Reading password failed\n");
- return False;
- }
+ if (appData.passwordDialog) {
+ if (appData.passwordDialog
|| !use_tty()
) {
+ passwd = DoPasswordDialog();
+ } else {
+ raiseme(1);
+ passwd = getpass("VNC Password: ");
+ }
+ if (!passwd || strlen(passwd) == 0) {
...
...
@@ -11780,7 +12003,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -675,19 +16
77
,20 @@
@@ -675,19 +16
86
,20 @@
static Bool
ReadInteractionCaps(void)
{
...
...
@@ -11813,7 +12036,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -700,19 +17
03
,67 @@
@@ -700,19 +17
12
,67 @@
static Bool
ReadCapabilityList(CapsContainer *caps, int count)
{
...
...
@@ -11890,7 +12113,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/*
* SetFormatAndEncodings.
@@ -729,6 +178
0
,17 @@
@@ -729,6 +178
9
,17 @@
Bool requestCompressLevel = False;
Bool requestQualityLevel = False;
Bool requestLastRectEncoding = False;
...
...
@@ -11908,7 +12131,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
spf.type = rfbSetPixelFormat;
spf.format = myFormat;
@@ -736,1
2 +1798,18
@@
@@ -736,1
5 +1807,32
@@
spf.format.greenMax = Swap16IfLE(spf.format.greenMax);
spf.format.blueMax = Swap16IfLE(spf.format.blueMax);
...
...
@@ -11927,7 +12150,21 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
if (appData.encodingsString) {
char *encStr = appData.encodingsString;
int encStrLen;
@@ -754,50 +1822,102 @@
+ if (strchr(encStr, ',')) {
+ char *p;
+ encStr = strdup(encStr);
+ p = encStr;
+ while (*p != '\0') {
+ if (*p == ',') {
+ *p = ' ';
+ }
+ p++;
+ }
+ }
do {
char *nextEncStr = strchr(encStr, ' ');
if (nextEncStr) {
@@ -754,50 +1842,102 @@
encStrLen = strlen(encStr);
}
...
...
@@ -12046,7 +12283,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRichCursor);
if (se->nEncodings < MAX_ENCODINGS)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingPointerPos);
@@ -806,10 +19
2
6,16 @@
@@ -806,10 +19
4
6,16 @@
if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect);
}
...
...
@@ -12066,7 +12303,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
fprintf(stderr,"Same machine: preferring raw encoding\n");
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw);
} else {
@@ -818,44 +19
4
4,84 @@
@@ -818,44 +19
6
4,84 @@
}
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCopyRect);
...
...
@@ -12173,7 +12410,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
return True;
}
@@ -868,31 +20
3
4,86 @@
@@ -868,31 +20
5
4,86 @@
Bool
SendIncrementalFramebufferUpdateRequest()
{
...
...
@@ -12273,7 +12510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -903,19 +21
2
4,36 @@
@@ -903,19 +21
4
4,36 @@
Bool
SendPointerEvent(int x, int y, int buttonMask)
{
...
...
@@ -12322,7 +12559,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -926,12 +21
6
4,20 @@
@@ -926,12 +21
8
4,20 @@
Bool
SendKeyEvent(CARD32 key, Bool down)
{
...
...
@@ -12348,7 +12585,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -942,281 +2
18
8,1024 @@
@@ -942,281 +2
20
8,1024 @@
Bool
SendClientCutText(char *str, int len)
{
...
...
@@ -13595,7 +13832,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#ifdef MITSHM
/* if using shared memory PutImage, make sure that the X server has
@@ -1224,59 +32
1
3,168 @@
@@ -1224,59 +32
3
3,168 @@
mainly to avoid copyrect using invalid screen contents - not sure
if we'd need it otherwise. */
...
...
@@ -13797,7 +14034,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
@@ -1296,26 +3
39
4,93 @@
@@ -1296,26 +3
41
4,93 @@
#define CONCAT2(a,b) a##b
#define CONCAT2E(a,b) CONCAT2(a,b)
...
...
@@ -13891,7 +14128,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#undef BPP
/*
@@ -1325,23 +3
49
0,27 @@
@@ -1325,23 +3
51
0,27 @@
static void
ReadConnFailedReason(void)
{
...
...
@@ -13933,7 +14170,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
/*
@@ -1358,9 +35
2
7,9 @@
@@ -1358,9 +35
4
7,9 @@
" %s significant bit in each byte is leftmost on the screen.\n",
(format->bigEndian ? "Most" : "Least"));
} else {
...
...
@@ -13945,7 +14182,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
(format->bigEndian ? "Most" : "Least"));
}
if (format->trueColour) {
@@ -1462,4 +36
3
1,3 @@
@@ -1462,4 +36
5
1,3 @@
cinfo->src = &jpegSrcManager;
}
...
...
@@ -15272,11 +15509,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/tight.c vnc_unixsrc/vncviewer
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/tmake vnc_unixsrc/vncviewer/tmake
--- vnc_unixsrc.orig/vncviewer/tmake 1969-12-31 19:00:00.000000000 -0500
+++ vnc_unixsrc/vncviewer/tmake 2009-
03-08 17:11:49
.000000000 -0400
@@ -0,0 +1,1
3
@@
+++ vnc_unixsrc/vncviewer/tmake 2009-
10-25 10:31:22
.000000000 -0400
@@ -0,0 +1,1
7
@@
+#!/bin/sh
+TURBOVNC_DIR=/home/runge/turbojpeg
+make clean
+(cd ../libvncauth || exit 1; make)
+if [ "X$1" = "X-a" ]; then
+ exit
+fi
+make CCOPTIONS=-DTURBOVNC EXTRA_LIBRARIES="-L$TURBOVNC_DIR -Xlinker --rpath=$TURBOVNC_DIR -Xlinker --rpath=/usr/local/lib -lturbojpeg"
+cp -p vncviewer vncviewer.turbovnc
+strip vncviewer.turbovnc
...
...
@@ -16165,8 +16406,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/turbovnc/turbojpeg.h vnc_unix
+#endif
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vncviewer/vncviewer._man
--- vnc_unixsrc.orig/vncviewer/vncviewer._man 1969-12-31 19:00:00.000000000 -0500
+++ vnc_unixsrc/vncviewer/vncviewer._man 2009-10-
03 12:28:09
.000000000 -0400
@@ -0,0 +1,79
3
@@
+++ vnc_unixsrc/vncviewer/vncviewer._man 2009-10-
23 12:24:51
.000000000 -0400
@@ -0,0 +1,79
9
@@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for X vncviewer
...
...
@@ -16288,13 +16529,13 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+TightVNC supports several different compression methods to encode
+screen updates; this option specifies a set of them to use in order of
+preference. Encodings are specified separated with spaces, and must
+thus be enclosed in quotes if more than one is specified.
Available
+
encodings, in default order for a remote connection, are "copyrect
+
tight hextile zlib corre rre raw". For a local connection (to the same
+
machine), the default order to try is "raw copyrect tight hextile zlib
+
corre rre". Raw encoding is always assumed as a last option if no
+
other encoding can be used for some reason. For more information
on
+encodings, see the section ENCODINGS below.
+thus be enclosed in quotes if more than one is specified.
Commas may be used to avoid spaces.
+
Available encodings, in default order for a remote connection, are
+
"copyrect tight hextile zlib corre rre raw". For a local connection
+
(to the same machine), the default order to try is "raw copyrect tight
+
hextile zlib corre rre". Raw encoding is always assumed as a last option
+
if no other encoding can be used for some reason. For more informati
on
+
on
encodings, see the section ENCODINGS below.
+.TP
+\fB\-bgr233\fR
+Always use the BGR233 format to encode pixel data. This reduces
...
...
@@ -16481,6 +16722,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+Prefer raw encoding for localhost, default is
+no, i.e. assumes you have a SSH tunnel instead.
+.TP
+\fB\-notty\fR
+Try to avoid using the terminal for interactive
+responses: use windows for messages and prompting
+instead. Messages will also be printed to terminal.
+.TP
+\fB\-sendclipboard\fR
+Send the X CLIPBOARD selection (i.e. Ctrl+C,
+Ctrl+V) instead of the X PRIMARY selection (mouse
...
...
@@ -16699,7 +16945,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+ Cursor Shape: ~ -nocursorshape
+ X11 Cursor: ~ -x11cursor
+ Cursor Alphablend: ~ -alpha
+ Toggle Tight/ZRLE: ~ -encodings ...
+ Toggle Tight/Hextile: ~ -encodings hextile...
+ Toggle Tight/ZRLE: ~ -encodings zrle...
+ Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
+ Quality Level ~ -quality (both Tight and ZYWRLE)
+ Compress Level ~ -compresslevel
...
...
@@ -16962,7 +17209,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+Karl J. Runge <runge@karlrunge.com>
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncviewer/vncviewer.c
--- vnc_unixsrc.orig/vncviewer/vncviewer.c 2004-01-13 09:22:05.000000000 -0500
+++ vnc_unixsrc/vncviewer/vncviewer.c 2009-
07-28 22:51:20
.000000000 -0400
+++ vnc_unixsrc/vncviewer/vncviewer.c 2009-
10-23 11:53:44
.000000000 -0400
@@ -22,6 +22,7 @@
*/
...
...
@@ -16971,10 +17218,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
char *programName;
XtAppContext appContext;
@@ -29,11 +30,2
34
@@
@@ -29,11 +30,2
41
@@
Widget toplevel;
+extern void raiseme(int force);
+
+void set_sbwidth(int sbw) {
+ char *q, *p, t[5];
+ int i, k, N = 4;
...
...
@@ -17050,15 +17299,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ }
+ if (!strcmp(str, ".")) {
+ char *p;
+ fprintf(stderr, "\nUnix Username: ");
+ if (!isatty(0)) {
+ char *u = DoUserDialog();
+ if (!use_tty()) {
+ char *u;
+ fprintf(stderr, "\nEnter Unix Username and Password in the popups.\n");
+ u = DoUserDialog();
+ if (strlen(u) >= 100) {
+ exit(1);
+ }
+ sprintf(username, u);
+ p = DoPasswordDialog();
+ } else {
+ raiseme(1);
+ fprintf(stderr, "\nUnix Username: ");
+ if (fgets(username, N, stdin) == NULL) {
+ exit(1);
+ }
...
...
@@ -17072,9 +17324,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+
+ } else if (!strcmp(str, "-")) {
+ char *p, *q;
+ if (!isatty(0)) {
+ if (!use_tty()) {
+ fprintf(stderr, "\nEnter unixuser@unixpasswd in the popup.\n");
+ p = DoPasswordDialog();
+ } else {
+ raiseme(1);
+ p = getpass("unixuser@unixpasswd: ");
+ }
+ if (! p) {
...
...
@@ -17208,7 +17462,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
/* The -listen option is used to make us a daemon process which listens for
incoming connections from servers, rather than actively connecting to a
@@ -45,89 +2
69,1615
@@
@@ -45,89 +2
76,1647
@@
listenForIncomingConnections() returns, setting the listenSpecified
flag. */
...
...
@@ -17613,13 +17867,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ appData.escapeActive = True;
+ }
+}
- Cleanup();
+
+/*
+ * ToggleNColors
+ */
- return 0;
+
+static Widget w256 = NULL;
+static Widget w64 = NULL;
+static Widget w8 = NULL;
...
...
@@ -17705,6 +17957,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+
+static Bool usingZRLE = False;
+static Bool usingZYWRLE = False;
+static Bool usingHextile = False;
+extern int skip_maybe_sync;
+
+void
...
...
@@ -17713,6 +17966,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ char prefTight[] = "copyrect tight zrle zywrle zlib hextile corre rre raw";
+ char prefZRLE[] = "copyrect zrle zywrle tight zlib hextile corre rre raw";
+ init_format_change();
+ usingHextile = False;
+ if (! appData.encodingsString) {
+ appDataNew.encodingsString = strdup(prefZRLE);
+ usingZRLE = True;
...
...
@@ -17761,6 +18015,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ char prefZRLE[] = "copyrect zrle zywrle tight zlib hextile corre rre raw";
+ init_format_change();
+ usingZRLE = True;
+ usingHextile = False;
+ if (! appData.encodingsString) {
+ appDataNew.encodingsString = strdup(prefZYWRLE);
+ usingZYWRLE = True;
...
...
@@ -17783,6 +18038,52 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ schedule_format_change();
+}
+
+void
+ToggleTightHextile(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ char prefTight[] = "copyrect tight zrle zywrle zlib hextile corre rre raw";
+ char prefHextile[] = "copyrect hextile tight zrle zywrle zlib corre rre raw";
+ init_format_change();
+ usingZRLE = False;
+ usingZYWRLE = False;
+ if (! appData.encodingsString) {
+ appDataNew.encodingsString = strdup(prefHextile);
+ usingHextile = True;
+ fprintf(stderr, "prefer: Hextile\n");
+ } else {
+ char *t, *z;
+ static int first = 1;
+ t = strstr(appData.encodingsString, "tight");
+ z = strstr(appData.encodingsString, "hextile");
+ if (first && usingHextile) {
+ appDataNew.encodingsString = strdup(prefTight);
+ usingHextile = False;
+ } else if (! t) {
+ appDataNew.encodingsString = strdup(prefHextile);
+ usingHextile = True;
+ fprintf(stderr, "prefer: Hextile\n");
+ } else if (! z) {
+ appDataNew.encodingsString = strdup(prefTight);
+ usingHextile = False;
+ skip_maybe_sync = 0;
+ fprintf(stderr, "prefer: Tight\n");
+ } else {
+ if (t < z) {
+ appDataNew.encodingsString = strdup(prefHextile);
+ usingHextile = True;
+ fprintf(stderr, "prefer: Hextile\n");
+ } else {
+ appDataNew.encodingsString = strdup(prefTight);
+ usingHextile = False;
+ skip_maybe_sync = 0;
+ fprintf(stderr, "prefer: Tight\n");
+ }
+ }
+ first = 0;
+ }
+ schedule_format_change();
+}
+
+void scale_check_zrle(void) {
+ static int didit = 0;
+ if (didit) {
...
...
@@ -17792,7 +18093,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ if (getenv("SSVNC_PRESERVE_ENCODING")) {
+ return;
+ }
+ if (!usingZRLE) {
+ if (!usingZRLE
&& !usingHextile
) {
+ Widget w;
+ fprintf(stderr, "\nSwitching to faster ZRLE encoding in client-side scaling mode.\n");
+ fprintf(stderr, "Switch back to Tight via the Popup menu if you prefer it.\n\n");
...
...
@@ -18078,7 +18379,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ schedule_fb_update();
+ }
+}
+
- Cleanup();
+void
+DoServerScale(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
...
...
@@ -18168,7 +18470,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ set_server_compress(n);
+ }
+}
+
- return 0;
+extern void rescale_image(void);
+
+void
...
...
@@ -18655,75 +18958,46 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ }
+}
+
+void
+SetZRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+static init_state(void) {
+ static int first = 1;
+ if (first && appData.encodingsString) {
+ char *t, *z, *w;
+ t = strstr(appData.encodingsString, "tight");
+ z = strstr(appData.encodingsString, "zrle");
+ w = strstr(appData.encodingsString, "zywrle");
+ if (t) {
+ if (z) {
+ if (w) {
+ if (t < z && t < w) {
+ usingZRLE = False;
+ } else {
+ usingZRLE = True;
+ }
+ if (z < w) {
+ usingZYWRLE = False;
+ } else {
+ usingZYWRLE = True;
+ }
+ } else {
+ if (t < z) {
+ char *t, *z, *y, *h;
+ char *str = appData.encodingsString;
+ int len = strlen(str);
+
+ t = strstr(str, "tight");
+ z = strstr(str, "zrle");
+ y = strstr(str, "zywrle");
+ h = strstr(str, "hextile");
+
+ if (!t) t = str + len;
+ if (!z) z = str + len;
+ if (!y) y = str + len;
+ if (!h) h = str + len;
+
+ usingZRLE = False;
+ } else {
+ usingZRLE = True;
+ }
+ usingZYWRLE = False;
+ }
+ } else {
+ if (w) {
+ if (t < w) {
+ usingZRLE = False;
+ } else {
+ usingHextile = False;
+
+ if (t < z && t < y && t < h) {
+ ;
+ } else if (z < t && z < y && z < h) {
+ usingZRLE = True;
+
}
+
} else if (y < t && y < z && y < h) {
+ usingZYWRLE = True;
+ } else {
+ usingZRLE = False;
+ usingZYWRLE = False;
+ }
+ }
+ } else {
+ if (z) {
+ if (w) {
+ usingZRLE = True;
+ if (z < w) {
+ usingZYWRLE = False;
+ } else {
+ usingZYWRLE = True;
+ }
+ } else {
+ usingZRLE = True;
+ usingZYWRLE = False;
+ }
+ } else {
+ if (w) {
+ usingZRLE = True;
+ usingZYWRLE = True;
+ } else {
+ usingZRLE = False;
+ usingZYWRLE = False;
+ }
+ }
+ } else if (h < t && h < z && h < y) {
+ usingHextile = True;
+ }
+ }
+ first = 0;
+
+}
+
+void
+SetZRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ init_state();
+ if (usingZRLE) {
+ XtVaSetValues(w, XtNstate, True, NULL);
+ } else {
...
...
@@ -18732,8 +19006,20 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+}
+
+void
+SetHextileState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ init_state();
+ if (usingHextile) {
+ XtVaSetValues(w, XtNstate, True, NULL);
+ } else {
+ XtVaSetValues(w, XtNstate, False, NULL);
+ }
+}
+
+void
+SetZYWRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ init_state();
+ if (usingZYWRLE) {
+ XtVaSetValues(w, XtNstate, True, NULL);
+ } else {
...
...
@@ -18862,7 +19148,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncviewer/vncviewer.h
--- vnc_unixsrc.orig/vncviewer/vncviewer.h 2004-03-11 13:14:40.000000000 -0500
+++ vnc_unixsrc/vncviewer/vncviewer.h 2009-
08-01 21:44:48
.000000000 -0400
+++ vnc_unixsrc/vncviewer/vncviewer.h 2009-
10-23 11:27:05
.000000000 -0400
@@ -28,6 +28,7 @@
#include <string.h>
#include <sys/time.h>
...
...
@@ -18886,7 +19172,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
#define FLASH_PORT_OFFSET 5400
#define LISTEN_PORT_OFFSET 5500
@@ -64,60 +71,12
4
@@
@@ -64,60 +71,12
5
@@
#define DEFAULT_VIA_CMD \
(DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
...
...
@@ -18992,6 +19278,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+
+ char *passwordFile;
+ Bool passwordDialog;
+ Bool notty;
+
+ int rawDelay;
+ int copyRectDelay;
...
...
@@ -19051,7 +19338,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern int listenPort, flashPort;
extern XrmOptionDescRec cmdLineOptions[];
@@ -130,10 +20
1
,11 @@
@@ -130,10 +20
2
,11 @@
/* colour.c */
extern unsigned long BGR233ToPixel[];
...
...
@@ -19064,7 +19351,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void SetVisualAndCmap();
@@ -157,13 +2
29,52
@@
@@ -157,13 +2
30,54
@@
extern void DesktopInitBeforeRealization();
extern void DesktopInitAfterRealization();
...
...
@@ -19086,6 +19373,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+
/* dialogs.c */
+extern int use_tty(void);
+
+extern void ScaleDialogDone(Widget w, XEvent *event, String *params,
+ Cardinal *num_params);
+extern char *DoScaleDialog();
...
...
@@ -19117,7 +19406,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void ServerDialogDone(Widget w, XEvent *event, String *params,
Cardinal *num_params);
extern char *DoServerDialog();
@@ -171,6 +28
2
,10 @@
@@ -171,6 +28
5
,10 @@
Cardinal *num_params);
extern char *DoPasswordDialog();
...
...
@@ -19128,7 +19417,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* fullscreen.c */
extern void ToggleFullScreen(Widget w, XEvent *event, String *params,
@@ -181,6 +29
6
,13 @@
@@ -181,6 +29
9
,13 @@
extern void FullScreenOn();
extern void FullScreenOff();
...
...
@@ -19142,7 +19431,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* listen.c */
extern void listenForIncomingConnections();
@@ -196,6 +3
18
,8 @@
@@ -196,6 +3
21
,8 @@
Cardinal *num_params);
extern void Quit(Widget w, XEvent *event, String *params,
Cardinal *num_params);
...
...
@@ -19151,7 +19440,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void Cleanup();
/* popup.c */
@@ -207,6 +33
1
,29 @@
@@ -207,6 +33
4
,29 @@
Cardinal *num_params);
extern void CreatePopup();
...
...
@@ -19181,7 +19470,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* rfbproto.c */
extern int rfbsock;
@@ -229,8 +37
6
,19 @@
@@ -229,8 +37
9
,19 @@
extern Bool SendClientCutText(char *str, int len);
extern Bool HandleRFBServerMessage();
...
...
@@ -19201,7 +19490,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* selection.c */
extern void InitialiseSelection();
@@ -241,8 +
399
,9 @@
@@ -241,8 +
402
,9 @@
/* shm.c */
...
...
@@ -19212,7 +19501,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* sockets.c */
@@ -253,10 +41
2
,15 @@
@@ -253,10 +41
5
,15 @@
extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port);
extern int ConnectToTcpAddr(unsigned int host, int port);
...
...
@@ -19228,7 +19517,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern Bool SameMachine(int sock);
/* tunnel.c */
@@ -271,3 +43
5,80
@@
@@ -271,3 +43
8,82
@@
extern XtAppContext appContext;
extern Display* dpy;
extern Widget toplevel;
...
...
@@ -19244,6 +19533,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+extern void Toggle8Colors(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleGreyScale(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleTightZRLE(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleTightHextile(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleZRLEZYWRLE(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleViewOnly(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleJPEG(Widget w, XEvent *ev, String *params, Cardinal *num_params);
...
...
@@ -19293,6 +19583,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+extern void Set8ColorsState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetGreyScaleState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetZRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetHextileState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetZYWRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetCursorShapeState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetCursorAlphaState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
...
...
@@ -19311,7 +19602,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+extern void SetEscapeKeysState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vncviewer/vncviewer.man
--- vnc_unixsrc.orig/vncviewer/vncviewer.man 2004-03-11 13:14:40.000000000 -0500
+++ vnc_unixsrc/vncviewer/vncviewer.man 2009-10-
03 12:28:09
.000000000 -0400
+++ vnc_unixsrc/vncviewer/vncviewer.man 2009-10-
23 12:24:51
.000000000 -0400
@@ -5,38 +5,55 @@
.\" Copyright (C) 1998 Marcus.Brinkmann@ruhr-uni-bochum.de
.\" Copyright (C) 2000,2001 Red Hat, Inc.
...
...
@@ -19376,7 +19667,28 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
You can use F8 to display a pop\-up utility menu. Press F8 twice to
pass single F8 to the remote side.
.SH OPTIONS
@@ -168,6 +185,388 @@
@@ -102,13 +119,13 @@
TightVNC supports several different compression methods to encode
screen updates; this option specifies a set of them to use in order of
preference. Encodings are specified separated with spaces, and must
-thus be enclosed in quotes if more than one is specified. Available
-encodings, in default order for a remote connection, are "copyrect
-tight hextile zlib corre rre raw". For a local connection (to the same
-machine), the default order to try is "raw copyrect tight hextile zlib
-corre rre". Raw encoding is always assumed as a last option if no
-other encoding can be used for some reason. For more information on
-encodings, see the section ENCODINGS below.
+thus be enclosed in quotes if more than one is specified. Commas may be used to avoid spaces.
+Available encodings, in default order for a remote connection, are
+"copyrect tight hextile zlib corre rre raw". For a local connection
+(to the same machine), the default order to try is "raw copyrect tight
+hextile zlib corre rre". Raw encoding is always assumed as a last option
+if no other encoding can be used for some reason. For more information
+on encodings, see the section ENCODINGS below.
.TP
\fB\-bgr233\fR
Always use the BGR233 format to encode pixel data. This reduces
@@ -168,6 +185,394 @@
\fB\-autopass\fR
Read a plain-text password from stdin. This option affects only the
standard VNC authentication.
...
...
@@ -19507,6 +19819,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
+Prefer raw encoding for localhost, default is
+no, i.e. assumes you have a SSH tunnel instead.
+.TP
+\fB\-notty\fR
+Try to avoid using the terminal for interactive
+responses: use windows for messages and prompting
+instead. Messages will also be printed to terminal.
+.TP
+\fB\-sendclipboard\fR
+Send the X CLIPBOARD selection (i.e. Ctrl+C,
+Ctrl+V) instead of the X PRIMARY selection (mouse
...
...
@@ -19725,7 +20042,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
+ Cursor Shape: ~ -nocursorshape
+ X11 Cursor: ~ -x11cursor
+ Cursor Alphablend: ~ -alpha
+ Toggle Tight/ZRLE: ~ -encodings ...
+ Toggle Tight/Hextile: ~ -encodings hextile...
+ Toggle Tight/ZRLE: ~ -encodings zrle...
+ Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
+ Quality Level ~ -quality (both Tight and ZYWRLE)
+ Compress Level ~ -compresslevel
...
...
@@ -19765,7 +20083,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
.SH ENCODINGS
The server supplies information in whatever format is desired by the
client, in order to make the client as easy as possible to implement.
@@ -238,6 +6
37
,15 @@
@@ -238,6 +6
43
,15 @@
\-quality and \-nojpeg options above). Tight encoding is usually the
best choice for low\-bandwidth network environments (e.g. slow modem
connections).
...
...
@@ -19781,7 +20099,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
.SH RESOURCES
X resources that \fBvncviewer\fR knows about, aside from the
normal Xt resources, are as follows:
@@ -364,12 +77
2
,13 @@
@@ -364,12 +77
8
,13 @@
.B %R
remote TCP port number.
.SH SEE ALSO
...
...
@@ -19798,7 +20116,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
\fBMan page authors:\fR
.br
@@ -380,3 +7
89
,5 @@
@@ -380,3 +7
95
,5 @@
Tim Waugh <twaugh@redhat.com>,
.br
Constantin Kaplinsky <const@ce.cctpu.edu.ru>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment