Commit a8453eea authored by runge's avatar runge

ssvnc/enhanced_tightvnc_viewer update.

parent 09f63f03
...@@ -64,19 +64,29 @@ The enhanced TightVNC viewer features are: ...@@ -64,19 +64,29 @@ The enhanced TightVNC viewer features are:
- Ability to Save and Load VNC profiles for different hosts. - 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. - Create or Import SSL Certificates and Private Keys.
- Reverse (viewer listening) VNC connections via SSL and SSH. - 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 - Support for Web Proxies, SOCKS Proxies, and the UltraVNC
repeater proxy (e.g. repeater://host:port+ID:1234). Multiple repeater proxy (e.g. repeater://host:port+ID:1234). Multiple
proxies may be chained together (3 max). proxies may be chained together (3 max).
- Support for SSH Gateway connections and non-standard SSH ports. - 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, - Automatic Service tunnelling via SSH for CUPS and SMB Printing,
ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting. ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting.
...@@ -131,11 +141,6 @@ The enhanced TightVNC viewer features are: ...@@ -131,11 +141,6 @@ The enhanced TightVNC viewer features are:
- Option "-unixpw ..." for use with "x11vnc -unixpw" login dialogs. - 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 - Support for UltraVNC extensions: Single Window, Disable
Server-side Input, 1/n Server side scaling, Text Chat (shell Server-side Input, 1/n Server side scaling, Text Chat (shell
terminal UI). Both UltraVNC and x11vnc servers support these terminal UI). Both UltraVNC and x11vnc servers support these
...@@ -152,12 +157,13 @@ The enhanced TightVNC viewer features are: ...@@ -152,12 +157,13 @@ The enhanced TightVNC viewer features are:
SC I, and SSL encrypted: SC III) SC I, and SSL encrypted: SC III)
- Support for UltraVNC DSM Encryption Plugin mode. (ARC4 and - 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 - Support for UltraVNC MS-Logon authentication (NOTE: the
MS-Logon key exchange implementation is very weak; an eavesdropper UltraVNC MS-Logon key exchange implementation is very weak; an
on the network can recover your Windows password easily; you eavesdropper on the network can recover your Windows password
need to use an additional encrypted tunnel with MS-Logon.) easily in a few seconds; you need to use an additional encrypted
tunnel with MS-Logon.)
- Support for symmetric encryption (including blowfish and 3des - Support for symmetric encryption (including blowfish and 3des
ciphers) to Non-UltraVNC Servers. Any server using the same ciphers) to Non-UltraVNC Servers. Any server using the same
...@@ -173,6 +179,11 @@ The enhanced TightVNC viewer features are: ...@@ -173,6 +179,11 @@ The enhanced TightVNC viewer features are:
long periods of time a listening port on the the local (VNC long periods of time a listening port on the the local (VNC
viewer) side that redirects to the remote side. 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 - Extremely low color modes: 64 and 8 colors in 8bpp
(-use64/-bgr222, -use8/-bgr111) (-use64/-bgr222, -use8/-bgr111)
...@@ -244,7 +255,7 @@ Unix and Mac OS X: ...@@ -244,7 +255,7 @@ Unix and Mac OS X:
Unpack the archive: Unpack the archive:
% gzip -dc ssvnc-1.0.24.tar.gz | tar xvf - % gzip -dc ssvnc-1.0.25.tar.gz | tar xvf -
Run the GUI: Run the GUI:
...@@ -252,7 +263,7 @@ Unix and Mac OS X: ...@@ -252,7 +263,7 @@ Unix and Mac OS X:
% ./ssvnc/MacOSX/ssvnc (for Mac OS X) % ./ssvnc/MacOSX/ssvnc (for Mac OS X)
The smaller file "ssvnc_no_windows-1.0.24.tar.gz" The smaller file "ssvnc_no_windows-1.0.25.tar.gz"
could have been used as well. could have been used as well.
On MacOSX you could also click on the SSVNC app icon in the Finder. On MacOSX you could also click on the SSVNC app icon in the Finder.
...@@ -298,8 +309,8 @@ Unix/MacOSX Install: ...@@ -298,8 +309,8 @@ Unix/MacOSX Install:
For the conventional source tarball it will compile and install, e.g.: For the conventional source tarball it will compile and install, e.g.:
gzip -dc ssvnc-1.0.24.src.tar.gz | tar xvf - gzip -dc ssvnc-1.0.25.src.tar.gz | tar xvf -
cd ssvnc-1.0.24 cd ssvnc-1.0.25
make config make config
make all make all
make PREFIX=/my/install/dir install make PREFIX=/my/install/dir install
...@@ -311,7 +322,7 @@ Windows: ...@@ -311,7 +322,7 @@ Windows:
Unzip, using WinZip or a similar utility, the zip file: Unzip, using WinZip or a similar utility, the zip file:
ssvnc-1.0.24.zip ssvnc-1.0.25.zip
Run the GUI, e.g.: Run the GUI, e.g.:
...@@ -323,7 +334,7 @@ Windows: ...@@ -323,7 +334,7 @@ Windows:
select Open, and then OK to launch it. select Open, and then OK to launch it.
The smaller file "ssvnc_windows_only-1.0.24.zip" The smaller file "ssvnc_windows_only-1.0.25.zip"
could have been used as well. could have been used as well.
You can make a Windows shortcut to this program if you want to. You can make a Windows shortcut to this program if you want to.
......
...@@ -16,10 +16,12 @@ proc getout {} { ...@@ -16,10 +16,12 @@ proc getout {} {
catch {flush $client_fh} catch {flush $client_fh}
after $delay after $delay
catch {close $client_fh} catch {close $client_fh}
set client_fh ""
after $delay after $delay
catch {flush $server_fh} catch {flush $server_fh}
after $delay after $delay
catch {close $server_fh} catch {close $server_fh}
set server_fh ""
after $delay after $delay
global bmesg_cnt global bmesg_cnt
...@@ -37,54 +39,78 @@ proc check_closed {} { ...@@ -37,54 +39,78 @@ proc check_closed {} {
if {! $got_connection} { if {! $got_connection} {
return return
} }
if {$client_fh != "" && [eof $client_fh]} { if {$client_fh != ""} {
set ef ""
catch {set ef [eof $client_fh]}
if {$ef == 1} {
if {$debug} { if {$debug} {
puts stderr "client_fh EOF" puts stderr "client_fh EOF"
} }
getout getout
} }
if {$server_fh != "" && [eof $server_fh]} { }
if {$server_fh != ""} {
set ef ""
catch {set ef [eof $server_fh]}
if {$ef == 1} {
if {$debug} { if {$debug} {
puts stderr "server_fh EOF" puts stderr "server_fh EOF"
} }
getout getout
} }
}
} }
proc xfer_in_to_out {} { 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]} { if {$client_fh != "" && ![eof $client_fh]} {
set ef ""
catch {set ef [eof $client_fh]}
if {$ef == 0} {
set str "" set str ""
catch {set str [read $client_fh 4096]} catch {set str [read $client_fh 4096]}
if {$debug} { 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 != ""} { if {$server_fh != "" && $str != ""} {
puts -nonewline $server_fh $str catch {puts -nonewline $server_fh $str}
flush $server_fh catch {flush $server_fh}
}
} }
} }
check_closed check_closed
} }
proc xfer_out_to_in {} { proc xfer_out_to_in {} {
global client_fh server_fh debug global client_fh server_fh debug do_bridge
if {$server_fh != "" && ![eof $server_fh]} { if {$server_fh != ""} {
set ef ""
catch {set ef [eof $server_fh]}
if {$ef == 0} {
set str "" set str ""
catch {set str [read $server_fh 4096]} catch {set str [read $server_fh 4096]}
if {$debug} { 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 != ""} { if {$client_fh != "" && $str != ""} {
puts -nonewline $client_fh $str catch {puts -nonewline $client_fh $str}
flush $client_fh catch {flush $client_fh}
}
} }
} }
check_closed check_closed
} }
proc bmesg {msg} { proc bmesg {msg} {
global env
if {! [info exists env(BMESG)]} {
return
}
if {$env(BMESG) == 0} {
return return
}
global bmesg_cnt global bmesg_cnt
if {! [info exists bmesg_cnt]} { if {! [info exists bmesg_cnt]} {
...@@ -380,6 +406,560 @@ proc do_connect_repeater {sock hostport which repeater} { ...@@ -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}
}
}
} elseif [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
} elseif [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) == $rfbSecTypeAnonTls} {
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
} elseif [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]
}
}
} elseif {$hs(sectype) == $rfbSecTypeVencrypt} {
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 == $rfbVencryptTlsNone} {
set fake_type "None"
} elseif {$sub_type == $rfbVencryptTlsVnc} {
set fake_type "VncAuth"
} elseif {$sub_type == $rfbVencryptTlsPlain} {
set fake_type "None"
set plain 1
} elseif {$sub_type == $rfbVencryptX509None} {
set fake_type "None"
} elseif {$sub_type == $rfbVencryptX509Vnc} {
set fake_type "VncAuth"
} elseif {$sub_type == $rfbVencryptX509Plain} {
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
} elseif {$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($rfbVencryptX509None)] {
set subtype $rfbVencryptX509None
puts stderr "selected rfbVencryptX509None"
} elseif [info exists subtypes($rfbVencryptX509Vnc)] {
set subtype $rfbVencryptX509Vnc
puts stderr "selected rfbVencryptX509Vnc"
} elseif [info exists subtypes($rfbVencryptX509Plain)] {
set subtype $rfbVencryptX509Plain
puts stderr "selected rfbVencryptX509Plain"
} elseif [info exists subtypes($rfbVencryptTlsNone)] {
set subtype $rfbVencryptTlsNone
puts stderr "selected rfbVencryptTlsNone"
} elseif [info exists subtypes($rfbVencryptTlsVnc)] {
set subtype $rfbVencryptTlsVnc
puts stderr "selected rfbVencryptTlsVnc"
} elseif [info exists subtypes($rfbVencryptTlsPlain)] {
set subtype $rfbVencryptTlsPlain
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
} elseif [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) == $rfbSecTypeVencrypt} {
append_handshake "sectype=$rfbSecTypeVencrypt"
vsend_uchar $sock $rfbSecTypeVencrypt
after 500
bmesg "do_vencrypt $sock $which"
do_vencrypt $sock $which
return
}
}
for {set i 0} {$i < $nsec} {incr i} {
if {$sectypes($i) == $rfbSecTypeAnonTls} {
append_handshake "sectype=$rfbSecTypeAnonTls"
vsend_uchar $sock $rfbSecTypeAnonTls
bmesg "rfbSecTypeAnonTls"
after 500
append_handshake "done"
return
}
}
}
proc do_connect {sock type hostport which} { proc do_connect {sock type hostport which} {
if {$type == "http"} { if {$type == "http"} {
do_connect_http $sock $hostport $which do_connect_http $sock $hostport $which
...@@ -390,6 +970,8 @@ proc do_connect {sock type hostport which} { ...@@ -390,6 +970,8 @@ proc do_connect {sock type hostport which} {
} elseif [regexp -nocase {^repeater:} $type] { } elseif [regexp -nocase {^repeater:} $type] {
regsub -nocase {^repeater:} $type "" repeater regsub -nocase {^repeater:} $type "" repeater
do_connect_repeater $sock $hostport $which $repeater do_connect_repeater $sock $hostport $which $repeater
} elseif {$type == "vencrypt"} {
do_connect_vencrypt $sock $hostport $which
} }
} }
...@@ -431,9 +1013,6 @@ proc handle_connection {fh host port} { ...@@ -431,9 +1013,6 @@ proc handle_connection {fh host port} {
fconfigure $fh -translation binary -blocking 0 fconfigure $fh -translation binary -blocking 0
fconfigure $sock -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 set cur_proxy $proxy1
if {$proxy2 != ""} { if {$proxy2 != ""} {
do_connect $sock $proxy1_type "$proxy2_host:$proxy2_port" 1 do_connect $sock $proxy1_type "$proxy2_host:$proxy2_port" 1
...@@ -451,6 +1030,9 @@ proc handle_connection {fh host port} { ...@@ -451,6 +1030,9 @@ proc handle_connection {fh host port} {
} else { } else {
do_connect $sock $proxy1_type $dest 1 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} { proc proxy_type {proxy} {
...@@ -468,6 +1050,8 @@ proc proxy_type {proxy} { ...@@ -468,6 +1050,8 @@ proc proxy_type {proxy} {
return "http" return "http"
} elseif [regexp -nocase {^repeater://.*\+(.*)$} $proxy mat idstr] { } elseif [regexp -nocase {^repeater://.*\+(.*)$} $proxy mat idstr] {
return "repeater:$idstr" return "repeater:$idstr"
} elseif [regexp -nocase {^vencrypt://} $proxy] {
return "vencrypt"
} else { } else {
return "http" return "http"
} }
...@@ -482,16 +1066,43 @@ proc proxy_hostport {proxy} { ...@@ -482,16 +1066,43 @@ proc proxy_hostport {proxy} {
return $hp return $hp
} }
proc setb {} {
wm withdraw .
button .b -text "CONNECT_BR" -command {destroy .}
pack .b
after 1000 check_callback
}
global env global env
set got_connection 0
set proxy1 "" set proxy1 ""
set proxy2 "" set proxy2 ""
set proxy3 "" set proxy3 ""
set client_fh "" set client_fh ""
set server_fh "" set server_fh ""
set do_bridge 0
set debug 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)]} { if {! [info exists env(SSVNC_DEST)]} {
set env(SSVNC_DEST) "haystack:2037" set env(SSVNC_DEST) "haystack:2037"
} }
...@@ -501,7 +1112,7 @@ if {$debug} { ...@@ -501,7 +1112,7 @@ if {$debug} {
if {! [info exists env(SSVNC_LISTEN)]} { if {! [info exists env(SSVNC_LISTEN)]} {
set env(SSVNC_LISTEN) "6789" set env(SSVNC_LISTEN) "6789"
} }
} else { } else {
if {! [info exists env(SSVNC_DEST)]} { if {! [info exists env(SSVNC_DEST)]} {
destroy .; exit; destroy .; exit;
} }
...@@ -511,64 +1122,57 @@ if {$debug} { ...@@ -511,64 +1122,57 @@ if {$debug} {
if {! [info exists env(SSVNC_LISTEN)] && ! [info exists env(SSVNC_REVERSE)]} { if {! [info exists env(SSVNC_LISTEN)] && ! [info exists env(SSVNC_REVERSE)]} {
destroy .; exit; 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 s [split $env(SSVNC_PROXY) ","]
set proxy1 [lindex $s 0] set proxy1 [lindex $s 0]
set proxy2 [lindex $s 1] set proxy2 [lindex $s 1]
set proxy3 [lindex $s 2] set proxy3 [lindex $s 2]
} else { } else {
set proxy1 $env(SSVNC_PROXY) set proxy1 $env(SSVNC_PROXY)
} }
set proxy1_type [proxy_type $proxy1] set proxy1_type [proxy_type $proxy1]
set proxy1_hp [proxy_hostport $proxy1] set proxy1_hp [proxy_hostport $proxy1]
set s [split $proxy1_hp ":"] set s [split $proxy1_hp ":"]
set proxy1_host [lindex $s 0] set proxy1_host [lindex $s 0]
set proxy1_port [lindex $s 1] set proxy1_port [lindex $s 1]
set proxy2_type "" set proxy2_type ""
set proxy2_host "" set proxy2_host ""
set proxy2_port "" set proxy2_port ""
if {$proxy2 != ""} { if {$proxy2 != ""} {
set proxy2_type [proxy_type $proxy2] set proxy2_type [proxy_type $proxy2]
set proxy2_hp [proxy_hostport $proxy2] set proxy2_hp [proxy_hostport $proxy2]
set s [split $proxy2_hp ":"] set s [split $proxy2_hp ":"]
set proxy2_host [lindex $s 0] set proxy2_host [lindex $s 0]
set proxy2_port [lindex $s 1] set proxy2_port [lindex $s 1]
} }
set proxy3_type "" set proxy3_type ""
set proxy3_host "" set proxy3_host ""
set proxy3_port "" set proxy3_port ""
if {$proxy3 != ""} { if {$proxy3 != ""} {
set proxy3_type [proxy_type $proxy3] set proxy3_type [proxy_type $proxy3]
set proxy3_hp [proxy_hostport $proxy3] set proxy3_hp [proxy_hostport $proxy3]
set s [split $proxy3_hp ":"] set s [split $proxy3_hp ":"]
set proxy3_host [lindex $s 0] set proxy3_host [lindex $s 0]
set proxy3_port [lindex $s 1] 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 {} { bmesg "1: '$proxy1_host' '$proxy1_port' '$proxy1_type'";
wm withdraw . bmesg "2: '$proxy2_host' '$proxy2_port' '$proxy2_type'";
button .b -text "CONNECT_BR" -command {destroy .} bmesg "3: '$proxy3_host' '$proxy3_port' '$proxy3_type'";
pack .b
after 1000 check_callback
}
if [info exists env(SSVNC_REVERSE)] { if [info exists env(SSVNC_REVERSE)] {
set s [split $env(SSVNC_REVERSE) ":"] set s [split $env(SSVNC_REVERSE) ":"]
set rhost [lindex $s 0] set rhost [lindex $s 0]
set rport [lindex $s 1] set rport [lindex $s 1]
...@@ -580,7 +1184,7 @@ if [info exists env(SSVNC_REVERSE)] { ...@@ -580,7 +1184,7 @@ if [info exists env(SSVNC_REVERSE)] {
puts stderr "SSVNC_REVERSE to $rhost $rport OK"; puts stderr "SSVNC_REVERSE to $rhost $rport OK";
setb setb
handle_connection $lsock $rhost $rport handle_connection $lsock $rhost $rport
} else { } else {
set lport $env(SSVNC_LISTEN) set lport $env(SSVNC_LISTEN)
set rc [catch {set lsock [socket -myaddr 127.0.0.1 -server handle_connection $lport]}] set rc [catch {set lsock [socket -myaddr 127.0.0.1 -server handle_connection $lport]}]
if {$rc != 0} { if {$rc != 0} {
...@@ -589,4 +1193,5 @@ if [info exists env(SSVNC_REVERSE)] { ...@@ -589,4 +1193,5 @@ if [info exists env(SSVNC_REVERSE)] {
} }
puts stderr "SSVNC_LISTEN on $lport OK"; puts stderr "SSVNC_LISTEN on $lport OK";
setb setb
}
} }
...@@ -97,6 +97,42 @@ OPTIONS ...@@ -97,6 +97,42 @@ OPTIONS
END END
exit 0 exit 0
fi 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 if [ "X$XTERM_PRINT" != "X" ]; then
XTERM_PRINT="" XTERM_PRINT=""
...@@ -113,9 +149,10 @@ PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin:/usr/sfw/b ...@@ -113,9 +149,10 @@ PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin:/usr/sfw/b
export PATH export PATH
if [ "X$FULLNAME" = "XKarl J. Runge" ]; then if [ "X$FULLNAME" = "XKarl J. Runge" ]; then
if [ "X$NOPOPUFIX" = "X" ]; then
VNCVIEWER_POPUP_FIX=1 VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX export VNCVIEWER_POPUP_FIX
fi
PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'` PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'`
fi fi
...@@ -123,11 +160,12 @@ if [ "X$WISH" = "X" ]; then ...@@ -123,11 +160,12 @@ if [ "X$WISH" = "X" ]; then
WISH=wish WISH=wish
for try in wish8.4 wish wish8.3 wish8.5 wish8.6 for try in wish8.4 wish wish8.3 wish8.5 wish8.6
do do
if type $try > /dev/null; then if type $try > /dev/null 2>&1; then
WISH=$try WISH=$try
break break
fi fi
done done
export WISH
fi fi
......
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2006-2008 by Karl J. Runge <runge@karlrunge.com> # Copyright (c) 2006-2009 by Karl J. Runge <runge@karlrunge.com>
# #
# ssvnc_cmd: # ssvnc_cmd:
# #
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
# #
# See the TightVNC viewer documentation for on its cmdline arguments. # 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 # TightVNC viewer version 1.3dev5
# #
...@@ -98,9 +98,10 @@ PATH=$PATH:/usr/bin:/bin ...@@ -98,9 +98,10 @@ PATH=$PATH:/usr/bin:/bin
export PATH export PATH
if [ "X$FULLNAME" = "XKarl J. Runge" ]; then if [ "X$FULLNAME" = "XKarl J. Runge" ]; then
if [ "X$NOPOPUFIX" = "X" ]; then
VNCVIEWER_POPUP_FIX=1 VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX export VNCVIEWER_POPUP_FIX
fi
PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'` PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'`
fi fi
......
...@@ -3,7 +3,23 @@ ...@@ -3,7 +3,23 @@
# ss_vncviewer: wrapper for vncviewer to use an stunnel SSL tunnel # ss_vncviewer: wrapper for vncviewer to use an stunnel SSL tunnel
# or an SSH 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 # 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) # (however, see the -ssh option below, in which case you will need ssh(1)
...@@ -129,7 +145,7 @@ fi ...@@ -129,7 +145,7 @@ fi
# #
# turn on verbose debugging output # turn on verbose debugging output
if [ "X$SS_DEBUG" != "X" ]; then if [ "X$SS_DEBUG" != "X" -a "X$SS_DEBUG" != "X0" ]; then
set -xv set -xv
fi fi
...@@ -219,10 +235,12 @@ if [ "X$1" = "X-viewerflavor" ]; then ...@@ -219,10 +235,12 @@ if [ "X$1" = "X-viewerflavor" ]; then
str=`$VNCVIEWERCMD -h 2>&1 | head -n 5` str=`$VNCVIEWERCMD -h 2>&1 | head -n 5`
if echo "$str" | grep -i 'TightVNC.viewer' > /dev/null; then if echo "$str" | grep -i 'TightVNC.viewer' > /dev/null; then
echo "tightvnc" 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 elif echo "$str" | grep -i 'VNC viewer version 3' > /dev/null; then
echo "realvnc3" 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 else
echo "unknown" echo "unknown"
fi fi
...@@ -442,7 +460,12 @@ if echo "$proxy" | egrep "vencrypt://" > /dev/null; then ...@@ -442,7 +460,12 @@ if echo "$proxy" | egrep "vencrypt://" > /dev/null; then
vtmp=`mytmp "$vtmp"` vtmp=`mytmp "$vtmp"`
SSVNC_PREDIGESTED_HANDSHAKE="$vtmp" SSVNC_PREDIGESTED_HANDSHAKE="$vtmp"
export SSVNC_PREDIGESTED_HANDSHAKE 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 fi
...@@ -658,6 +681,9 @@ final() { ...@@ -658,6 +681,9 @@ final() {
if [ "X$tail_pid" != "X" ]; then if [ "X$tail_pid" != "X" ]; then
kill -TERM $tail_pid kill -TERM $tail_pid
fi fi
if [ "X$tail_pid2" != "X" ]; then
kill -TERM $tail_pid2
fi
} }
if [ "X$reverse" = "X" ]; then if [ "X$reverse" = "X" ]; then
...@@ -755,17 +781,30 @@ pcode() { ...@@ -755,17 +781,30 @@ pcode() {
cod='#!/usr/bin/perl 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; use IO::Socket::INET;
if (exists $ENV{PPROXY_SLEEP}) { if (exists $ENV{PPROXY_SLEEP} && $ENV{PPROXY_SLEEP} > 0) {
print STDERR "PPROXY_PID: $$\n"; print STDERR "PPROXY_PID: $$\n";
sleep $ENV{PPROXY_SLEEP}; sleep $ENV{PPROXY_SLEEP};
} }
foreach my $var (qw(PPROXY_PROXY PPROXY_SOCKS PPROXY_DEST PPROXY_LISTEN foreach my $var (qw(
PPROXY_REVERSE PPROXY_REPEATER PPROXY_REMOVE PPROXY_KILLPID PPROXY_SLEEP)) { 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}) { if (0 || $ENV{SS_DEBUG} || $ENV{SSVNC_VENCRYPT_DEBUG}) {
print STDERR "$var: $ENV{$var}\n"; print STDERR "$var: $ENV{$var}\n";
} }
...@@ -808,14 +847,14 @@ sub gettime { ...@@ -808,14 +847,14 @@ sub gettime {
return $t; return $t;
} }
sub append_handshake { my $listen_handle = "";
my $str = shift; my $sock = "";
if ($handshake_file) { my $parent = $$;
if (open(HSF, ">>$handshake_file")) {
print HSF $str; if ($ENV{PPROXY_VENCRYPT_VIEWER_BRIDGE}) {
close HSF; 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); my ($first, $second, $third) = split(/,/, $ENV{PPROXY_PROXY}, 3);
...@@ -836,7 +875,7 @@ if ($third ne "") { ...@@ -836,7 +875,7 @@ if ($third ne "") {
print STDERR "\n"; 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_host: $proxy_host\n";
print STDERR "proxy_port: $proxy_port\n"; print STDERR "proxy_port: $proxy_port\n";
print STDERR "proxy_connect: $connect\n"; print STDERR "proxy_connect: $connect\n";
...@@ -851,7 +890,12 @@ if (1) { ...@@ -851,7 +890,12 @@ if (1) {
print STDERR "\n"; print STDERR "\n";
} }
my $listen_handle = ""; sub pdie {
my $msg = shift;
kill_proxy_pids();
die "$msg";
}
if ($ENV{PPROXY_REVERSE} ne "") { if ($ENV{PPROXY_REVERSE} ne "") {
my ($rhost, $rport) = split(/:/, $ENV{PPROXY_REVERSE}); my ($rhost, $rport) = split(/:/, $ENV{PPROXY_REVERSE});
$rport = 5900 unless $rport; $rport = 5900 unless $rport;
...@@ -861,20 +905,26 @@ if ($ENV{PPROXY_REVERSE} ne "") { ...@@ -861,20 +905,26 @@ if ($ENV{PPROXY_REVERSE} ne "") {
Proto => "tcp" Proto => "tcp"
); );
if (! $listen_handle) { if (! $listen_handle) {
die "pproxy: $! -- PPROXY_REVERSE\n"; pdie "pproxy: $! -- PPROXY_REVERSE\n";
} }
print STDERR "PPROXY_REVERSE: connected to $rhost $rport\n"; print STDERR "PPROXY_REVERSE: connected to $rhost $rport\n";
} elsif ($ENV{PPROXY_LISTEN} ne "") { } elsif ($ENV{PPROXY_LISTEN} ne "") {
my $listen_sock = ""; my $listen_sock = "";
my $maxtry = 12;
my $sleep = 5;
my $p2 = "";
for (my $i=0; $i < $maxtry; $i++) {
if ($ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:(.*)/) { if ($ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:(.*)/) {
my $p = $1; my $p = $1;
$p2 = "*:$p";
$listen_sock = IO::Socket::INET->new( $listen_sock = IO::Socket::INET->new(
Listen => 2, Listen => 2,
LocalPort => $p, LocalPort => $p,
Proto => "tcp" Proto => "tcp"
); );
} else { } else {
$p2 = "localhost:$ENV{PPROXY_LISTEN}";
$listen_sock = IO::Socket::INET->new( $listen_sock = IO::Socket::INET->new(
Listen => 2, Listen => 2,
LocalAddr => "127.0.0.1", LocalAddr => "127.0.0.1",
...@@ -883,17 +933,29 @@ if ($ENV{PPROXY_REVERSE} ne "") { ...@@ -883,17 +933,29 @@ if ($ENV{PPROXY_REVERSE} ne "") {
); );
} }
if (! $listen_sock) { 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; my $ip;
($listen_handle, $ip) = $listen_sock->accept(); ($listen_handle, $ip) = $listen_sock->accept();
my $err = $!;
close $listen_sock;
if (! $listen_handle) { 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, PeerAddr => $proxy_host,
PeerPort => $proxy_port, PeerPort => $proxy_port,
Proto => "tcp" Proto => "tcp"
...@@ -902,13 +964,13 @@ my $sock = IO::Socket::INET->new( ...@@ -902,13 +964,13 @@ my $sock = IO::Socket::INET->new(
if (! $sock) { if (! $sock) {
my $err = $!; my $err = $!;
unlink($0) if $ENV{PPROXY_REMOVE}; unlink($0) if $ENV{PPROXY_REMOVE};
die "pproxy: $err\n"; pdie "pproxy: $err\n";
} }
unlink($0) if $ENV{PPROXY_REMOVE}; unlink($0) if $ENV{PPROXY_REMOVE};
if ($ENV{PPROXY_PROXY} =~ /^vencrypt:/ && $ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:/) { if ($ENV{PPROXY_PROXY} =~ /^vencrypt:/ && $ENV{PPROXY_LISTEN} =~ /^INADDR_ANY:/) {
print STDERR "PPROXY: vencrypt+reverse: swapping listen socket with connect socket.\n"; print STDERR "\nPPROXY: vencrypt+reverse: swapping listen socket with connect socket.\n";
my $tmp_swap = $sock; my $tmp_swap = $sock;
$sock = $listen_handle; $sock = $listen_handle;
$listen_handle = $tmp_swap; $listen_handle = $tmp_swap;
...@@ -935,58 +997,123 @@ if ($second ne "") { ...@@ -935,58 +997,123 @@ if ($second ne "") {
connection($connect, 1); connection($connect, 1);
} }
$parent = $$; sub kill_proxy_pids() {
$child = fork; if ($ENV{PPROXY_VENCRYPT_VIEWER_BRIDGE}) {
if (! defined $child) { return;
}
if ($ENV{PPROXY_KILLPID}) { if ($ENV{PPROXY_KILLPID}) {
foreach my $p (split(/,/, $ENV{PPROXY_KILLPID})) { foreach my $p (split(/,/, $ENV{PPROXY_KILLPID})) {
if ($p =~ /^(\+|-)/) { if ($p =~ /^(\+|-)/) {
$p = $parent + $p; $p = $parent + $p;
} }
print STDERR "kill TERM, $p (PPROXY_KILLPID)\n";
kill "TERM", $p; kill "TERM", $p;
} }
} }
exit 1;
} }
if ($child) { sub xfer {
print STDERR "pproxy parent\[$$] STDIN -> socket\n"; 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) { if ($listen_handle) {
print STDERR "pproxy parent[$$] listen_handle -> socket\n";
xfer($listen_handle, $sock); xfer($listen_handle, $sock);
} else { } else {
print STDERR "pproxy parent[$$] STDIN -> socket\n";
xfer(STDIN, $sock); xfer(STDIN, $sock);
} }
select(undef, undef, undef, 0.25); select(undef, undef, undef, 0.25);
if (kill 0, $child) { if (kill 0, $child) {
select(undef, undef, undef, 1.5); select(undef, undef, undef, 0.9);
print STDERR "pproxy\[$$]: kill TERM $child\n"; if (kill 0, $child) {
print STDERR "pproxy[$$]: kill TERM child $child\n";
kill "TERM", $child; 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) { if ($listen_handle) {
print STDERR "pproxy child [$$] socket -> listen_handle\n\n";
xfer($sock, $listen_handle); xfer($sock, $listen_handle);
} else { } else {
print STDERR "pproxy child [$$] socket -> STDOUT\n\n";
xfer($sock, STDOUT); xfer($sock, STDOUT);
} }
select(undef, undef, undef, 0.25); select(undef, undef, undef, 0.25);
if (kill 0, $parent) { if (kill 0, $parent) {
select(undef, undef, undef, 1.5); select(undef, undef, undef, 0.8);
print STDERR "pproxy\[$$]: kill TERM $parent\n"; if (kill 0, $parent) {
print STDERR "pproxy[$$]: kill TERM parent $parent\n";
kill "TERM", $parent; 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; exit;
sub url_parse { sub url_parse {
...@@ -1215,13 +1342,14 @@ sub connection { ...@@ -1215,13 +1342,14 @@ sub connection {
sub vdie { sub vdie {
append_handshake("done\n"); append_handshake("done\n");
close $sock; close $sock;
kill_proxy_pids();
exit(1); exit(1);
} }
sub anontls_handshake { sub anontls_handshake {
my ($vmode, $db) = @_; my ($vmode, $db) = @_;
print STDERR "PPROXY: Doing ANONTLS Handshake\n"; print STDERR "\nPPROXY: Doing ANONTLS Handshake\n";
my $psec = pack("C", $rfbSecTypeAnonTls); my $psec = pack("C", $rfbSecTypeAnonTls);
syswrite($sock, $psec, 1); syswrite($sock, $psec, 1);
...@@ -1233,7 +1361,7 @@ sub vencrypt_handshake { ...@@ -1233,7 +1361,7 @@ sub vencrypt_handshake {
my ($vmode, $db) = @_; my ($vmode, $db) = @_;
print STDERR "PPROXY: Doing VeNCrypt Handshake\n"; print STDERR "\nPPROXY: Doing VeNCrypt Handshake\n";
my $psec = pack("C", $rfbSecTypeVencrypt); my $psec = pack("C", $rfbSecTypeVencrypt);
...@@ -1426,44 +1554,407 @@ sub vencrypt_dialog { ...@@ -1426,44 +1554,407 @@ sub vencrypt_dialog {
} }
} }
sub xfer { sub append_handshake {
my($in, $out) = @_; my $str = shift;
$RIN = $WIN = $EIN = ""; if ($handshake_file) {
$ROUT = ""; if (open(HSF, ">>$handshake_file")) {
vec($RIN, fileno($in), 1) = 1; print HSF $str;
vec($WIN, fileno($in), 1) = 1; close HSF;
$EIN = $RIN | $WIN; }
}
}
while (1) { sub do_vencrypt_viewer_bridge {
my $nf = 0; my ($listen, $connect) = @_;
while (! $nf) { print STDERR "\npproxy: starting vencrypt_viewer_bridge[$$]: $listen \-> $connect\n";
$nf = select($ROUT=$RIN, undef, undef, undef); my $db = 0;
my $backwards = 0;
if ($listen < 0) {
$backwards = 1;
$listen = -$listen;
} }
my $len = sysread($in, $buf, 8192); if ($handshake_file eq "") {
if (! defined($len)) { die "pproxy: vencrypt_viewer_bridge[$$]: no SSVNC_PREDIGESTED_HANDSHAKE\n";
next if $! =~ /^Interrupted/; }
print STDERR "pproxy\[$$]: $!\n"; my $listen_sock;
last; my $maxtry = 12;
} elsif ($len == 0) { my $sleep = 5;
print STDERR "pproxy\[$$]: Input is EOF.\n"; 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; last;
} }
my $offset = 0; }
my $quit = 0; if (! $listen_sock) {
while ($len) { die "pproxy: vencrypt_viewer_bridge[$$]: $!\n";
my $written = syswrite($out, $buf, $len, $offset); }
if (! defined $written) { print STDERR "pproxy: vencrypt_viewer_bridge[$$]: listening on port $listen\n\n";
print STDERR "pproxy\[$$]: Output is EOF. $!\n"; my ($viewer_sock, $ip) = $listen_sock->accept();
$quit = 1; 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; last;
} }
$len -= $written;
$offset += $written;
} }
last if $quit;
} }
close($in); if (! exists $hs{server}) {
close($out); $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 ...@@ -1549,11 +2040,33 @@ END
} }
Kecho() { Kecho() {
if [ "X$USER" = "Xrunge" ]; then NO_KECHO=1
if [ "X$USER" = "Xrunge" -a "X$NO_KECHO" = "X" ]; then
echo "dbg: $*" echo "dbg: $*"
fi 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 if [ "X$use_ssh" = "X1" ]; then
# #
# USING SSH # USING SSH
...@@ -1561,6 +2074,8 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1561,6 +2074,8 @@ if [ "X$use_ssh" = "X1" ]; then
ssh_port="22" ssh_port="22"
ssh_host="$host" ssh_host="$host"
vnc_host="$localhost" vnc_host="$localhost"
ssh_UKHF=""
localhost_extra=""
# let user override ssh via $SSH # let user override ssh via $SSH
ssh=${SSH:-"ssh -x"} ssh=${SSH:-"ssh -x"}
...@@ -1584,6 +2099,22 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1584,6 +2099,22 @@ if [ "X$use_ssh" = "X1" ]; then
fi fi
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 if [ "X$SSVNC_LIM_ACCEPT_PRELOAD" != "X" ]; then
SSVNC_LIM_ACCEPT_PRELOAD="$SSVNC_BASEDIR/$SSVNC_UNAME/$SSVNC_LIM_ACCEPT_PRELOAD" SSVNC_LIM_ACCEPT_PRELOAD="$SSVNC_BASEDIR/$SSVNC_UNAME/$SSVNC_LIM_ACCEPT_PRELOAD"
fi fi
...@@ -1602,6 +2133,29 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1602,6 +2133,29 @@ if [ "X$use_ssh" = "X1" ]; then
SSVNC_LIM_ACCEPT_PRELOAD="" SSVNC_LIM_ACCEPT_PRELOAD=""
fi 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 if echo "$proxy" | egrep '(http|https|socks|socks4|socks5)://' > /dev/null; then
# Handle Web or SOCKS proxy(ies) for the initial connect. # Handle Web or SOCKS proxy(ies) for the initial connect.
Kecho host=$host Kecho host=$host
...@@ -1687,11 +2241,16 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1687,11 +2241,16 @@ if [ "X$use_ssh" = "X1" ]; then
port=$port_save port=$port_save
host=$host_save host=$host_save
nd=`findfree 6700` nd=`findfree 6600`
PPROXY_LISTEN=$nd; export PPROXY_LISTEN PPROXY_LISTEN=$nd; export PPROXY_LISTEN
$ptmp & $ptmp &
sleep 2 sleep 1
ssh_args="$ssh_args -o NoHostAuthenticationForLocalhost=yes" 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 if [ "X$sproxy1" = "X" ]; then
u="" u=""
if echo "$host" | grep '@' > /dev/null; then if echo "$host" | grep '@' > /dev/null; then
...@@ -1702,6 +2261,7 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1702,6 +2261,7 @@ if [ "X$use_ssh" = "X1" ]; then
else else
proxy="${sproxy1_user}$localhost:$nd" proxy="${sproxy1_user}$localhost:$nd"
fi fi
localhost_extra=".2"
if [ "X$sproxy_rest" != "X" ]; then if [ "X$sproxy_rest" != "X" ]; then
proxy="$proxy,$sproxy_rest" proxy="$proxy,$sproxy_rest"
fi fi
...@@ -1733,12 +2293,21 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1733,12 +2293,21 @@ if [ "X$use_ssh" = "X1" ]; then
ssh_port2="22" ssh_port2="22"
fi fi
proxport=`findfree 3500` 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
echo "Running 1st ssh proxy:" 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 "" echo ""
$ssh -f -x $ssh_port1 $targ -e none -o NoHostAuthenticationForLocalhost=yes -L $proxport:$ssh_host2:$ssh_port2 $ssh_host1 "sleep 30" $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 -o NoHostAuthenticationForLocalhost=yes" ssh_args="$ssh_args $ssh_NHAFL"
sleep 1 sleep 1
stty sane stty sane
proxy="${ssh_user2}$localhost:$proxport" proxy="${ssh_user2}$localhost:$proxport"
...@@ -1813,6 +2382,8 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1813,6 +2382,8 @@ if [ "X$use_ssh" = "X1" ]; then
elif [ "X$getport" != "X" ]; then elif [ "X$getport" != "X" ]; then
tport=/tmp/ss_vncviewer_tport${RANDOM}.$$ tport=/tmp/ss_vncviewer_tport${RANDOM}.$$
tport=`mytmp "$tport"` tport=`mytmp "$tport"`
tport2=/tmp/ss_vncviewer_tport2${RANDOM}.$$
tport2=`mytmp "$tport2"`
if [ "X$rsh" != "X1" ]; then if [ "X$rsh" != "X1" ]; then
if echo "$ssh_cmd" | grep "sudo " > /dev/null; then if echo "$ssh_cmd" | grep "sudo " > /dev/null; then
...@@ -1826,10 +2397,12 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1826,10 +2397,12 @@ if [ "X$use_ssh" = "X1" ]; then
fi 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 \"$info\""
echo "" 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 if [ "X$teeport" = "X1" ]; then
tail -f $tport 1>&2 & tail -f $tport 1>&2 &
tail_pid=$! tail_pid=$!
tail -f $tport2 1>&2 &
tail_pid2=$!
fi fi
rc=$? rc=$?
else else
...@@ -1858,11 +2431,11 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1858,11 +2431,11 @@ if [ "X$use_ssh" = "X1" ]; then
while [ $i -lt $imax ]; do while [ $i -lt $imax ]; do
#echo $sleepit #echo $sleepit
eval $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 if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then
break break
fi 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 if [ "X$vnss" != "X" ]; then
PORT=`echo "$vnss" | awk -F: '{print $2}'` PORT=`echo "$vnss" | awk -F: '{print $2}'`
if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then
...@@ -1871,14 +2444,16 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -1871,14 +2444,16 @@ if [ "X$use_ssh" = "X1" ]; then
fi fi
fi fi
if echo "$PORT" | grep '^[0-9][0-9]*$' > /dev/null; then 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 break
fi fi
fi fi
i=`expr $i + 1` i=`expr $i + 1`
done done
echo "PORT=$PORT" 1>&2 echo "found: PORT='$PORT'" 1>&2
rm -f $tport rm -f $tport $tport2
if [ "X$rsh" = "X1" ]; then if [ "X$rsh" = "X1" ]; then
rsh_viewer "$@" rsh_viewer "$@"
exit $? exit $?
...@@ -2004,6 +2579,16 @@ if [ "X$use_ssh" = "X1" ]; then ...@@ -2004,6 +2579,16 @@ if [ "X$use_ssh" = "X1" ]; then
else else
proxy="" proxy=""
fi 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
fi fi
...@@ -2034,6 +2619,9 @@ if [ "X$verify" != "X" ]; then ...@@ -2034,6 +2619,9 @@ if [ "X$verify" != "X" ]; then
verify="$verify verify="$verify
verify = 2" verify = 2"
fi fi
if [ "X$SSVNC_STUNNEL_VERIFY3" != "X" ]; then
verify=`echo "$verify" | sed -e 's/verify = 2/verify = 3/'`
fi
if [ "X$mycert" != "X" ]; then if [ "X$mycert" != "X" ]; then
cert="cert = $mycert" cert="cert = $mycert"
fi fi
...@@ -2063,7 +2651,6 @@ if [ "X$proxy" != "X" ]; then ...@@ -2063,7 +2651,6 @@ if [ "X$proxy" != "X" ]; then
PPROXY_LISTEN=$nd PPROXY_LISTEN=$nd
export PPROXY_LISTEN export PPROXY_LISTEN
if [ "X$reverse" = "X" ]; then if [ "X$reverse" = "X" ]; then
#$ptmp 2>/dev/null &
$ptmp & $ptmp &
fi fi
sleep 2 sleep 2
...@@ -2082,6 +2669,8 @@ else ...@@ -2082,6 +2669,8 @@ else
connect="connect = $host:$port" connect="connect = $host:$port"
fi fi
# handle showcert case:
#
if [ "X$showcert" = "X1" ]; then if [ "X$showcert" = "X1" ]; then
if [ "X$proxy" != "X" ]; then if [ "X$proxy" != "X" ]; then
PPROXY_LISTEN=$use PPROXY_LISTEN=$use
...@@ -2092,6 +2681,23 @@ if [ "X$showcert" = "X1" ]; then ...@@ -2092,6 +2681,23 @@ if [ "X$showcert" = "X1" ]; then
$ptmp 2>/dev/null & $ptmp 2>/dev/null &
fi fi
sleep 1 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" host="$localhost"
port="$use" port="$use"
fi fi
...@@ -2114,6 +2720,15 @@ if [ "X$showcert" = "X1" ]; then ...@@ -2114,6 +2720,15 @@ if [ "X$showcert" = "X1" ]; then
fi fi
#echo "openssl s_client $cipher_args -connect $host:$port" #echo "openssl s_client $cipher_args -connect $host:$port"
if [ "X$reverse" = "X" ]; then 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 openssl s_client $cipher_args -prexit -connect $host:$port 2>&1 < /dev/null
rc=$? rc=$?
else else
...@@ -2183,6 +2798,8 @@ if [ "X$showcert" = "X1" ]; then ...@@ -2183,6 +2798,8 @@ if [ "X$showcert" = "X1" ]; then
fi fi
fi fi
# handle direct connect case:
#
if [ "X$direct_connect" != "X" ]; then if [ "X$direct_connect" != "X" ]; then
if [ "X$SSVNC_ULTRA_DSM" != "X" ]; then if [ "X$SSVNC_ULTRA_DSM" != "X" ]; then
SSVNC_NO_ENC_WARN=1 SSVNC_NO_ENC_WARN=1
...@@ -2199,7 +2816,7 @@ if [ "X$direct_connect" != "X" ]; then ...@@ -2199,7 +2816,7 @@ if [ "X$direct_connect" != "X" ]; then
: :
else else
echo "" echo ""
echo "** NOTE: THERE WILL BE NO SSL OR SSH ENCRYPTION **" echo "** WARNING: THERE WILL BE NO SSL OR SSH ENCRYPTION **"
echo "" echo ""
fi fi
fi fi
...@@ -2420,6 +3037,14 @@ echo "Using this stunnel configuration:" ...@@ -2420,6 +3037,14 @@ echo "Using this stunnel configuration:"
echo "" echo ""
cat "$tmp_cfg" | uniq cat "$tmp_cfg" | uniq
echo "" 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 sleep 1
if [ "X$stunnel_exec" = "X" ]; then if [ "X$stunnel_exec" = "X" ]; then
...@@ -2462,8 +3087,16 @@ if [ "X$SSVNC_EXTRA_SLEEP" != "X" ]; then ...@@ -2462,8 +3087,16 @@ if [ "X$SSVNC_EXTRA_SLEEP" != "X" ]; then
echo "sleep $SSVNC_EXTRA_SLEEP" echo "sleep $SSVNC_EXTRA_SLEEP"
sleep $SSVNC_EXTRA_SLEEP sleep $SSVNC_EXTRA_SLEEP
fi fi
echo "Running viewer:"
if [ "X$reverse" = "X" ]; then 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 vnc_hp=$localhost:$N
if [ "X$stunnel_exec" != "X" ]; then if [ "X$stunnel_exec" != "X" ]; then
vnc_hp="exec=$STUNNEL $tmp_cfg" vnc_hp="exec=$STUNNEL $tmp_cfg"
...@@ -2480,19 +3113,16 @@ if [ "X$reverse" = "X" ]; then ...@@ -2480,19 +3113,16 @@ if [ "X$reverse" = "X" ]; then
fi fi
fi fi
else else
echo "Running viewer:"
echo "" echo ""
echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode." echo "NOTE: Press Ctrl-C to terminate viewer LISTEN mode."
echo "" echo ""
trap "final" 0 2 15
N2=$N N2=$N
if [ "X$VNCVIEWER_IS_REALVNC4" = "X1" ]; then N2_trim=`echo "$N2" | sed -e 's/://g'`
N2=`echo "$N2" | sed -e 's/://g'` if [ $N2_trim -le 200 ]; then
if [ $N2 -le 200 ]; then N2_trim=`expr $N2_trim + 5500`
N2=`expr $N2 + 5500`
fi
fi fi
echo "$VNCVIEWERCMD" "$@" -listen $N2
trap "final" 0 2 15
echo ""
if [ "X$proxy" != "X" ]; then if [ "X$proxy" != "X" ]; then
if echo "$proxy" | grep -i '^vencrypt:' > /dev/null; then if echo "$proxy" | grep -i '^vencrypt:' > /dev/null; then
pstunnel=`echo "$proxy" | awk -F: '{print $2}'` pstunnel=`echo "$proxy" | awk -F: '{print $2}'`
...@@ -2502,13 +3132,30 @@ else ...@@ -2502,13 +3132,30 @@ else
PPROXY_DEST="$localhost:$pstunnel"; export PPROXY_DEST PPROXY_DEST="$localhost:$pstunnel"; export PPROXY_DEST
STUNNEL_ONCE=1; export STUNNEL_ONCE STUNNEL_ONCE=1; export STUNNEL_ONCE
STUNNEL_MAX_CLIENTS=1; export STUNNEL_MAX_CLIENTS 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 else
PPROXY_REVERSE="$localhost:$port"; export PPROXY_REVERSE PPROXY_REVERSE="$localhost:$port"; export PPROXY_REVERSE
PPROXY_SLEEP=1; export PPROXY_SLEEP; PPROXY_SLEEP=1; export PPROXY_SLEEP;
fi fi
PPROXY_KILLPID=+1; export PPROXY_KILLPID; PPROXY_KILLPID=+1; export PPROXY_KILLPID;
$ptmp & $ptmp &
# Important to have no extra pids generated between here and VNCVIEWERCMD
fi fi
if [ "X$VNCVIEWER_IS_REALVNC4" = "X1" ]; then
N2=$N2_trim
fi
echo "$VNCVIEWERCMD" "$@" -listen $N2
echo ""
$VNCVIEWERCMD "$@" -listen $N2 $VNCVIEWERCMD "$@" -listen $N2
fi fi
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -119,13 +119,13 @@ authentication. ...@@ -119,13 +119,13 @@ authentication.
TightVNC supports several different compression methods to encode TightVNC supports several different compression methods to encode
screen updates; this option specifies a set of them to use in order of screen updates; this option specifies a set of them to use in order of
preference. Encodings are specified separated with spaces, and must preference. Encodings are specified separated with spaces, and must
thus be enclosed in quotes if more than one is specified. Available thus be enclosed in quotes if more than one is specified. Commas may be used to avoid spaces.
encodings, in default order for a remote connection, are "copyrect Available encodings, in default order for a remote connection, are
tight hextile zlib corre rre raw". For a local connection (to the same "copyrect tight hextile zlib corre rre raw". For a local connection
machine), the default order to try is "raw copyrect tight hextile zlib (to the same machine), the default order to try is "raw copyrect tight
corre rre". Raw encoding is always assumed as a last option if no hextile zlib corre rre". Raw encoding is always assumed as a last option
other encoding can be used for some reason. For more information on if no other encoding can be used for some reason. For more information
encodings, see the section ENCODINGS below. on encodings, see the section ENCODINGS below.
.TP .TP
\fB\-bgr233\fR \fB\-bgr233\fR
Always use the BGR233 format to encode pixel data. This reduces Always use the BGR233 format to encode pixel data. This reduces
...@@ -312,6 +312,11 @@ Disable bell. ...@@ -312,6 +312,11 @@ Disable bell.
Prefer raw encoding for localhost, default is Prefer raw encoding for localhost, default is
no, i.e. assumes you have a SSH tunnel instead. no, i.e. assumes you have a SSH tunnel instead.
.TP .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 \fB\-sendclipboard\fR
Send the X CLIPBOARD selection (i.e. Ctrl+C, Send the X CLIPBOARD selection (i.e. Ctrl+C,
Ctrl+V) instead of the X PRIMARY selection (mouse 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. ...@@ -530,7 +535,8 @@ Meta_R Super_L Super_R Hyper_L Hyper_R or Mode_switch.
Cursor Shape: ~ -nocursorshape Cursor Shape: ~ -nocursorshape
X11 Cursor: ~ -x11cursor X11 Cursor: ~ -x11cursor
Cursor Alphablend: ~ -alpha Cursor Alphablend: ~ -alpha
Toggle Tight/ZRLE: ~ -encodings ... Toggle Tight/Hextile: ~ -encodings hextile...
Toggle Tight/ZRLE: ~ -encodings zrle...
Toggle ZRLE/ZYWRLE: ~ -encodings zywrle... Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
Quality Level ~ -quality (both Tight and ZYWRLE) Quality Level ~ -quality (both Tight and ZYWRLE)
Compress Level ~ -compresslevel Compress Level ~ -compresslevel
......
#!/bin/sh #!/bin/sh
rm -rf ./src/tmp/* || exit 1 rm -rf ./src/tmp/* || exit 1
vers=1.0.24 vers=1.0.25
cd .. || exit 1 cd .. || exit 1
......
...@@ -664,7 +664,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/Vncviewer vnc_unixsrc/vncview ...@@ -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 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.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 @@ @@ -31,9 +31,9 @@
char *fallback_resources[] = { char *fallback_resources[] = {
...@@ -739,12 +739,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -739,12 +739,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
<ButtonPress>: SendRFBEvent()\\n\ <ButtonPress>: SendRFBEvent()\\n\
<ButtonRelease>: SendRFBEvent()\\n\ <ButtonRelease>: SendRFBEvent()\\n\
<Motion>: 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\ "*serverDialog.dialog.value.translations: #override\\n\
<Key>Return: ServerDialogDone()", <Key>Return: ServerDialogDone()",
+ "*userDialog.dialog.label: Username:", - "*passwordDialog.dialog.label: Password:",
+ "*userDialog.dialog.label: SSVNC: Enter Username",
+ "*userDialog.dialog.value:", + "*userDialog.dialog.value:",
+ "*userDialog.dialog.value.width: 150",
+ "*userDialog.dialog.value.translations: #override\\n\ + "*userDialog.dialog.value.translations: #override\\n\
+ <Key>Return: UserDialogDone()", + <Key>Return: UserDialogDone()",
+ +
...@@ -817,8 +823,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -817,8 +823,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ "*scaleNDialog.dialog.value.translations: #override\\n\ + "*scaleNDialog.dialog.value.translations: #override\\n\
+ <KeyRelease>Return: ScaleNDialogDone()", + <KeyRelease>Return: ScaleNDialogDone()",
+ +
"*passwordDialog.dialog.label: Password:", + "*passwordDialog.dialog.label: SSVNC: Enter Password",
"*passwordDialog.dialog.value:", "*passwordDialog.dialog.value:",
+ "*passwordDialog.dialog.value.width: 150",
"*passwordDialog.dialog.value.AsciiSink.echo: False", "*passwordDialog.dialog.value.AsciiSink.echo: False",
"*passwordDialog.dialog.value.translations: #override\\n\ "*passwordDialog.dialog.value.translations: #override\\n\
<Key>Return: PasswordDialogDone()", <Key>Return: PasswordDialogDone()",
...@@ -863,12 +870,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -863,12 +870,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
<KeyPress>: SendRFBEvent() HidePopup()", <KeyPress>: SendRFBEvent() HidePopup()",
- "*popupButtonCount: 8", - "*popupButtonCount: 8",
+ "*popupButtonCount: 42", + "*popupButtonCount: 44",
+ "*popupButtonBreak: 21", + "*popupButtonBreak: 22",
"*popup*button1.label: Dismiss popup", "*popup*button1.label: Dismiss popup",
"*popup*button1.translations: #override\\n\ "*popup*button1.translations: #override\\n\
@@ -84,7 +236,7 @@ @@ -84,7 +239,7 @@
"*popup*button2.translations: #override\\n\ "*popup*button2.translations: #override\\n\
<Btn1Down>,<Btn1Up>: Quit()", <Btn1Down>,<Btn1Up>: Quit()",
...@@ -877,7 +884,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -877,7 +884,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
"*popup*button3.type: toggle", "*popup*button3.type: toggle",
"*popup*button3.translations: #override\\n\ "*popup*button3.translations: #override\\n\
<Visible>: SetFullScreenState()\\n\ <Visible>: SetFullScreenState()\\n\
@@ -105,16 +257,418 @@ @@ -105,16 +260,426 @@
"*popup*button7.label: Send ctrl-alt-del", "*popup*button7.label: Send ctrl-alt-del",
"*popup*button7.translations: #override\\n\ "*popup*button7.translations: #override\\n\
<Btn1Down>,<Btn1Up>: SendRFBEvent(keydown,Control_L)\ <Btn1Down>,<Btn1Up>: SendRFBEvent(keydown,Control_L)\
...@@ -930,156 +937,164 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -930,156 +937,164 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ <Visible>: SetCursorAlphaState()\\n\ + <Visible>: SetCursorAlphaState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleCursorAlpha() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleCursorAlpha() HidePopup()",
+ +
+ "*popup*button15.label: Toggle Tight/ZRLE", + "*popup*button15.label: Toggle Tight/Hextile",
+ "*popup*button15.type: toggle", + "*popup*button15.type: toggle",
+ "*popup*button15.translations: #override\\n\ + "*popup*button15.translations: #override\\n\
+ <Visible>: SetZRLEState()\\n\ + <Visible>: SetHextileState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTightZRLE() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleTightHextile() HidePopup()",
+ +
+ "*popup*button16.label: Toggle ZRLE/ZYWRLE", + "*popup*button16.label: Toggle Tight/ZRLE",
+ "*popup*button16.type: toggle", + "*popup*button16.type: toggle",
+ "*popup*button16.translations: #override\\n\ + "*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\ + <Visible>: SetZYWRLEState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleZRLEZYWRLE() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleZRLEZYWRLE() HidePopup()",
+ +
+ "*popup*button17.label: Quality Level", + "*popup*button18.label: Quality Level",
+ "*popup*button17.translations: #override\\n\ + "*popup*button18.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowQuality()", + <Btn1Down>,<Btn1Up>: HidePopup() ShowQuality()",
+ +
+ "*popup*button18.label: Compress Level", + "*popup*button19.label: Compress Level",
+ "*popup*button18.translations: #override\\n\ + "*popup*button19.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowCompress()", + <Btn1Down>,<Btn1Up>: HidePopup() ShowCompress()",
+ +
+ "*popup*button19.label: Disable JPEG", + "*popup*button20.label: Disable JPEG",
+ "*popup*button19.type: toggle", + "*popup*button20.type: toggle",
+ "*popup*button19.translations: #override\\n\ + "*popup*button20.translations: #override\\n\
+ <Visible>: SetNOJPEGState()\\n\ + <Visible>: SetNOJPEGState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleJPEG() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleJPEG() HidePopup()",
+ +
+ "*popup*button20.label: TurboVNC Settings", + "*popup*button21.label: TurboVNC Settings",
+ "*popup*button20.translations: #override\\n\ + "*popup*button21.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowTurboVNC()", + <Btn1Down>,<Btn1Up>: HidePopup() ShowTurboVNC()",
+ +
+ "*popup*button21.label: Pipeline Updates", + "*popup*button22.label: Pipeline Updates",
+ "*popup*button21.type: toggle", + "*popup*button22.type: toggle",
+ "*popup*button21.translations: #override\\n\ + "*popup*button22.translations: #override\\n\
+ <Visible>: SetPipelineUpdates()\\n\ + <Visible>: SetPipelineUpdates()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() TogglePipelineUpdates() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() TogglePipelineUpdates() HidePopup()",
+ +
+ "*popup*button22.label: Full Color", + "*popup*button23.label: Full Color",
+ "*popup*button22.type: toggle", + "*popup*button23.type: toggle",
+ "*popup*button22.translations: #override\\n\ + "*popup*button23.translations: #override\\n\
+ <Visible>: SetFullColorState()\\n\ + <Visible>: SetFullColorState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleFullColor() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleFullColor() HidePopup()",
+ +
+ "*popup*button23.label: Grey Scale (16 & 8-bpp)", + "*popup*button24.label: Grey Scale (16 & 8-bpp)",
+ "*popup*button23.type: toggle", + "*popup*button24.type: toggle",
+ "*popup*button23.translations: #override\\n\ + "*popup*button24.translations: #override\\n\
+ <Visible>: SetGreyScaleState()\\n\ + <Visible>: SetGreyScaleState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleGreyScale() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleGreyScale() HidePopup()",
+ +
+ "*popup*button24.label: 16 bit color (BGR565)", + "*popup*button25.label: 16 bit color (BGR565)",
+ "*popup*button24.type: toggle", + "*popup*button25.type: toggle",
+ "*popup*button24.translations: #override\\n\ + "*popup*button25.translations: #override\\n\
+ <Visible>: Set16bppState()\\n\ + <Visible>: Set16bppState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle16bpp() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() Toggle16bpp() HidePopup()",
+ +
+ "*popup*button25.label: 8 bit color (BGR233)", + "*popup*button26.label: 8 bit color (BGR233)",
+ "*popup*button25.type: toggle", + "*popup*button26.type: toggle",
+ "*popup*button25.translations: #override\\n\ + "*popup*button26.translations: #override\\n\
+ <Visible>: Set8bppState()\\n\ + <Visible>: Set8bppState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle8bpp() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() Toggle8bpp() HidePopup()",
+ +
+ "*popup*button26.label: - 256 colors", + "*popup*button27.label: - 256 colors",
+ "*popup*button26.type: toggle", + "*popup*button27.type: toggle",
+ "*popup*button26.translations: #override\\n\ + "*popup*button27.translations: #override\\n\
+ <Visible>: Set256ColorsState()\\n\ + <Visible>: Set256ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle256Colors() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() Toggle256Colors() HidePopup()",
+ +
+ "*popup*button27.label: - 64 colors", + "*popup*button28.label: - 64 colors",
+ "*popup*button27.type: toggle", + "*popup*button28.type: toggle",
+ "*popup*button27.translations: #override\\n\ + "*popup*button28.translations: #override\\n\
+ <Visible>: Set64ColorsState()\\n\ + <Visible>: Set64ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle64Colors() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() Toggle64Colors() HidePopup()",
+ +
+ "*popup*button28.label: - 8 colors", + "*popup*button29.label: - 8 colors",
+ "*popup*button28.type: toggle", + "*popup*button29.type: toggle",
+ "*popup*button28.translations: #override\\n\ + "*popup*button29.translations: #override\\n\
+ <Visible>: Set8ColorsState()\\n\ + <Visible>: Set8ColorsState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() Toggle8Colors() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() Toggle8Colors() HidePopup()",
+ +
+ "*popup*button29.label: Scale Viewer", + "*popup*button30.label: Scale Viewer",
+ "*popup*button29.translations: #override\\n\ + "*popup*button30.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetScale()", + <Btn1Down>,<Btn1Up>: HidePopup() SetScale()",
+ +
+ "*popup*button30.label: Escape Keys: Toggle", + "*popup*button31.label: Escape Keys: Toggle",
+ "*popup*button30.type: toggle", + "*popup*button31.type: toggle",
+ "*popup*button30.translations: #override\\n\ + "*popup*button31.translations: #override\\n\
+ <Visible>: SetEscapeKeysState()\\n\ + <Visible>: SetEscapeKeysState()\\n\
+ <Btn1Down>, <Btn1Up>: toggle() ToggleEscapeActive() HidePopup()", + <Btn1Down>, <Btn1Up>: toggle() ToggleEscapeActive() HidePopup()",
+ +
+ "*popup*button31.label: Escape Keys: Help+Set", + "*popup*button32.label: Escape Keys: Help+Set",
+ "*popup*button31.translations: #override\\n\ + "*popup*button32.translations: #override\\n\
+ <Btn1Down>, <Btn1Up>: HidePopup() SetEscapeKeys()", + <Btn1Down>, <Btn1Up>: HidePopup() SetEscapeKeys()",
+ +
+ "*popup*button32.label: Set Y Crop (y-max)", + "*popup*button33.label: Set Y Crop (y-max)",
+ "*popup*button32.translations: #override\\n\ + "*popup*button33.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetYCrop()", + <Btn1Down>,<Btn1Up>: HidePopup() SetYCrop()",
+ +
+ "*popup*button33.label: Set Scrollbar Width", + "*popup*button34.label: Set Scrollbar Width",
+ "*popup*button33.translations: #override\\n\ + "*popup*button34.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() SetScbar()", + <Btn1Down>,<Btn1Up>: HidePopup() SetScbar()",
+ +
+ "*popup*button34.label: XGrabServer", + "*popup*button35.label: XGrabServer",
+ "*popup*button34.type: toggle", + "*popup*button35.type: toggle",
+ "*popup*button34.translations: #override\\n\ + "*popup*button35.translations: #override\\n\
+ <Visible>: SetXGrabState()\\n\ + <Visible>: SetXGrabState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleXGrab() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleXGrab() HidePopup()",
+ +
+ "*popup*button35.label: UltraVNC Extensions:", + "*popup*button36.label: UltraVNC Extensions:",
+ "*popup*button35.translations: #override\\n\ + "*popup*button36.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup()", + <Btn1Down>,<Btn1Up>: HidePopup()",
+ +
+ "*popup*button36.label: - Set 1/n Server Scale", + "*popup*button37.label: - Set 1/n Server Scale",
+ "*popup*button36.translations: #override\\n\ + "*popup*button37.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HidePopup() ShowScaleN()", + <Btn1Down>,<Btn1Up>: HidePopup() ShowScaleN()",
+ +
+ "*popup*button37.label: - Text Chat", + "*popup*button38.label: - Text Chat",
+ "*popup*button37.type: toggle", + "*popup*button38.type: toggle",
+ "*popup*button37.translations: #override\\n\ + "*popup*button38.translations: #override\\n\
+ <Visible>: SetTextChatState()\\n\ + <Visible>: SetTextChatState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTextChat() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleTextChat() HidePopup()",
+ +
+ "*popup*button38.label: - File Transfer", + "*popup*button39.label: - File Transfer",
+ "*popup*button38.type: toggle", + "*popup*button39.type: toggle",
+ "*popup*button38.translations: #override\\n\ + "*popup*button39.translations: #override\\n\
+ <Visible>: SetFileXferState()\\n\ + <Visible>: SetFileXferState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleFileXfer() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleFileXfer() HidePopup()",
+ +
+ "*popup*button39.label: - Single Window", + "*popup*button40.label: - Single Window",
+ "*popup*button39.type: toggle", + "*popup*button40.type: toggle",
+ "*popup*button39.translations: #override\\n\ + "*popup*button40.translations: #override\\n\
+ <Visible>: SetSingleWindowState()\\n\ + <Visible>: SetSingleWindowState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSingleWindow() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleSingleWindow() HidePopup()",
+ +
+ "*popup*button40.label: - Disable Remote Input", + "*popup*button41.label: - Disable Remote Input",
+ "*popup*button40.type: toggle", + "*popup*button41.type: toggle",
+ "*popup*button40.translations: #override\\n\ + "*popup*button41.translations: #override\\n\
+ <Visible>: SetServerInputState()\\n\ + <Visible>: SetServerInputState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleServerInput() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleServerInput() HidePopup()",
+ +
+ "*popup*button41.label: Send Clipboard not Primary", + "*popup*button42.label: Send Clipboard not Primary",
+ "*popup*button41.type: toggle", + "*popup*button42.type: toggle",
+ "*popup*button41.translations: #override\\n\ + "*popup*button42.translations: #override\\n\
+ <Visible>: SetSendClipboard()\\n\ + <Visible>: SetSendClipboard()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSendClipboard() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleSendClipboard() HidePopup()",
+ +
+ "*popup*button42.label: Send Selection Every time", + "*popup*button43.label: Send Selection Every time",
+ "*popup*button42.type: toggle", + "*popup*button43.type: toggle",
+ "*popup*button42.translations: #override\\n\ + "*popup*button43.translations: #override\\n\
+ <Visible>: SetSendAlways()\\n\ + <Visible>: SetSendAlways()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleSendAlways() HidePopup()", + <Btn1Down>,<Btn1Up>: toggle() ToggleSendAlways() HidePopup()",
+ +
+ "*popup*button44.label: ",
+
+ "*turboVNC*button0.label: Dismiss", + "*turboVNC*button0.label: Dismiss",
+ "*turboVNC*button0.translations: #override\\n\ + "*turboVNC*button0.translations: #override\\n\
+ <Btn1Down>,<Btn1Up>: HideTurboVNC()", + <Btn1Down>,<Btn1Up>: HideTurboVNC()",
...@@ -1301,7 +1316,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1301,7 +1316,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
NULL NULL
}; };
@@ -124,7 +678,7 @@ @@ -124,7 +689,7 @@
* from a dialog box. * from a dialog box.
*/ */
...@@ -1310,7 +1325,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1310,7 +1325,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
int vncServerPort = 0; int vncServerPort = 0;
@@ -135,6 +689,7 @@ @@ -135,6 +700,7 @@
*/ */
AppData appData; AppData appData;
...@@ -1318,7 +1333,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1318,7 +1333,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
static XtResource appDataResourceList[] = { static XtResource appDataResourceList[] = {
{"shareDesktop", "ShareDesktop", XtRBool, sizeof(Bool), {"shareDesktop", "ShareDesktop", XtRBool, sizeof(Bool),
@@ -155,14 +710,44 @@ @@ -155,14 +721,44 @@
{"userLogin", "UserLogin", XtRString, sizeof(String), {"userLogin", "UserLogin", XtRString, sizeof(String),
XtOffsetOf(AppData, userLogin), XtRImmediate, (XtPointer) 0}, XtOffsetOf(AppData, userLogin), XtRImmediate, (XtPointer) 0},
...@@ -1365,7 +1380,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1365,7 +1380,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"nColours", "NColours", XtRInt, sizeof(int), {"nColours", "NColours", XtRInt, sizeof(int),
XtOffsetOf(AppData, nColours), XtRImmediate, (XtPointer) 256}, XtOffsetOf(AppData, nColours), XtRImmediate, (XtPointer) 256},
@@ -179,9 +764,12 @@ @@ -179,9 +775,12 @@
{"requestedDepth", "RequestedDepth", XtRInt, sizeof(int), {"requestedDepth", "RequestedDepth", XtRInt, sizeof(int),
XtOffsetOf(AppData, requestedDepth), XtRImmediate, (XtPointer) 0}, XtOffsetOf(AppData, requestedDepth), XtRImmediate, (XtPointer) 0},
...@@ -1379,7 +1394,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1379,7 +1394,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"wmDecorationWidth", "WmDecorationWidth", XtRInt, sizeof(int), {"wmDecorationWidth", "WmDecorationWidth", XtRInt, sizeof(int),
XtOffsetOf(AppData, wmDecorationWidth), XtRImmediate, (XtPointer) 4}, XtOffsetOf(AppData, wmDecorationWidth), XtRImmediate, (XtPointer) 4},
@@ -191,6 +779,9 @@ @@ -191,6 +790,9 @@
{"popupButtonCount", "PopupButtonCount", XtRInt, sizeof(int), {"popupButtonCount", "PopupButtonCount", XtRInt, sizeof(int),
XtOffsetOf(AppData, popupButtonCount), XtRImmediate, (XtPointer) 0}, XtOffsetOf(AppData, popupButtonCount), XtRImmediate, (XtPointer) 0},
...@@ -1389,7 +1404,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1389,7 +1404,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"debug", "Debug", XtRBool, sizeof(Bool), {"debug", "Debug", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, debug), XtRImmediate, (XtPointer) False}, XtOffsetOf(AppData, debug), XtRImmediate, (XtPointer) False},
@@ -206,11 +797,13 @@ @@ -206,11 +808,13 @@
{"bumpScrollPixels", "BumpScrollPixels", XtRInt, sizeof(int), {"bumpScrollPixels", "BumpScrollPixels", XtRInt, sizeof(int),
XtOffsetOf(AppData, bumpScrollPixels), XtRImmediate, (XtPointer) 20}, XtOffsetOf(AppData, bumpScrollPixels), XtRImmediate, (XtPointer) 20},
...@@ -1404,7 +1419,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1404,7 +1419,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"enableJPEG", "EnableJPEG", XtRBool, sizeof(Bool), {"enableJPEG", "EnableJPEG", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, enableJPEG), XtRImmediate, (XtPointer) True}, XtOffsetOf(AppData, enableJPEG), XtRImmediate, (XtPointer) True},
@@ -218,14 +811,85 @@ @@ -218,14 +822,88 @@
{"useRemoteCursor", "UseRemoteCursor", XtRBool, sizeof(Bool), {"useRemoteCursor", "UseRemoteCursor", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, useRemoteCursor), XtRImmediate, (XtPointer) True}, XtOffsetOf(AppData, useRemoteCursor), XtRImmediate, (XtPointer) True},
...@@ -1413,6 +1428,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1413,6 +1428,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ +
+ {"useRawLocal", "UseRawLocal", XtRBool, sizeof(Bool), + {"useRawLocal", "UseRawLocal", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, useRawLocal), XtRImmediate, (XtPointer) False}, + XtOffsetOf(AppData, useRawLocal), XtRImmediate, (XtPointer) False},
+
+ {"notty", "NoTty", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, notty), XtRImmediate, (XtPointer) False},
+ +
{"useX11Cursor", "UseX11Cursor", XtRBool, sizeof(Bool), {"useX11Cursor", "UseX11Cursor", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, useX11Cursor), XtRImmediate, (XtPointer) False}, XtOffsetOf(AppData, useX11Cursor), XtRImmediate, (XtPointer) False},
...@@ -1492,7 +1510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1492,7 +1510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
}; };
@@ -242,8 +906,28 @@ @@ -242,8 +920,29 @@
{"-noraiseonbeep", "*raiseOnBeep", XrmoptionNoArg, "False"}, {"-noraiseonbeep", "*raiseOnBeep", XrmoptionNoArg, "False"},
{"-passwd", "*passwordFile", XrmoptionSepArg, 0}, {"-passwd", "*passwordFile", XrmoptionSepArg, 0},
{"-user", "*userLogin", XrmoptionSepArg, 0}, {"-user", "*userLogin", XrmoptionSepArg, 0},
...@@ -1518,11 +1536,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1518,11 +1536,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"-env", "*envDummy", XrmoptionSepArg, 0}, + {"-env", "*envDummy", XrmoptionSepArg, 0},
+ {"-ycrop", "*yCrop", XrmoptionSepArg, 0}, + {"-ycrop", "*yCrop", XrmoptionSepArg, 0},
+ {"-rawlocal", "*useRawLocal", XrmoptionNoArg, "True"}, + {"-rawlocal", "*useRawLocal", XrmoptionNoArg, "True"},
+ {"-notty", "*notty", XrmoptionNoArg, "True"},
+ {"-alpha", "*useCursorAlpha", XrmoptionNoArg, "True"}, + {"-alpha", "*useCursorAlpha", XrmoptionNoArg, "True"},
{"-owncmap", "*forceOwnCmap", XrmoptionNoArg, "True"}, {"-owncmap", "*forceOwnCmap", XrmoptionNoArg, "True"},
{"-truecolor", "*forceTrueColour", XrmoptionNoArg, "True"}, {"-truecolor", "*forceTrueColour", XrmoptionNoArg, "True"},
{"-truecolour", "*forceTrueColour", XrmoptionNoArg, "True"}, {"-truecolour", "*forceTrueColour", XrmoptionNoArg, "True"},
@@ -253,8 +937,27 @@ @@ -253,8 +952,27 @@
{"-nojpeg", "*enableJPEG", XrmoptionNoArg, "False"}, {"-nojpeg", "*enableJPEG", XrmoptionNoArg, "False"},
{"-nocursorshape", "*useRemoteCursor", XrmoptionNoArg, "False"}, {"-nocursorshape", "*useRemoteCursor", XrmoptionNoArg, "False"},
{"-x11cursor", "*useX11Cursor", XrmoptionNoArg, "True"}, {"-x11cursor", "*useX11Cursor", XrmoptionNoArg, "True"},
...@@ -1552,7 +1571,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1552,7 +1571,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
}; };
int numCmdLineOptions = XtNumber(cmdLineOptions); int numCmdLineOptions = XtNumber(cmdLineOptions);
@@ -267,16 +970,98 @@ @@ -267,16 +985,100 @@
static XtActionsRec actions[] = { static XtActionsRec actions[] = {
{"SendRFBEvent", SendRFBEvent}, {"SendRFBEvent", SendRFBEvent},
{"ShowPopup", ShowPopup}, {"ShowPopup", ShowPopup},
...@@ -1589,6 +1608,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1589,6 +1608,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"Toggle8Colors", Toggle8Colors}, + {"Toggle8Colors", Toggle8Colors},
+ {"ToggleGreyScale", ToggleGreyScale}, + {"ToggleGreyScale", ToggleGreyScale},
+ {"ToggleTightZRLE", ToggleTightZRLE}, + {"ToggleTightZRLE", ToggleTightZRLE},
+ {"ToggleTightHextile", ToggleTightHextile},
+ {"ToggleZRLEZYWRLE", ToggleZRLEZYWRLE}, + {"ToggleZRLEZYWRLE", ToggleZRLEZYWRLE},
+ {"ToggleViewOnly", ToggleViewOnly}, + {"ToggleViewOnly", ToggleViewOnly},
+ {"ToggleJPEG", ToggleJPEG}, + {"ToggleJPEG", ToggleJPEG},
...@@ -1625,6 +1645,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1625,6 +1645,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"Set8ColorsState", Set8ColorsState}, + {"Set8ColorsState", Set8ColorsState},
+ {"SetGreyScaleState", SetGreyScaleState}, + {"SetGreyScaleState", SetGreyScaleState},
+ {"SetZRLEState", SetZRLEState}, + {"SetZRLEState", SetZRLEState},
+ {"SetHextileState", SetHextileState},
+ {"SetZYWRLEState", SetZYWRLEState}, + {"SetZYWRLEState", SetZYWRLEState},
+ {"SetNOJPEGState", SetNOJPEGState}, + {"SetNOJPEGState", SetNOJPEGState},
+ {"SetScaleNState", SetScaleNState}, + {"SetScaleNState", SetScaleNState},
...@@ -1651,7 +1672,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1651,7 +1672,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
}; };
@@ -302,11 +1087,14 @@ @@ -302,11 +1104,14 @@
void void
usage(void) usage(void)
{ {
...@@ -1668,7 +1689,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1668,7 +1689,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
" %s [<OPTIONS>] -listen [<DISPLAY#>]\n" " %s [<OPTIONS>] -listen [<DISPLAY#>]\n"
" %s -help\n" " %s -help\n"
"\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" " -autopass\n"
"\n" "\n"
"Option names may be abbreviated, e.g. -bgr instead of -bgr233.\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 ...@@ -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" + " -rawlocal Prefer raw encoding for localhost, default is\n"
+ " no, i.e. assumes you have a SSH tunnel instead.\n" + " no, i.e. assumes you have a SSH tunnel instead.\n"
+ "\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" + " -sendclipboard Send the X CLIPBOARD selection (i.e. Ctrl+C,\n"
+ " Ctrl+V) instead of the X PRIMARY selection (mouse\n" + " Ctrl+V) instead of the X PRIMARY selection (mouse\n"
+ " select and middle button paste.)\n" + " select and middle button paste.)\n"
...@@ -1974,7 +2028,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -1974,7 +2028,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ " Cursor Shape: ~ -nocursorshape\n" + " Cursor Shape: ~ -nocursorshape\n"
+ " X11 Cursor: ~ -x11cursor\n" + " X11 Cursor: ~ -x11cursor\n"
+ " Cursor Alphablend: ~ -alpha\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" + " Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...\n"
+ " Quality Level ~ -quality (both Tight and ZYWRLE)\n" + " Quality Level ~ -quality (both Tight and ZYWRLE)\n"
+ " Compress Level ~ -compresslevel\n" + " Compress Level ~ -compresslevel\n"
...@@ -2020,7 +2075,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -2020,7 +2075,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/* /*
@@ -347,73 +1474,214 @@ @@ -347,73 +1516,223 @@
void void
GetArgsAndResources(int argc, char **argv) GetArgsAndResources(int argc, char **argv)
{ {
...@@ -2048,8 +2103,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -2048,8 +2103,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ appData.useCursorAlpha = True; + appData.useCursorAlpha = True;
+ } + }
+ if (getenv("VNCVIEWER_POPUP_FIX")) { + if (getenv("VNCVIEWER_POPUP_FIX")) {
+ if (getenv("NOPOPUPFIX")) {
+ ;
+ } else if (!strcmp(getenv("VNCVIEWER_POPUP_FIX"), "0")) {
+ ;
+ } else {
+ appData.popupFix = True; + appData.popupFix = True;
+ } + }
+ }
+ if (getenv("VNCVIEWER_GRAB_SERVER")) { + if (getenv("VNCVIEWER_GRAB_SERVER")) {
+ appData.grabAll = True; + appData.grabAll = True;
+ } + }
...@@ -2074,6 +2135,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -2074,6 +2135,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ if (getenv("VNCVIEWER_RAWLOCAL")) { + if (getenv("VNCVIEWER_RAWLOCAL")) {
+ appData.useRawLocal = True; + appData.useRawLocal = True;
+ } + }
+ if (getenv("VNCVIEWER_NOTTY") || getenv("SSVNC_VNCVIEWER_NOTTY")) {
+ appData.notty = True;
+ }
+ if (getenv("VNCVIEWER_SBWIDTH")) { + if (getenv("VNCVIEWER_SBWIDTH")) {
+ int n = atoi(getenv("VNCVIEWER_SBWIDTH")); + int n = atoi(getenv("VNCVIEWER_SBWIDTH"));
+ if (n != 0) { + if (n != 0) {
...@@ -2231,7 +2295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -2231,7 +2295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ +
+ if (argc == 1) { + if (argc == 1) {
+ vncServerName = DoServerDialog(); + vncServerName = DoServerDialog();
+ if (!isatty(0)) { + if (!use_tty()) {
+ appData.passwordDialog = True; + appData.passwordDialog = True;
+ } + }
+ } else if (argc != 2) { + } else if (argc != 2) {
...@@ -2239,7 +2303,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v ...@@ -2239,7 +2303,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ } else { + } else {
+ vncServerName = argv[1]; + vncServerName = argv[1];
+ +
+ if (!isatty(0)) { + if (!use_tty()) {
+ appData.passwordDialog = True; + appData.passwordDialog = True;
+ } + }
+ if (vncServerName[0] == '-') { + if (vncServerName[0] == '-') {
...@@ -3623,7 +3687,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/cursor.c vnc_unixsrc/vncviewe ...@@ -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 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.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 @@ @@ -28,28 +28,487 @@
#include <X11/extensions/XShm.h> #include <X11/extensions/XShm.h>
#endif #endif
...@@ -4215,8 +4279,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -4215,8 +4279,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ } + }
+ +
+ create_image(); + create_image();
} +}
+
+static Widget scrollbar_y = NULL; +static Widget scrollbar_y = NULL;
+ +
+static int xsst = 2; +static int xsst = 2;
...@@ -4255,8 +4319,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -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); + XtVaSetValues(w, XtNtopOfThumb, *(XtArgVal*)&t, XtNshown, *(XtArgVal*)&s, NULL);
+ } + }
+ } + }
+} }
+
+extern double dnow(void); +extern double dnow(void);
+ +
+void check_things() { +void check_things() {
...@@ -4519,18 +4583,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -4519,18 +4583,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+#else +#else
+#define nfix(i, n) ( i < 0 ? 0 : ( (i >= n) ? (n - 1) : i ) ) +#define nfix(i, n) ( i < 0 ? 0 : ( (i >= n) ? (n - 1) : i ) )
+#endif +#endif
+
- XChangeWindowAttributes(dpy, desktopWin, valuemask, &attr);
+int scale_round(int len, double fac) { +int scale_round(int len, double fac) {
+ double eps = 0.000001; + double eps = 0.000001;
+
- XChangeWindowAttributes(dpy, desktopWin, valuemask, &attr);
+ len = (int) (len * fac + eps); + len = (int) (len * fac + eps);
+ if (len < 1) { + if (len < 1) {
+ len = 1; + len = 1;
+ } + }
+ return len; + return len;
+} }
+
+static void scale_rect(double factor_x, double factor_y, int blend, int interpolate, +static void scale_rect(double factor_x, double factor_y, int blend, int interpolate,
+ int *px, int *py, int *pw, int *ph, int solid) { + 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 ...@@ -5058,8 +5122,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ markit: + markit:
+/* End taken from x11vnc scale: */ +/* End taken from x11vnc scale: */
+ if (0) {} + if (0) {}
} +}
+
+void do_scale_stats(int width, int height) { +void do_scale_stats(int width, int height) {
+ static double calls = 0.0, sum = 0.0, var = 0.0, last = 0.0; + static double calls = 0.0, sum = 0.0, var = 0.0, last = 0.0;
+ double A = width * height; + double A = width * height;
...@@ -5237,6 +5301,13 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -5237,6 +5301,13 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (y + height < si.framebufferHeight) height++; + 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) { - if (ev->xexpose.x + ev->xexpose.width > si.framebufferWidth) {
- ev->xexpose.width = si.framebufferWidth - ev->xexpose.x; - 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 ...@@ -5251,13 +5322,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
- SendFramebufferUpdateRequest(ev->xexpose.x, ev->xexpose.y, - SendFramebufferUpdateRequest(ev->xexpose.x, ev->xexpose.y,
- ev->xexpose.width, ev->xexpose.height, False); - ev->xexpose.width, ev->xexpose.height, False);
- break; - break;
+ if (x + width > si.framebufferWidth) {
+ width = si.framebufferWidth - x;
+ if (width <= 0) {
+ break;
+ }
+ }
+
+ if (y + height > si.framebufferHeight) { + if (y + height > si.framebufferHeight) {
+ height = si.framebufferHeight - y; + height = si.framebufferHeight - y;
+ if (height <= 0) { + if (height <= 0) {
...@@ -5337,8 +5401,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -5337,8 +5401,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ break; + break;
} }
+ check_things(); + check_things();
+} }
+
+extern Position desktopX, desktopY; +extern Position desktopX, desktopY;
+ +
+void scroll_desktop(int horiz, int vert, double amount) { +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 ...@@ -5405,8 +5469,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ } else if (amount == -1.0) { + } else if (amount == -1.0) {
+ XSync(dpy, False); + XSync(dpy, False);
+ } + }
} +}
+
+void scale_desktop(int bigger, double frac) { +void scale_desktop(int bigger, double frac) {
+ double current, new; + double current, new;
+ char tmp[100]; + char tmp[100];
...@@ -5622,7 +5686,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -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 * SendRFBEvent is an action which sends an RFB event. It can be used in two
@@ -201,127 +1948,322 @@ @@ -201,127 +1948,324 @@
* button2 down, 3 for both, etc). * button2 down, 3 for both, etc).
*/ */
...@@ -5719,7 +5783,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -5719,7 +5783,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (!do_escape) { + if (!do_escape) {
+ escape_drag_in_progress = 0; + escape_drag_in_progress = 0;
+ } + }
+
- if (appData.viewOnly) return;
+ if (do_escape) { + if (do_escape) {
+ int W = si.framebufferWidth; + int W = si.framebufferWidth;
+ int H = si.framebufferHeight; + int H = si.framebufferHeight;
...@@ -5779,6 +5844,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -5779,6 +5844,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ ToggleX11Cursor(w, ev, params, num_params); + ToggleX11Cursor(w, ev, params, num_params);
+ } else if (ks == XK_z || ks == XK_Z) { + } else if (ks == XK_z || ks == XK_Z) {
+ ToggleTightZRLE(w, ev, params, num_params); + 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) { + } else if (ks == XK_f || ks == XK_F) {
+ ToggleFileXfer(w, ev, params, num_params); + ToggleFileXfer(w, ev, params, num_params);
+ } else if (ks == XK_V) { + } else if (ks == XK_V) {
...@@ -5840,8 +5907,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -5840,8 +5907,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (appData.viewOnly) { + if (appData.viewOnly) {
+ return; + return;
+ } + }
+
- if (appData.viewOnly) return;
+ if (*num_params != 0) { + if (*num_params != 0) {
+ if (strncasecmp(params[0],"key",3) == 0) { + if (strncasecmp(params[0],"key",3) == 0) {
+ if (*num_params != 2) { + if (*num_params != 2) {
...@@ -6005,11 +6071,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6005,11 +6071,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ XLookupString(&ev->xkey, keyname, 256, &ks, NULL); + XLookupString(&ev->xkey, keyname, 256, &ks, NULL);
- switch (ev->type) { - switch (ev->type) {
+ if (IsModifierKey(ks)) { -
+ ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
+ modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
+ }
- case MotionNotify: - case MotionNotify:
- while (XCheckTypedWindowEvent(dpy, desktopWin, MotionNotify, ev)) - while (XCheckTypedWindowEvent(dpy, desktopWin, MotionNotify, ev))
- ; /* discard all queued motion notify events */ - ; /* discard all queued motion notify events */
...@@ -6038,12 +6100,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6038,12 +6100,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
- ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0); - ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
- modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress); - modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
- } - }
+ SendKeyEvent(ks, (ev->type == KeyPress)); + if (IsModifierKey(ks)) {
+ return; + ks = XKeycodeToKeysym(dpy, ev->xkey.keycode, 0);
+ modifierPressed[ev->xkey.keycode] = (ev->type == KeyPress);
+ }
- SendKeyEvent(ks, (ev->type == KeyPress)); - SendKeyEvent(ks, (ev->type == KeyPress));
- return; - return;
- + SendKeyEvent(ks, (ev->type == KeyPress));
+ return;
- default: - default:
- fprintf(stderr,"Invalid event passed to SendRFBEvent\n"); - 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 ...@@ -6053,7 +6119,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
} }
@@ -329,26 +2271,194 @@ @@ -329,26 +2273,207 @@
* CreateDotCursor. * CreateDotCursor.
*/ */
...@@ -6120,7 +6186,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -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); + cursor = XCreatePixmapCursor(dpy, src, msk, &fg, &bg, 1, 1);
+ XFreePixmap(dpy, src); + XFreePixmap(dpy, src);
+ XFreePixmap(dpy, msk); + XFreePixmap(dpy, msk);
+
- return cursor;
+ return cursor; + return cursor;
+} +}
+#endif +#endif
...@@ -6128,7 +6195,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6128,7 +6195,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+int skip_maybe_sync = 0; +int skip_maybe_sync = 0;
+void maybe_sync(int width, int height) { +void maybe_sync(int width, int height) {
+ static int singles = 0, always_skip = -1; + static int singles = 0, always_skip = -1;
+ int singles_max = 32; + int singles_max = 64;
+ +
+ if (always_skip < 0) { + if (always_skip < 0) {
+ if (getenv("SSVNC_NO_MAYBE_SYNC")) { + if (getenv("SSVNC_NO_MAYBE_SYNC")) {
...@@ -6140,6 +6207,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6140,6 +6207,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ if (skip_maybe_sync || always_skip) { + if (skip_maybe_sync || always_skip) {
+ return; + return;
+ } + }
+#if 0
+ if (width > 1 || height > 1) { + if (width > 1 || height > 1) {
+ XSync(dpy, False); + XSync(dpy, False);
+ singles = 0; + singles = 0;
...@@ -6149,6 +6217,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6149,6 +6217,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ XSync(dpy, False); + 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. + * FillImage.
...@@ -6244,8 +6324,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6244,8 +6324,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
+ dst -= Bpl; + dst -= Bpl;
+ } + }
+ } + }
+
- return cursor;
+ if (image_scale && !did2) { + if (image_scale && !did2) {
+ im = image; + im = image;
+ Bpp = im->bits_per_pixel / 8; + Bpp = im->bits_per_pixel / 8;
...@@ -6264,7 +6343,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview ...@@ -6264,7 +6343,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
} }
@@ -359,38 +2469,37 @@ @@ -359,38 +2484,37 @@
void void
CopyDataToScreen(char *buf, int x, int y, int width, int height) 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 ...@@ -6332,7 +6411,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/desktop.c vnc_unixsrc/vncview
} }
@@ -401,62 +2510,297 @@ @@ -401,62 +2525,297 @@
static void static void
CopyBGR233ToScreen(CARD8 *buf, int x, int y, int width, int height) 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 ...@@ -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 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.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 +++ vnc_unixsrc/vncviewer/dialogs.c 2009-10-27 00:14:05.000000000 -0400
@@ -25,7 +25,395 @@ @@ -25,75 +25,549 @@
#include <X11/Xaw/Dialog.h> #include <X11/Xaw/Dialog.h>
static Bool serverDialogDone = False; static Bool serverDialogDone = False;
...@@ -6703,6 +6782,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6703,6 +6782,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+extern void popupFixer(Widget wid); +extern void popupFixer(Widget wid);
+ +
+int use_tty(void) {
+ if (appData.notty) {
+ return 0;
+ } else if (!isatty(0)) {
+ return 0;
+ }
+ return 1;
+}
+
+void +void
+ScaleDialogDone(Widget w, XEvent *event, String *params, Cardinal *num_params) +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 ...@@ -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 * +char *
+DoScaleDialog() +DoScaleDialog()
+{ +{
...@@ -6771,8 +6863,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6771,8 +6863,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if (0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
...@@ -6787,8 +6878,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -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); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "ScaleDialogDone()"); + wm_delete(pshell, "ScaleDialogDone()");
...@@ -6821,8 +6914,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6821,8 +6914,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
...@@ -6838,6 +6930,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6838,6 +6930,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ if (appData.popupFix) { + if (appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ /* too big */
+ if (0) xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "EscapeDialogDone()"); + wm_delete(pshell, "EscapeDialogDone()");
...@@ -6875,13 +6970,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6875,13 +6970,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (1 && appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "YCropDialogDone()"); + wm_delete(pshell, "YCropDialogDone()");
...@@ -6919,13 +7015,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6919,13 +7015,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (1 && appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "ScbarDialogDone()"); + wm_delete(pshell, "ScbarDialogDone()");
...@@ -6964,13 +7061,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -6964,13 +7061,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ dialog_over(pshell); + dialog_over(pshell);
+ wm_delete(pshell, "ScaleNDialogDone()"); + wm_delete(pshell, "ScaleNDialogDone()");
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "ScaleNDialogDone()"); + wm_delete(pshell, "ScaleNDialogDone()");
...@@ -7008,13 +7106,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7008,13 +7106,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (1 && appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "QualityDialogDone() HideQuality()"); + wm_delete(pshell, "QualityDialogDone() HideQuality()");
...@@ -7046,7 +7145,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7046,7 +7145,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ char *compressValue; + char *compressValue;
+ char *valueString; + char *valueString;
+ +
+fprintf(stderr, "compress start:\n"); + fprintf(stderr, "compress start:\n");
+ +
+ pshell = XtVaCreatePopupShell("compressDialog", transientShellWidgetClass, + pshell = XtVaCreatePopupShell("compressDialog", transientShellWidgetClass,
+ toplevel, NULL); + toplevel, NULL);
...@@ -7054,13 +7153,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7054,13 +7153,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (1 && appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ dialog_input(pshell); + dialog_input(pshell);
+ wm_delete(pshell, "CompressDialogDone() HideCompress()"); + wm_delete(pshell, "CompressDialogDone() HideCompress()");
...@@ -7075,7 +7175,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7075,7 +7175,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ rmNL(valueString); + rmNL(valueString);
+ compressValue = XtNewString(valueString); + compressValue = XtNewString(valueString);
+ +
+fprintf(stderr, "compress done: %s\n", compressValue); + fprintf(stderr, "compress done: %s\n", compressValue);
+ +
+ XtPopdown(pshell); + XtPopdown(pshell);
+ return compressValue; + return compressValue;
...@@ -7083,43 +7183,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7083,43 +7183,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
void void
ServerDialogDone(Widget w, XEvent *event, String *params, Cardinal *num_params) 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); 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); + 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); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ //dialog_input(pshell); + //dialog_input(pshell);
+ wm_delete(pshell, "ServerDialogDone()"); + wm_delete(pshell, "ServerDialogDone()");
+ +
serverDialogDone = False; + serverDialogDone = False;
+
while (!serverDialogDone) { + while (!serverDialogDone) {
@@ -56,6 +452,7 @@ + XtAppProcessEvent(appContext, XtIMAll);
} + }
+
valueString = XawDialogGetValueString(dialog); + valueString = XawDialogGetValueString(dialog);
+ rmNL(valueString); + rmNL(valueString);
vncServerName = XtNewString(valueString); + vncServerName = XtNewString(valueString);
XtPopdown(pshell); - while (!serverDialogDone) {
@@ -63,6 +460,50 @@ - 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(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{ +{
+ userDialogDone = True; + userDialogDone = True;
+} +}
+
- XtPopdown(pshell);
- return vncServerName;
+char * +char *
+DoUserDialog() +DoUserDialog()
+{ +{
...@@ -7133,13 +7263,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7133,13 +7263,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ dialog_over(pshell); + dialog_over(pshell);
+ +
+ XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, + if(0) XtMoveWidget(pshell, WidthOfScreen(XtScreen(pshell))*2/5, HeightOfScreen(XtScreen(pshell))*2/5);
+ HeightOfScreen(XtScreen(pshell))*2/5);
+ XtPopup(pshell, XtGrabNonexclusive); + XtPopup(pshell, XtGrabNonexclusive);
+ XtRealizeWidget(pshell); + XtRealizeWidget(pshell);
+ +
+ if (appData.popupFix) { + if (0 && appData.popupFix) {
+ popupFixer(pshell); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ //dialog_input(pshell); + //dialog_input(pshell);
+ wm_delete(pshell, "UserDialogDone()"); + wm_delete(pshell, "UserDialogDone()");
...@@ -7156,40 +7287,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview ...@@ -7156,40 +7287,73 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/dialogs.c vnc_unixsrc/vncview
+ +
+ XtPopdown(pshell); + XtPopdown(pshell);
+ return userName; + return userName;
+} }
+
+void void
PasswordDialogDone(Widget w, XEvent *event, String *params, PasswordDialogDone(Widget w, XEvent *event, String *params,
Cardinal *num_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); 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); + 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); + popupFixer(pshell);
+ } else {
+ xtmove(pshell);
+ } + }
+ //dialog_input(pshell); + //dialog_input(pshell);
+ wm_delete(pshell, "PasswordDialogDone()"); + wm_delete(pshell, "PasswordDialogDone()");
+ +
passwordDialogDone = False; + passwordDialogDone = False;
+
while (!passwordDialogDone) { + while (!passwordDialogDone) {
@@ -92,6 +541,7 @@ + XtAppProcessEvent(appContext, XtIMAll);
} + }
+
valueString = XawDialogGetValueString(dialog); + valueString = XawDialogGetValueString(dialog);
+ rmNL(valueString); + 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 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.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 +++ 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 ...@@ -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 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.orig/vncviewer/hextile.c 2007-02-17 22:33:46.000000000 -0500
+++ vnc_unixsrc/vncviewer/hextile.c 2008-10-05 15:16:24.000000000 -0400 +++ vnc_unixsrc/vncviewer/hextile.c 2009-10-16 22:54:40.000000000 -0400
@@ -30,6 +30,18 @@ @@ -30,6 +30,21 @@
#define CARDBPP CONCAT2E(CARD,BPP) #define CARDBPP CONCAT2E(CARD,BPP)
#define GET_PIXEL CONCAT2E(GET_PIXEL,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 ...@@ -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); \ + XFillRectangle(dpy, desktopWin, gc, x, y, w, h); \
+ } \ + } \
+ } + }
+
+extern int skip_maybe_sync;
+extern void maybe_sync(int w, int h);
+ +
static Bool static Bool
HandleHextileBPP (int rx, int ry, int rw, int rh) 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; return False;
#if (BPP == 8) #if (BPP == 8)
...@@ -8246,12 +8461,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8246,12 +8461,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
gcv.foreground = BGR233ToPixel[bg]; gcv.foreground = BGR233ToPixel[bg];
- else - else
+ } else + } else
#endif +#endif
+#if (BPP == 16) +#if (BPP == 16)
+ if (appData.useBGR565) { + if (appData.useBGR565) {
+ gcv.foreground = BGR565ToPixel[bg]; + gcv.foreground = BGR565ToPixel[bg];
+ } else + } else
+#endif #endif
+ { + {
gcv.foreground = bg; gcv.foreground = bg;
+ } + }
...@@ -8267,7 +8482,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8267,7 +8482,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
if (subencoding & rfbHextileForegroundSpecified) if (subencoding & rfbHextileForegroundSpecified)
if (!ReadFromRFBServer((char *)&fg, sizeof(fg))) if (!ReadFromRFBServer((char *)&fg, sizeof(fg)))
@@ -101,14 +124,25 @@ @@ -101,14 +149,25 @@
sh = rfbHextileExtractH(*ptr); sh = rfbHextileExtractH(*ptr);
ptr++; ptr++;
#if (BPP == 8) #if (BPP == 8)
...@@ -8276,12 +8491,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8276,12 +8491,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
gcv.foreground = BGR233ToPixel[fg]; gcv.foreground = BGR233ToPixel[fg];
- else - else
+ } else + } else
+#endif #endif
+#if (BPP == 16) +#if (BPP == 16)
+ if (appData.useBGR565) { + if (appData.useBGR565) {
+ gcv.foreground = BGR565ToPixel[fg]; + gcv.foreground = BGR565ToPixel[fg];
+ } else + } else
#endif +#endif
+ { + {
gcv.foreground = fg; gcv.foreground = fg;
+ } + }
...@@ -8297,7 +8512,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8297,7 +8512,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
} }
} else { } else {
@@ -116,13 +150,22 @@ @@ -116,13 +175,22 @@
return False; return False;
#if (BPP == 8) #if (BPP == 8)
...@@ -8322,7 +8537,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8322,7 +8537,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
for (i = 0; i < nSubrects; i++) { for (i = 0; i < nSubrects; i++) {
sx = rfbHextileExtractX(*ptr); sx = rfbHextileExtractX(*ptr);
@@ -131,7 +174,11 @@ @@ -131,7 +199,11 @@
sw = rfbHextileExtractW(*ptr); sw = rfbHextileExtractW(*ptr);
sh = rfbHextileExtractH(*ptr); sh = rfbHextileExtractH(*ptr);
ptr++; ptr++;
...@@ -8334,7 +8549,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -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; return True;
} }
...@@ -8342,7 +8557,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview ...@@ -8342,7 +8557,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/hextile.c vnc_unixsrc/vncview
+#undef FillRectangle +#undef FillRectangle
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewer/listen.c 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.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 @@ @@ -32,6 +32,7 @@
#define FLASHDELAY 1 /* seconds */ #define FLASHDELAY 1 /* seconds */
...@@ -8351,10 +8566,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8351,10 +8566,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
int listenPort = 0, flashPort = 0; int listenPort = 0, flashPort = 0;
static Font flashFont; static Font flashFont;
@@ -40,6 +41,75 @@ @@ -40,6 +41,77 @@
static void flashDisplay(Display *d, char *user); static void flashDisplay(Display *d, char *user);
static Bool AllXEventsPredicate(Display *d, XEvent *ev, char *arg); 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) { +static int accept_popup_check(int *argc, char **argv, char *sip, char *sih) {
+ char line[16]; + char line[16];
...@@ -8365,7 +8581,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8365,7 +8581,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
+ return 1; + return 1;
+ } + }
+ +
+ if (!dopopup) { + if (!dopopup && use_tty()) {
+ raiseme(1);
+ fprintf(stderr, "Accept VNC connection? y/[n] "); + fprintf(stderr, "Accept VNC connection? y/[n] ");
+ fgets(line, sizeof(line), stdin); + fgets(line, sizeof(line), stdin);
+ if (!strchr(line, 'y') && !strchr(line, 'Y')) { + if (!strchr(line, 'y') && !strchr(line, 'Y')) {
...@@ -8427,7 +8644,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8427,7 +8644,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
/* /*
* listenForIncomingConnections() - listen for incoming connections from * listenForIncomingConnections() - listen for incoming connections from
* servers, and fork a new process to deal with each connection. We must do * servers, and fork a new process to deal with each connection. We must do
@@ -58,8 +128,11 @@ @@ -58,8 +130,11 @@
int n; int n;
int i; int i;
char *displayname = NULL; char *displayname = NULL;
...@@ -8439,7 +8656,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8439,7 +8656,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
for (i = 1; i < *argc; i++) { for (i = 1; i < *argc; i++) {
if (strcmp(argv[i], "-display") == 0 && i+1 < *argc) { if (strcmp(argv[i], "-display") == 0 && i+1 < *argc) {
@@ -108,23 +181,40 @@ @@ -108,23 +183,40 @@
exit(1); exit(1);
} }
...@@ -8486,7 +8703,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8486,7 +8703,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
/* discard any X events */ /* discard any X events */
while (XCheckIfEvent(d, &ev, AllXEventsPredicate, NULL)) while (XCheckIfEvent(d, &ev, AllXEventsPredicate, NULL))
@@ -132,12 +222,24 @@ @@ -132,12 +224,24 @@
FD_ZERO(&fds); FD_ZERO(&fds);
...@@ -8512,7 +8729,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8512,7 +8729,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
if (FD_ISSET(flashSocket, &fds)) { if (FD_ISSET(flashSocket, &fds)) {
sock = AcceptTcpConnection(flashSocket); sock = AcceptTcpConnection(flashSocket);
@@ -151,11 +253,66 @@ @@ -151,11 +255,66 @@
} }
close(sock); close(sock);
} }
...@@ -8582,7 +8799,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8582,7 +8799,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
XCloseDisplay(d); XCloseDisplay(d);
@@ -170,18 +327,28 @@ @@ -170,18 +329,28 @@
case 0: case 0:
/* child - return to caller */ /* child - return to caller */
close(listenSocket); close(listenSocket);
...@@ -8613,7 +8830,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8613,7 +8830,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
break; break;
} }
} }
@@ -200,6 +367,13 @@ @@ -200,6 +369,13 @@
char **fontNames; char **fontNames;
int nFontNames; int nFontNames;
...@@ -8627,7 +8844,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -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", sprintf(fontName,"-*-courier-bold-r-*-*-%d-*-*-*-*-*-iso8859-1",
FLASHWIDTH); FLASHWIDTH);
fontNames = XListFonts(d, fontName, 1, &nFontNames); fontNames = XListFonts(d, fontName, 1, &nFontNames);
@@ -209,6 +383,9 @@ @@ -209,6 +385,9 @@
sprintf(fontName,"fixed"); sprintf(fontName,"fixed");
} }
flashFont = XLoadFont(d, fontName); flashFont = XLoadFont(d, fontName);
...@@ -8637,7 +8854,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -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; Window w1, w2, w3, w4;
XSetWindowAttributes attr; XSetWindowAttributes attr;
...@@ -8649,7 +8866,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe ...@@ -8649,7 +8866,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/listen.c vnc_unixsrc/vncviewe
XBell(d, 0); XBell(d, 0);
XForceScreenSaver(d, ScreenSaverReset); XForceScreenSaver(d, ScreenSaverReset);
@@ -284,6 +466,9 @@ @@ -284,6 +468,9 @@
XDestroyWindow(d, w3); XDestroyWindow(d, w3);
XDestroyWindow(d, w4); XDestroyWindow(d, w4);
XFlush(d); XFlush(d);
...@@ -9056,7 +9273,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/misc.c vnc_unixsrc/vncviewer/ ...@@ -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 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.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 @@ @@ -25,22 +25,59 @@
#include <X11/Xaw/Form.h> #include <X11/Xaw/Form.h>
...@@ -9123,7 +9340,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer ...@@ -9123,7 +9340,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
} }
@@ -52,42 +89,789 @@ @@ -52,42 +89,786 @@
}; };
void void
...@@ -9180,7 +9397,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer ...@@ -9180,7 +9397,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{ +{
+ if (appData.popupFix) { + if (appData.popupFix) {
+ popupFixer(scaleN); + popupFixer(scaleN);
+
+ } else { + } else {
+ XtMoveWidget(scaleN, event->xbutton.x_root, event->xbutton.y_root); + XtMoveWidget(scaleN, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(scaleN, XtGrabNone); + XtPopup(scaleN, XtGrabNone);
...@@ -9372,7 +9588,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer ...@@ -9372,7 +9588,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{ +{
+ if (appData.popupFix) { + if (appData.popupFix) {
+ popupFixer(qualityW); + popupFixer(qualityW);
+
+ } else { + } else {
+ XtMoveWidget(qualityW, event->xbutton.x_root, event->xbutton.y_root); + XtMoveWidget(qualityW, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(qualityW, XtGrabNone); + XtPopup(qualityW, XtGrabNone);
...@@ -9430,7 +9645,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer ...@@ -9430,7 +9645,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+{ +{
+ if (appData.popupFix) { + if (appData.popupFix) {
+ popupFixer(compressW); + popupFixer(compressW);
+
+ } else { + } else {
+ XtMoveWidget(compressW, event->xbutton.x_root, event->xbutton.y_root); + XtMoveWidget(compressW, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(compressW, XtGrabNone); + XtPopup(compressW, XtGrabNone);
...@@ -9956,7 +10170,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup_ad vnc_unixsrc/vncviewe ...@@ -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 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.orig/vncviewer/rfbproto.c 2008-09-05 19:51:24.000000000 -0400
+++ vnc_unixsrc/vncviewer/rfbproto.c 2009-10-03 12:28:22.000000000 -0400 +++ vnc_unixsrc/vncviewer/rfbproto.c 2009-11-02 10:02:00.000000000 -0500
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
* rfbproto.c - functions to deal with client side of RFB protocol. * 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 ...@@ -10020,7 +10234,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
static void ReadConnFailedReason(void); static void ReadConnFailedReason(void);
static long ReadCompactLen (void); static long ReadCompactLen (void);
@@ -67,6 +109,20 @@ @@ -67,6 +109,22 @@
static void JpegSetSrcManager(j_decompress_ptr cinfo, CARD8 *compressedData, static void JpegSetSrcManager(j_decompress_ptr cinfo, CARD8 *compressedData,
int compressedLen); int compressedLen);
...@@ -10038,10 +10252,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -10038,10 +10252,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+static double dt_out_sc = 0.0; +static double dt_out_sc = 0.0;
+double latency = 0.0; +double latency = 0.0;
+double connect_time = 0.0; +double connect_time = 0.0;
+
+void raiseme(int force);
int rfbsock; int rfbsock;
char *desktopName; char *desktopName;
@@ -75,6 +131,14 @@ @@ -75,6 +133,14 @@
char *serverCutText = NULL; char *serverCutText = NULL;
Bool newServerCutText = False; Bool newServerCutText = False;
...@@ -10056,7 +10272,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -10056,7 +10272,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
int endianTest = 1; int endianTest = 1;
static Bool tightVncProtocol = False; static Bool tightVncProtocol = False;
@@ -177,8 +241,26 @@ @@ -177,8 +243,26 @@
sig_rfbEncodingPointerPos, "Pointer position update"); sig_rfbEncodingPointerPos, "Pointer position update");
CapsAdd(encodingCaps, rfbEncodingLastRect, rfbTightVncVendor, CapsAdd(encodingCaps, rfbEncodingLastRect, rfbTightVncVendor,
sig_rfbEncodingLastRect, "LastRect protocol extension"); sig_rfbEncodingLastRect, "LastRect protocol extension");
...@@ -10076,14 +10292,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -10076,14 +10292,14 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ +
+static void wmsg(char *msg, int wait) { +static void wmsg(char *msg, int wait) {
+ fprintf(stderr, "%s", msg); + fprintf(stderr, "%s", msg);
+ if (!isatty(0) && !getenv("SSVNC_NO_MESSAGE_POPUP")) { + if (!use_tty() && !getenv("SSVNC_NO_MESSAGE_POPUP")) {
+ CreateMsg(msg, wait); + CreateMsg(msg, wait);
+ } + }
+} +}
/* /*
* ConnectToRFBServer. * ConnectToRFBServer.
@@ -187,24 +269,167 @@ @@ -187,24 +271,167 @@
Bool Bool
ConnectToRFBServer(const char *hostname, int port) ConnectToRFBServer(const char *hostname, int port)
{ {
...@@ -10263,7 +10479,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -10263,7 +10479,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/* /*
* InitialiseRFBConnection. * InitialiseRFBConnection.
*/ */
@@ -212,211 +437,620 @@ @@ -212,211 +439,620 @@
Bool Bool
InitialiseRFBConnection(void) InitialiseRFBConnection(void)
{ {
...@@ -10748,7 +10964,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -10748,7 +10964,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ +
+ switch (secType) { + switch (secType) {
+ case rfbSecTypeNone: + case rfbSecTypeNone:
+ fprintf(stderr, "No authentication needed\n"); + fprintf(stderr, "No VNC authentication needed\n");
+ if (viewer_minor == 8) { + if (viewer_minor == 8) {
+ CARD32 authResult; + CARD32 authResult;
+ +
...@@ -11039,7 +11255,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11039,7 +11255,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -451,6 +1085,9 @@ @@ -451,6 +1087,9 @@
return True; return True;
} }
...@@ -11049,7 +11265,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11049,7 +11265,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/* /*
* Negotiate authentication scheme (protocol version 3.7t) * Negotiate authentication scheme (protocol version 3.7t)
@@ -459,58 +1096,384 @@ @@ -459,58 +1098,388 @@
static Bool static Bool
PerformAuthenticationTight(void) PerformAuthenticationTight(void)
{ {
...@@ -11079,7 +11295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11079,7 +11295,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- return True; - return True;
- } - }
+ if (!caps.nAuthTypes) { + if (!caps.nAuthTypes) {
+ fprintf(stderr, "No authentication needed\n\n"); + fprintf(stderr, "No VNC authentication needed\n\n");
+ return True; + return True;
+ } + }
...@@ -11145,14 +11361,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11145,14 +11361,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return False; + return False;
+ } + }
+ } + }
+
- fprintf(stderr, "No suitable authentication schemes offered by server\n");
- return False;
+ sprintf(msgbuf, "No suitable authentication schemes offered by server\n"); + sprintf(msgbuf, "No suitable authentication schemes offered by server\n");
+ wmsg(msgbuf, 1); + wmsg(msgbuf, 1);
+ return False; + return False;
} +}
+
+#if 0 +#if 0
+unsigned char encPasswd[8]; +unsigned char encPasswd[8];
+unsigned char encPasswd_MSLOGON[32]; +unsigned char encPasswd_MSLOGON[32];
...@@ -11164,6 +11378,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -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 */ + /* code from the old uvnc way (1.0.2?) that would go into AuthenticateVNC() template */
+ +
+ if (appData.msLogon != NULL) { + if (appData.msLogon != NULL) {
+ raiseme(1);
+ if (!strcmp(appData.msLogon, "1")) { + if (!strcmp(appData.msLogon, "1")) {
+ char tmp[256]; + char tmp[256];
+ fprintf(stderr, "\nUltraVNC MS Logon Username[@Domain]: "); + fprintf(stderr, "\nUltraVNC MS Logon Username[@Domain]: ");
...@@ -11235,14 +11450,16 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -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) { +static unsigned long long bytes_to_uint64(char *bytes) {
+ unsigned long long result = 0; + unsigned long long result = 0;
+ int i; + int i;
+
- fprintf(stderr, "No suitable authentication schemes offered by server\n");
- return False;
+ for (i=0; i < 8; i++) { + for (i=0; i < 8; i++) {
+ result <<= 8; + result <<= 8;
+ result += (unsigned char) bytes[i]; + result += (unsigned char) bytes[i];
+ } + }
+ return result; + return result;
+} }
+
+static void uint64_to_bytes(unsigned long long n, char *bytes) { +static void uint64_to_bytes(unsigned long long n, char *bytes) {
+ int i; + int i;
+ +
...@@ -11381,10 +11598,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -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")) { + if (appData.msLogon == NULL || !strcmp(appData.msLogon, "1")) {
+ char tmp[256], *q, *s; + char tmp[256], *q, *s;
+ fprintf(stderr, "\nUltraVNC MS-Logon Username[@Domain]: "); + if (!use_tty()) {
+ if (!isatty(0)) { + fprintf(stderr, "\nEnter UltraVNC MS-Logon Username[@Domain] in the popup.\n");
+ s = DoUserDialog(); + s = DoUserDialog();
+ } else { + } else {
+ raiseme(1);
+ fprintf(stderr, "\nUltraVNC MS-Logon Username[@Domain]: ");
+ if (fgets(tmp, 256, stdin) == NULL) { + if (fgets(tmp, 256, stdin) == NULL) {
+ exit(1); + exit(1);
+ } + }
...@@ -11395,9 +11614,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11395,9 +11614,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ appData.msLogon = strdup(s); + appData.msLogon = strdup(s);
+ } + }
+ +
+ if (!isatty(0)) { + if (!use_tty()) {
+ gpw = DoPasswordDialog(); + gpw = DoPasswordDialog();
+ } else { + } else {
+ raiseme(1);
+ gpw = getpass("UltraVNC MS-Logon Password: "); + gpw = getpass("UltraVNC MS-Logon Password: ");
+ } + }
+ if (! gpw) { + if (! gpw) {
...@@ -11476,7 +11696,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11476,7 +11696,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/* /*
* Standard VNC authentication. * Standard VNC authentication.
@@ -519,80 +1482,113 @@ @@ -519,80 +1488,115 @@
static Bool static Bool
AuthenticateVNC(void) AuthenticateVNC(void)
{ {
...@@ -11516,6 +11736,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11516,6 +11736,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ } + }
+ } else if (appData.autoPass) { + } else if (appData.autoPass) {
+ passwd = buffer; + passwd = buffer;
+ raiseme(1);
+ cstatus = fgets(buffer, sizeof buffer, stdin); + cstatus = fgets(buffer, sizeof buffer, stdin);
+ if (cstatus == NULL) { + if (cstatus == NULL) {
+ buffer[0] = '\0'; + buffer[0] = '\0';
...@@ -11527,9 +11748,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11527,9 +11748,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ } + }
+ } else if (getenv("VNCVIEWER_PASSWORD")) { + } else if (getenv("VNCVIEWER_PASSWORD")) {
+ passwd = strdup(getenv("VNCVIEWER_PASSWORD")); + passwd = strdup(getenv("VNCVIEWER_PASSWORD"));
+ } else if (appData.passwordDialog) { + } else if (appData.passwordDialog || !use_tty()) {
+ passwd = DoPasswordDialog(); + passwd = DoPasswordDialog();
+ } else { + } else {
+ raiseme(1);
+ passwd = getpass("VNC Password: "); + passwd = getpass("VNC Password: ");
+ } + }
...@@ -11653,7 +11875,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11653,7 +11875,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
/* /*
@@ -602,68 +1598,74 @@ @@ -602,68 +1606,75 @@
static Bool static Bool
AuthenticateUnixLogin(void) AuthenticateUnixLogin(void)
{ {
...@@ -11696,9 +11918,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11696,9 +11918,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- fprintf(stderr, "Reading password failed\n"); - fprintf(stderr, "Reading password failed\n");
- return False; - return False;
- } - }
+ if (appData.passwordDialog) { + if (appData.passwordDialog || !use_tty()) {
+ passwd = DoPasswordDialog(); + passwd = DoPasswordDialog();
+ } else { + } else {
+ raiseme(1);
+ passwd = getpass("VNC Password: "); + passwd = getpass("VNC Password: ");
+ } + }
+ if (!passwd || strlen(passwd) == 0) { + if (!passwd || strlen(passwd) == 0) {
...@@ -11780,7 +12003,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11780,7 +12003,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -675,19 +1677,20 @@ @@ -675,19 +1686,20 @@
static Bool static Bool
ReadInteractionCaps(void) ReadInteractionCaps(void)
{ {
...@@ -11813,7 +12036,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11813,7 +12036,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -700,19 +1703,67 @@ @@ -700,19 +1712,67 @@
static Bool static Bool
ReadCapabilityList(CapsContainer *caps, int count) ReadCapabilityList(CapsContainer *caps, int count)
{ {
...@@ -11890,7 +12113,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11890,7 +12113,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/* /*
* SetFormatAndEncodings. * SetFormatAndEncodings.
@@ -729,6 +1780,17 @@ @@ -729,6 +1789,17 @@
Bool requestCompressLevel = False; Bool requestCompressLevel = False;
Bool requestQualityLevel = False; Bool requestQualityLevel = False;
Bool requestLastRectEncoding = False; Bool requestLastRectEncoding = False;
...@@ -11908,7 +12131,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11908,7 +12131,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
spf.type = rfbSetPixelFormat; spf.type = rfbSetPixelFormat;
spf.format = myFormat; spf.format = myFormat;
@@ -736,12 +1798,18 @@ @@ -736,15 +1807,32 @@
spf.format.greenMax = Swap16IfLE(spf.format.greenMax); spf.format.greenMax = Swap16IfLE(spf.format.greenMax);
spf.format.blueMax = Swap16IfLE(spf.format.blueMax); spf.format.blueMax = Swap16IfLE(spf.format.blueMax);
...@@ -11927,7 +12150,21 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -11927,7 +12150,21 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
if (appData.encodingsString) { if (appData.encodingsString) {
char *encStr = appData.encodingsString; char *encStr = appData.encodingsString;
int encStrLen; 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); encStrLen = strlen(encStr);
} }
...@@ -12046,7 +12283,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -12046,7 +12283,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRichCursor); encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRichCursor);
if (se->nEncodings < MAX_ENCODINGS) if (se->nEncodings < MAX_ENCODINGS)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingPointerPos); encs[se->nEncodings++] = Swap32IfLE(rfbEncodingPointerPos);
@@ -806,10 +1926,16 @@ @@ -806,10 +1946,16 @@
if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) { if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect); encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect);
} }
...@@ -12066,7 +12303,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -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"); fprintf(stderr,"Same machine: preferring raw encoding\n");
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw); encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw);
} else { } else {
@@ -818,44 +1944,84 @@ @@ -818,44 +1964,84 @@
} }
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCopyRect); encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCopyRect);
...@@ -12173,7 +12410,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -12173,7 +12410,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
return True; return True;
} }
@@ -868,31 +2034,86 @@ @@ -868,31 +2054,86 @@
Bool Bool
SendIncrementalFramebufferUpdateRequest() SendIncrementalFramebufferUpdateRequest()
{ {
...@@ -12273,7 +12510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -12273,7 +12510,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -903,19 +2124,36 @@ @@ -903,19 +2144,36 @@
Bool Bool
SendPointerEvent(int x, int y, int buttonMask) SendPointerEvent(int x, int y, int buttonMask)
{ {
...@@ -12322,7 +12559,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -12322,7 +12559,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -926,12 +2164,20 @@ @@ -926,12 +2184,20 @@
Bool Bool
SendKeyEvent(CARD32 key, Bool down) SendKeyEvent(CARD32 key, Bool down)
{ {
...@@ -12348,7 +12585,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -12348,7 +12585,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -942,281 +2188,1024 @@ @@ -942,281 +2208,1024 @@
Bool Bool
SendClientCutText(char *str, int len) SendClientCutText(char *str, int len)
{ {
...@@ -13595,7 +13832,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -13595,7 +13832,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#ifdef MITSHM #ifdef MITSHM
/* if using shared memory PutImage, make sure that the X server has /* if using shared memory PutImage, make sure that the X server has
@@ -1224,59 +3213,168 @@ @@ -1224,59 +3233,168 @@
mainly to avoid copyrect using invalid screen contents - not sure mainly to avoid copyrect using invalid screen contents - not sure
if we'd need it otherwise. */ if we'd need it otherwise. */
...@@ -13797,7 +14034,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -13797,7 +14034,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
@@ -1296,26 +3394,93 @@ @@ -1296,26 +3414,93 @@
#define CONCAT2(a,b) a##b #define CONCAT2(a,b) a##b
#define CONCAT2E(a,b) CONCAT2(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 ...@@ -13891,7 +14128,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#undef BPP #undef BPP
/* /*
@@ -1325,23 +3490,27 @@ @@ -1325,23 +3510,27 @@
static void static void
ReadConnFailedReason(void) ReadConnFailedReason(void)
{ {
...@@ -13933,7 +14170,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -13933,7 +14170,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} }
/* /*
@@ -1358,9 +3527,9 @@ @@ -1358,9 +3547,9 @@
" %s significant bit in each byte is leftmost on the screen.\n", " %s significant bit in each byte is leftmost on the screen.\n",
(format->bigEndian ? "Most" : "Least")); (format->bigEndian ? "Most" : "Least"));
} else { } else {
...@@ -13945,7 +14182,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie ...@@ -13945,7 +14182,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
(format->bigEndian ? "Most" : "Least")); (format->bigEndian ? "Most" : "Least"));
} }
if (format->trueColour) { if (format->trueColour) {
@@ -1462,4 +3631,3 @@ @@ -1462,4 +3651,3 @@
cinfo->src = &jpegSrcManager; cinfo->src = &jpegSrcManager;
} }
...@@ -15272,11 +15509,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/tight.c vnc_unixsrc/vncviewer ...@@ -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 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.orig/vncviewer/tmake 1969-12-31 19:00:00.000000000 -0500
+++ vnc_unixsrc/vncviewer/tmake 2009-03-08 17:11:49.000000000 -0400 +++ vnc_unixsrc/vncviewer/tmake 2009-10-25 10:31:22.000000000 -0400
@@ -0,0 +1,13 @@ @@ -0,0 +1,17 @@
+#!/bin/sh +#!/bin/sh
+TURBOVNC_DIR=/home/runge/turbojpeg +TURBOVNC_DIR=/home/runge/turbojpeg
+make clean +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" +make CCOPTIONS=-DTURBOVNC EXTRA_LIBRARIES="-L$TURBOVNC_DIR -Xlinker --rpath=$TURBOVNC_DIR -Xlinker --rpath=/usr/local/lib -lturbojpeg"
+cp -p vncviewer vncviewer.turbovnc +cp -p vncviewer vncviewer.turbovnc
+strip vncviewer.turbovnc +strip vncviewer.turbovnc
...@@ -16165,8 +16406,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/turbovnc/turbojpeg.h vnc_unix ...@@ -16165,8 +16406,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/turbovnc/turbojpeg.h vnc_unix
+#endif +#endif
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vncviewer/vncviewer._man 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.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 +++ vnc_unixsrc/vncviewer/vncviewer._man 2009-10-23 12:24:51.000000000 -0400
@@ -0,0 +1,793 @@ @@ -0,0 +1,799 @@
+'\" t +'\" t
+.\" ** The above line should force tbl to be a preprocessor ** +.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for X vncviewer +.\" Man page for X vncviewer
...@@ -16288,13 +16529,13 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn ...@@ -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 +TightVNC supports several different compression methods to encode
+screen updates; this option specifies a set of them to use in order of +screen updates; this option specifies a set of them to use in order of
+preference. Encodings are specified separated with spaces, and must +preference. Encodings are specified separated with spaces, and must
+thus be enclosed in quotes if more than one is specified. Available +thus be enclosed in quotes if more than one is specified. Commas may be used to avoid spaces.
+encodings, in default order for a remote connection, are "copyrect +Available encodings, in default order for a remote connection, are
+tight hextile zlib corre rre raw". For a local connection (to the same +"copyrect tight hextile zlib corre rre raw". For a local connection
+machine), the default order to try is "raw copyrect tight hextile zlib +(to the same machine), the default order to try is "raw copyrect tight
+corre rre". Raw encoding is always assumed as a last option if no +hextile zlib corre rre". Raw encoding is always assumed as a last option
+other encoding can be used for some reason. For more information on +if no other encoding can be used for some reason. For more information
+encodings, see the section ENCODINGS below. +on encodings, see the section ENCODINGS below.
+.TP +.TP
+\fB\-bgr233\fR +\fB\-bgr233\fR
+Always use the BGR233 format to encode pixel data. This reduces +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 ...@@ -16481,6 +16722,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+Prefer raw encoding for localhost, default is +Prefer raw encoding for localhost, default is
+no, i.e. assumes you have a SSH tunnel instead. +no, i.e. assumes you have a SSH tunnel instead.
+.TP +.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 +\fB\-sendclipboard\fR
+Send the X CLIPBOARD selection (i.e. Ctrl+C, +Send the X CLIPBOARD selection (i.e. Ctrl+C,
+Ctrl+V) instead of the X PRIMARY selection (mouse +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 ...@@ -16699,7 +16945,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+ Cursor Shape: ~ -nocursorshape + Cursor Shape: ~ -nocursorshape
+ X11 Cursor: ~ -x11cursor + X11 Cursor: ~ -x11cursor
+ Cursor Alphablend: ~ -alpha + Cursor Alphablend: ~ -alpha
+ Toggle Tight/ZRLE: ~ -encodings ... + Toggle Tight/Hextile: ~ -encodings hextile...
+ Toggle Tight/ZRLE: ~ -encodings zrle...
+ Toggle ZRLE/ZYWRLE: ~ -encodings zywrle... + Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
+ Quality Level ~ -quality (both Tight and ZYWRLE) + Quality Level ~ -quality (both Tight and ZYWRLE)
+ Compress Level ~ -compresslevel + Compress Level ~ -compresslevel
...@@ -16962,7 +17209,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn ...@@ -16962,7 +17209,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vn
+Karl J. Runge <runge@karlrunge.com> +Karl J. Runge <runge@karlrunge.com>
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncviewer/vncviewer.c 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.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 @@ @@ -22,6 +22,7 @@
*/ */
...@@ -16971,10 +17218,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -16971,10 +17218,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
char *programName; char *programName;
XtAppContext appContext; XtAppContext appContext;
@@ -29,11 +30,234 @@ @@ -29,11 +30,241 @@
Widget toplevel; Widget toplevel;
+extern void raiseme(int force);
+
+void set_sbwidth(int sbw) { +void set_sbwidth(int sbw) {
+ char *q, *p, t[5]; + char *q, *p, t[5];
+ int i, k, N = 4; + int i, k, N = 4;
...@@ -17050,15 +17299,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17050,15 +17299,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ } + }
+ if (!strcmp(str, ".")) { + if (!strcmp(str, ".")) {
+ char *p; + char *p;
+ fprintf(stderr, "\nUnix Username: "); + if (!use_tty()) {
+ if (!isatty(0)) { + char *u;
+ char *u = DoUserDialog(); + fprintf(stderr, "\nEnter Unix Username and Password in the popups.\n");
+ u = DoUserDialog();
+ if (strlen(u) >= 100) { + if (strlen(u) >= 100) {
+ exit(1); + exit(1);
+ } + }
+ sprintf(username, u); + sprintf(username, u);
+ p = DoPasswordDialog(); + p = DoPasswordDialog();
+ } else { + } else {
+ raiseme(1);
+ fprintf(stderr, "\nUnix Username: ");
+ if (fgets(username, N, stdin) == NULL) { + if (fgets(username, N, stdin) == NULL) {
+ exit(1); + exit(1);
+ } + }
...@@ -17072,9 +17324,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17072,9 +17324,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ +
+ } else if (!strcmp(str, "-")) { + } else if (!strcmp(str, "-")) {
+ char *p, *q; + char *p, *q;
+ if (!isatty(0)) { + if (!use_tty()) {
+ fprintf(stderr, "\nEnter unixuser@unixpasswd in the popup.\n");
+ p = DoPasswordDialog(); + p = DoPasswordDialog();
+ } else { + } else {
+ raiseme(1);
+ p = getpass("unixuser@unixpasswd: "); + p = getpass("unixuser@unixpasswd: ");
+ } + }
+ if (! p) { + if (! p) {
...@@ -17208,7 +17462,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -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 /* The -listen option is used to make us a daemon process which listens for
incoming connections from servers, rather than actively connecting to a incoming connections from servers, rather than actively connecting to a
@@ -45,89 +269,1615 @@ @@ -45,89 +276,1647 @@
listenForIncomingConnections() returns, setting the listenSpecified listenForIncomingConnections() returns, setting the listenSpecified
flag. */ flag. */
...@@ -17613,13 +17867,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17613,13 +17867,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ appData.escapeActive = True; + appData.escapeActive = True;
+ } + }
+} +}
+
- Cleanup();
+/* +/*
+ * ToggleNColors + * ToggleNColors
+ */ + */
+
- return 0;
+static Widget w256 = NULL; +static Widget w256 = NULL;
+static Widget w64 = NULL; +static Widget w64 = NULL;
+static Widget w8 = NULL; +static Widget w8 = NULL;
...@@ -17705,6 +17957,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17705,6 +17957,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ +
+static Bool usingZRLE = False; +static Bool usingZRLE = False;
+static Bool usingZYWRLE = False; +static Bool usingZYWRLE = False;
+static Bool usingHextile = False;
+extern int skip_maybe_sync; +extern int skip_maybe_sync;
+ +
+void +void
...@@ -17713,6 +17966,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -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 prefTight[] = "copyrect tight zrle zywrle zlib hextile corre rre raw";
+ char prefZRLE[] = "copyrect zrle zywrle tight zlib hextile corre rre raw"; + char prefZRLE[] = "copyrect zrle zywrle tight zlib hextile corre rre raw";
+ init_format_change(); + init_format_change();
+ usingHextile = False;
+ if (! appData.encodingsString) { + if (! appData.encodingsString) {
+ appDataNew.encodingsString = strdup(prefZRLE); + appDataNew.encodingsString = strdup(prefZRLE);
+ usingZRLE = True; + usingZRLE = True;
...@@ -17761,6 +18015,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -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"; + char prefZRLE[] = "copyrect zrle zywrle tight zlib hextile corre rre raw";
+ init_format_change(); + init_format_change();
+ usingZRLE = True; + usingZRLE = True;
+ usingHextile = False;
+ if (! appData.encodingsString) { + if (! appData.encodingsString) {
+ appDataNew.encodingsString = strdup(prefZYWRLE); + appDataNew.encodingsString = strdup(prefZYWRLE);
+ usingZYWRLE = True; + usingZYWRLE = True;
...@@ -17783,6 +18038,52 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17783,6 +18038,52 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ schedule_format_change(); + 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) { +void scale_check_zrle(void) {
+ static int didit = 0; + static int didit = 0;
+ if (didit) { + if (didit) {
...@@ -17792,7 +18093,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -17792,7 +18093,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ if (getenv("SSVNC_PRESERVE_ENCODING")) { + if (getenv("SSVNC_PRESERVE_ENCODING")) {
+ return; + return;
+ } + }
+ if (!usingZRLE) { + if (!usingZRLE && !usingHextile) {
+ Widget w; + Widget w;
+ fprintf(stderr, "\nSwitching to faster ZRLE encoding in client-side scaling mode.\n"); + 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"); + 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 ...@@ -18078,7 +18379,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ schedule_fb_update(); + schedule_fb_update();
+ } + }
+} +}
+
- Cleanup();
+void +void
+DoServerScale(Widget w, XEvent *ev, String *params, Cardinal *num_params) +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 ...@@ -18168,7 +18470,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ set_server_compress(n); + set_server_compress(n);
+ } + }
+} +}
+
- return 0;
+extern void rescale_image(void); +extern void rescale_image(void);
+ +
+void +void
...@@ -18655,75 +18958,46 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -18655,75 +18958,46 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ } + }
+} +}
+ +
+void +static init_state(void) {
+SetZRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ static int first = 1; + static int first = 1;
+ if (first && appData.encodingsString) { + if (first && appData.encodingsString) {
+ char *t, *z, *w; + char *t, *z, *y, *h;
+ t = strstr(appData.encodingsString, "tight"); + char *str = appData.encodingsString;
+ z = strstr(appData.encodingsString, "zrle"); + int len = strlen(str);
+ w = strstr(appData.encodingsString, "zywrle"); +
+ if (t) { + t = strstr(str, "tight");
+ if (z) { + z = strstr(str, "zrle");
+ if (w) { + y = strstr(str, "zywrle");
+ if (t < z && t < w) { + h = strstr(str, "hextile");
+ usingZRLE = False; +
+ } else { + if (!t) t = str + len;
+ usingZRLE = True; + if (!z) z = str + len;
+ } + if (!y) y = str + len;
+ if (z < w) { + if (!h) h = str + len;
+ usingZYWRLE = False; +
+ } else {
+ usingZYWRLE = True;
+ }
+ } else {
+ if (t < z) {
+ usingZRLE = False; + usingZRLE = False;
+ } else {
+ usingZRLE = True;
+ }
+ usingZYWRLE = False; + usingZYWRLE = False;
+ } + usingHextile = False;
+ } else { +
+ if (w) { + if (t < z && t < y && t < h) {
+ if (t < w) { + ;
+ usingZRLE = False; + } else if (z < t && z < y && z < h) {
+ } else {
+ usingZRLE = True; + usingZRLE = True;
+ } + } else if (y < t && y < z && y < h) {
+ usingZYWRLE = True; + usingZYWRLE = True;
+ } else {
+ usingZRLE = False;
+ usingZYWRLE = False;
+ }
+ }
+ } else {
+ if (z) {
+ if (w) {
+ usingZRLE = True; + usingZRLE = True;
+ if (z < w) { + } else if (h < t && h < z && h < y) {
+ usingZYWRLE = False; + usingHextile = True;
+ } else {
+ usingZYWRLE = True;
+ }
+ } else {
+ usingZRLE = True;
+ usingZYWRLE = False;
+ }
+ } else {
+ if (w) {
+ usingZRLE = True;
+ usingZYWRLE = True;
+ } else {
+ usingZRLE = False;
+ usingZYWRLE = False;
+ }
+ }
+ } + }
+ } + }
+ first = 0; + first = 0;
+ +
+}
+
+void
+SetZRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ init_state();
+ if (usingZRLE) { + if (usingZRLE) {
+ XtVaSetValues(w, XtNstate, True, NULL); + XtVaSetValues(w, XtNstate, True, NULL);
+ } else { + } else {
...@@ -18732,8 +19006,20 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -18732,8 +19006,20 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+} +}
+ +
+void +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) +SetZYWRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{ +{
+ init_state();
+ if (usingZYWRLE) { + if (usingZYWRLE) {
+ XtVaSetValues(w, XtNstate, True, NULL); + XtVaSetValues(w, XtNstate, True, NULL);
+ } else { + } else {
...@@ -18862,7 +19148,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi ...@@ -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 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.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 @@ @@ -28,6 +28,7 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
...@@ -18886,7 +19172,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -18886,7 +19172,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
#define FLASH_PORT_OFFSET 5400 #define FLASH_PORT_OFFSET 5400
#define LISTEN_PORT_OFFSET 5500 #define LISTEN_PORT_OFFSET 5500
@@ -64,60 +71,124 @@ @@ -64,60 +71,125 @@
#define DEFAULT_VIA_CMD \ #define DEFAULT_VIA_CMD \
(DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20") (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 ...@@ -18992,6 +19278,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+ +
+ char *passwordFile; + char *passwordFile;
+ Bool passwordDialog; + Bool passwordDialog;
+ Bool notty;
+ +
+ int rawDelay; + int rawDelay;
+ int copyRectDelay; + int copyRectDelay;
...@@ -19051,7 +19338,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19051,7 +19338,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern int listenPort, flashPort; extern int listenPort, flashPort;
extern XrmOptionDescRec cmdLineOptions[]; extern XrmOptionDescRec cmdLineOptions[];
@@ -130,10 +201,11 @@ @@ -130,10 +202,11 @@
/* colour.c */ /* colour.c */
extern unsigned long BGR233ToPixel[]; extern unsigned long BGR233ToPixel[];
...@@ -19064,7 +19351,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19064,7 +19351,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void SetVisualAndCmap(); extern void SetVisualAndCmap();
@@ -157,13 +229,52 @@ @@ -157,13 +230,54 @@
extern void DesktopInitBeforeRealization(); extern void DesktopInitBeforeRealization();
extern void DesktopInitAfterRealization(); extern void DesktopInitAfterRealization();
...@@ -19086,6 +19373,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19086,6 +19373,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+ +
/* dialogs.c */ /* dialogs.c */
+extern int use_tty(void);
+
+extern void ScaleDialogDone(Widget w, XEvent *event, String *params, +extern void ScaleDialogDone(Widget w, XEvent *event, String *params,
+ Cardinal *num_params); + Cardinal *num_params);
+extern char *DoScaleDialog(); +extern char *DoScaleDialog();
...@@ -19117,7 +19406,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -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, extern void ServerDialogDone(Widget w, XEvent *event, String *params,
Cardinal *num_params); Cardinal *num_params);
extern char *DoServerDialog(); extern char *DoServerDialog();
@@ -171,6 +282,10 @@ @@ -171,6 +285,10 @@
Cardinal *num_params); Cardinal *num_params);
extern char *DoPasswordDialog(); extern char *DoPasswordDialog();
...@@ -19128,7 +19417,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19128,7 +19417,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* fullscreen.c */ /* fullscreen.c */
extern void ToggleFullScreen(Widget w, XEvent *event, String *params, extern void ToggleFullScreen(Widget w, XEvent *event, String *params,
@@ -181,6 +296,13 @@ @@ -181,6 +299,13 @@
extern void FullScreenOn(); extern void FullScreenOn();
extern void FullScreenOff(); extern void FullScreenOff();
...@@ -19142,7 +19431,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19142,7 +19431,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* listen.c */ /* listen.c */
extern void listenForIncomingConnections(); extern void listenForIncomingConnections();
@@ -196,6 +318,8 @@ @@ -196,6 +321,8 @@
Cardinal *num_params); Cardinal *num_params);
extern void Quit(Widget w, XEvent *event, String *params, extern void Quit(Widget w, XEvent *event, String *params,
Cardinal *num_params); Cardinal *num_params);
...@@ -19151,7 +19440,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19151,7 +19440,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void Cleanup(); extern void Cleanup();
/* popup.c */ /* popup.c */
@@ -207,6 +331,29 @@ @@ -207,6 +334,29 @@
Cardinal *num_params); Cardinal *num_params);
extern void CreatePopup(); extern void CreatePopup();
...@@ -19181,7 +19470,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19181,7 +19470,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* rfbproto.c */ /* rfbproto.c */
extern int rfbsock; extern int rfbsock;
@@ -229,8 +376,19 @@ @@ -229,8 +379,19 @@
extern Bool SendClientCutText(char *str, int len); extern Bool SendClientCutText(char *str, int len);
extern Bool HandleRFBServerMessage(); extern Bool HandleRFBServerMessage();
...@@ -19201,7 +19490,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19201,7 +19490,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* selection.c */ /* selection.c */
extern void InitialiseSelection(); extern void InitialiseSelection();
@@ -241,8 +399,9 @@ @@ -241,8 +402,9 @@
/* shm.c */ /* shm.c */
...@@ -19212,7 +19501,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -19212,7 +19501,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* sockets.c */ /* sockets.c */
@@ -253,10 +412,15 @@ @@ -253,10 +415,15 @@
extern int FindFreeTcpPort(void); extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port); extern int ListenAtTcpPort(int port);
extern int ConnectToTcpAddr(unsigned int host, 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 ...@@ -19228,7 +19517,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern Bool SameMachine(int sock); extern Bool SameMachine(int sock);
/* tunnel.c */ /* tunnel.c */
@@ -271,3 +435,80 @@ @@ -271,3 +438,82 @@
extern XtAppContext appContext; extern XtAppContext appContext;
extern Display* dpy; extern Display* dpy;
extern Widget toplevel; extern Widget toplevel;
...@@ -19244,6 +19533,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi ...@@ -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 Toggle8Colors(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleGreyScale(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 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 ToggleZRLEZYWRLE(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleViewOnly(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); +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 ...@@ -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 Set8ColorsState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetGreyScaleState(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 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 SetZYWRLEState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetCursorShapeState(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); +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 ...@@ -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); +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 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.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 @@ @@ -5,38 +5,55 @@
.\" Copyright (C) 1998 Marcus.Brinkmann@ruhr-uni-bochum.de .\" Copyright (C) 1998 Marcus.Brinkmann@ruhr-uni-bochum.de
.\" Copyright (C) 2000,2001 Red Hat, Inc. .\" Copyright (C) 2000,2001 Red Hat, Inc.
...@@ -19376,7 +19667,28 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc ...@@ -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 You can use F8 to display a pop\-up utility menu. Press F8 twice to
pass single F8 to the remote side. pass single F8 to the remote side.
.SH OPTIONS .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 \fB\-autopass\fR
Read a plain-text password from stdin. This option affects only the Read a plain-text password from stdin. This option affects only the
standard VNC authentication. standard VNC authentication.
...@@ -19507,6 +19819,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc ...@@ -19507,6 +19819,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
+Prefer raw encoding for localhost, default is +Prefer raw encoding for localhost, default is
+no, i.e. assumes you have a SSH tunnel instead. +no, i.e. assumes you have a SSH tunnel instead.
+.TP +.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 +\fB\-sendclipboard\fR
+Send the X CLIPBOARD selection (i.e. Ctrl+C, +Send the X CLIPBOARD selection (i.e. Ctrl+C,
+Ctrl+V) instead of the X PRIMARY selection (mouse +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 ...@@ -19725,7 +20042,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
+ Cursor Shape: ~ -nocursorshape + Cursor Shape: ~ -nocursorshape
+ X11 Cursor: ~ -x11cursor + X11 Cursor: ~ -x11cursor
+ Cursor Alphablend: ~ -alpha + Cursor Alphablend: ~ -alpha
+ Toggle Tight/ZRLE: ~ -encodings ... + Toggle Tight/Hextile: ~ -encodings hextile...
+ Toggle Tight/ZRLE: ~ -encodings zrle...
+ Toggle ZRLE/ZYWRLE: ~ -encodings zywrle... + Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
+ Quality Level ~ -quality (both Tight and ZYWRLE) + Quality Level ~ -quality (both Tight and ZYWRLE)
+ Compress Level ~ -compresslevel + Compress Level ~ -compresslevel
...@@ -19765,7 +20083,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc ...@@ -19765,7 +20083,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
.SH ENCODINGS .SH ENCODINGS
The server supplies information in whatever format is desired by the The server supplies information in whatever format is desired by the
client, in order to make the client as easy as possible to implement. client, in order to make the client as easy as possible to implement.
@@ -238,6 +637,15 @@ @@ -238,6 +643,15 @@
\-quality and \-nojpeg options above). Tight encoding is usually the \-quality and \-nojpeg options above). Tight encoding is usually the
best choice for low\-bandwidth network environments (e.g. slow modem best choice for low\-bandwidth network environments (e.g. slow modem
connections). connections).
...@@ -19781,7 +20099,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc ...@@ -19781,7 +20099,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
.SH RESOURCES .SH RESOURCES
X resources that \fBvncviewer\fR knows about, aside from the X resources that \fBvncviewer\fR knows about, aside from the
normal Xt resources, are as follows: normal Xt resources, are as follows:
@@ -364,12 +772,13 @@ @@ -364,12 +778,13 @@
.B %R .B %R
remote TCP port number. remote TCP port number.
.SH SEE ALSO .SH SEE ALSO
...@@ -19798,7 +20116,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc ...@@ -19798,7 +20116,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vnc
\fBMan page authors:\fR \fBMan page authors:\fR
.br .br
@@ -380,3 +789,5 @@ @@ -380,3 +795,5 @@
Tim Waugh <twaugh@redhat.com>, Tim Waugh <twaugh@redhat.com>,
.br .br
Constantin Kaplinsky <const@ce.cctpu.edu.ru> Constantin Kaplinsky <const@ce.cctpu.edu.ru>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment