Michal Srb [Fri, 13 Jan 2017 14:32:23 +0000 (16:32 +0200)]
Fix buffer overflow in ModifiablePixelBuffer::fillRect.
It can be triggered by RRE message with subrectangle out of framebuffer
boundaries. It may prevent the same kind of issue caused by evil message
from another encoding too.
Hans de Goede [Mon, 9 Jan 2017 15:03:30 +0000 (16:03 +0100)]
Fix -inetd not working with xserver >= 1.19
xserver 1.19's OsInit will create a pollfd, followed by checking if fd 2 /
stderr is writable and if it is not, replacing fd 2 with /dev/null.
Since we close stderr in inetd mode to avoid xserver messages being send
to the client as vnc data, the pollfd becomes fd 2, only to be replaced
by /dev/null since a pollfd is not writable.
This commit fixes this by opening /dev/null directly after the close(2),
avoiding that the pollfd becomes fd 2.
Alan Coopersmith: Change to use dup2() for atomic switch of fd
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Pierre Ossman [Thu, 29 Dec 2016 15:52:56 +0000 (16:52 +0100)]
More robust event and close handling
There were still some circumstances where we could get stuck reading
data and not respect close events properly. Move that logic to a more
central place in order to make it more reliable.
Pierre Ossman [Mon, 19 Dec 2016 09:27:06 +0000 (10:27 +0100)]
Use dixChangeWindowProperty() instead of ChangeWindowProperty()
ChangeWindowProperty() was removed upstream because it was redundant,
and dixChangeWindowProperty() has been around since 1.5 so we can
safely use that.
MacOS package: Added NSHighResolutionCapable tag to Info.plist
With the flag the application will start enable the high resolution
display. I tested this on a Macbook Pro with a High Resolution Display.
The fonts are better to read.
Pierre Ossman [Mon, 10 Oct 2016 14:05:46 +0000 (16:05 +0200)]
Fix busy loop in FdOutStream::flush()
This bug was introduced in c6df31db. A non-blocking socket that did
not have any more space would busy loop until the write succeeded.
Instead now it returns without any action, just as it did before
the bug was introduced.
Koichiro IWAO [Tue, 4 Oct 2016 08:17:06 +0000 (17:17 +0900)]
Do not depends on mcookie command
for operating systems other than GNU/Linux.
mcookie is a part of util-linux. Usually only GNU/Linux systems have it.
Do not die even if mcookie is not found. Use the previous pure perl code
to generate cookie as fallback.
Brian P. Hinz [Sat, 27 Aug 2016 21:33:04 +0000 (17:33 -0400)]
Make all viewer parameters static. Viewer instances are isolated from each other by spawning a completely new process for each viewer, rather than simply starting a new thread. All dialogs were redesigned to better match the look of the native viewer, and also to be more tolerant of sizing differences between platforms.
Jeff Blaine [Sat, 6 Aug 2016 20:22:18 +0000 (16:22 -0400)]
Support both defaults and mandatory system config files
This commit introduces support for optional basic system-wide
configuration of vncserver.
The format and syntax of /etc/tigervnc/vncserver* match
that of $HOME/.vnc/config exactly.
Allows /etc/tigervnc/vncserver-config-defaults as well as
/etc/tigervnc/vncserver-config-mandatory. The former is optional
and sets user-overrideable vncserver settings. The latter is
optional, but if it exists takes precedence over all user
$HOME/.vnc/config settings of the same setting name. In the
case where /etc/tigervnc/vncserver-config-mandatory overrides
a setting in $HOME/.vnc/config, the user will be warned that
it has happened.
WARNING: Settings in /etc/tigervnc/vncserver-config-mandatory
are easily subverted by passing args to vncserver on the CLI.
The man page indicates this warning.
This commit also introduces (should have been separate) examination
of all config file settings (not just @ARGV!) when determining
whether or not $HOME/.vnc/passwd needs to be created. That is,
if /etc/tigervnc/vncserver* or $HOME/.vnc/config indicate that
we are NOT using VNC-native authentication, then we don't need
a $HOME/.vnc/passwd created.
Code cleanup:
$xstartup was renamed $xstartupFile for consistency with other
"file" variable names.
For VNC-auth checking, to determine if $HOME/.vnc/passwd needed
creation, the 3-string check against lc($arg2) was in 2 places
and was changed to a simple grep against the new @vncAuthStrings
Pierre Ossman [Thu, 18 Aug 2016 14:16:45 +0000 (16:16 +0200)]
Adjust client pointer coordinates to absolute
The client is not aware of where the screen is placed so it will give
us screen relative coordinates. Convert to and from these and absolute
coordinates before interacting with the input layer.
Pierre Ossman [Thu, 18 Aug 2016 14:14:55 +0000 (16:14 +0200)]
Convert pointer coordinates to absolute
It is possible to set pointer coordinate using absolute numbers, but
getting them back will always give us screen relative ones. Do the
necessary calculations manually so we return sane values to the caller.
Brian P. Hinz [Sun, 7 Aug 2016 12:44:46 +0000 (08:44 -0400)]
Major overhaul of java viewer.
This is the first of several large commits intended to resolve a
number of problems and add new capabilities to the java viewer.
Among the most significant changes are a complete re-design of
the options dialog, which has been converted to a callback style
interface. The look & feel of all dialogs are now similar to
the style of the native viewer now. Also, the process by which
new viewers are spawned has changed and each viewer is a completely
separate process, allowing for runtime arguments to be handled
statically.
Jeff Blaine [Tue, 24 May 2016 01:43:59 +0000 (21:43 -0400)]
Properly name filehandle based on context of code
Old harmless copy/paste from code above left code confusing as it was reusing the filehandle "XSTARTUP" to write out $vncUserDir/config. This new small change uses a more topical filehandle name for the task at hand.
Pierre Ossman [Fri, 13 May 2016 14:11:34 +0000 (16:11 +0200)]
Avoid symbol clash for Xregion functions
We might be linking our Xregion and libX11 into the same binary,
causing a clash between the symbols. In theory they should be
compatible, but that's not guaranteed. Avoid the issue by adding
a "vnc" prefix to our version.
Brian P. Hinz [Thu, 12 May 2016 01:55:56 +0000 (21:55 -0400)]
Fix to workaround non-default libtool on debian
Debian patches libtool so that the default value of
link_all_deplibs is set to 'no' rather than 'unknown',
causing transitive dependencies in shared objects to
be lost.