Compare commits

...
Sign in to create a new pull request.

8 commits

Author SHA1 Message Date
Fedora Release Engineering
938b68fac5 dist-git conversion 2010-07-29 18:06:02 +00:00
Bill Nottingham
9a632897e8 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:15:00 +00:00
Adam Tkac
35a9026ce0 - improved IPv6 support in viewer (#438422) 2008-06-30 11:19:26 +00:00
Adam Tkac
d625bd910a - fixed typo in specfile 2008-03-19 11:52:25 +00:00
Adam Tkac
33425d8ff5 - minor vncviewer manpage fixes (#427672, #427701)
- validate framebuffer bounds before GetImage call (#430468)
2008-03-19 11:44:10 +00:00
Adam Tkac
decd5a3317 - changed default fontpath to catalogue:/etc/X11/fontpath.d,built-ins
(#390971)
- Requires xorg-x11-fonts-misc instead xorg-x11-fonts-base
2007-12-20 15:17:47 +00:00
Adam Tkac
3b1353582d - disabled Composite extension (#242280, #339811) 2007-10-23 17:36:40 +00:00
Jesse Keating
91bcaa0e90 Initialize branch F-8 for vnc 2007-10-20 18:48:52 +00:00
7 changed files with 299 additions and 95 deletions

View file

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: vnc
# $Id: Makefile,v 1.1 2004/09/09 14:02:00 cvsdist Exp $
NAME := vnc
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View file

@ -1,67 +0,0 @@
--- vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6 2006-10-13 11:31:37.000000000 +0100
+++ vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx 2006-10-13 12:05:40.000000000 +0100
@@ -106,11 +106,29 @@
TcpSocket::TcpSocket(const char *host, int port)
: closeFd(true)
{
+ struct sockaddr_storage addr;
+ size_t addrlen;
+ struct addrinfo *hostai;
int sock;
- // - Create a socket
initSockets();
- if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+
+ if (getaddrinfo(host, NULL, NULL, &hostai)) {
+ int e = errorNumber;
+ throw SocketException("unable to resolve host by name", e);
+ }
+
+ addrlen = hostai->ai_addrlen;
+ memset(&addr, 0, sizeof(addr));
+ memcpy(&addr, hostai->ai_addr, addrlen);
+ freeaddrinfo(hostai);
+ if (addr.ss_family == AF_INET)
+ ((struct sockaddr_in *)&addr)->sin_port = htons(port);
+ else if (addr.ss_family == AF_INET6)
+ ((struct sockaddr_in6 *)&addr)->sin6_port = htons(port);
+
+ // - Create a socket
+ if ((sock = socket(addr.ss_family, SOCK_STREAM, 0)) < 0)
throw SocketException("unable to create socket", errorNumber);
#ifndef WIN32
@@ -118,30 +136,9 @@
fcntl(sock, F_SETFD, FD_CLOEXEC);
#endif
- // - Connect it to something
-
- // Try processing the host as an IP address
- struct sockaddr_in addr;
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr(host);
- addr.sin_port = htons(port);
- if ((int)addr.sin_addr.s_addr == -1) {
- // Host was not an IP address - try resolving as DNS name
- struct hostent *hostinfo;
- hostinfo = gethostbyname(host);
- if (hostinfo && hostinfo->h_addr) {
- addr.sin_addr.s_addr = ((struct in_addr *)hostinfo->h_addr)->s_addr;
- } else {
- int e = errorNumber;
- closesocket(sock);
- throw SocketException("unable to resolve host by name", e);
- }
- }
-
// Attempt to connect to the remote host
for (;;) {
- if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
+ if (connect(sock, (struct sockaddr *)&addr, addrlen) != 0) {
int e = errorNumber;
if (e == EINTR)
continue;

55
vnc-bounds.patch Normal file
View file

@ -0,0 +1,55 @@
diff -up vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/XserverDesktop.cc.bounds vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/XserverDesktop.cc
--- vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/XserverDesktop.cc.bounds 2008-03-17 16:46:27.000000000 +0100
+++ vnc-4_1_2-unixsrc/unix/xorg-x11-server-source/hw/vnc/XserverDesktop.cc 2008-03-17 16:59:11.000000000 +0100
@@ -486,32 +486,36 @@ void XserverDesktop::add_changed(RegionP
{
if (ignoreHooks_) return;
if (grabbing) return;
+
+ BoxRec screenbox;
+ RegionPtr newreg = REGION_CREATE(pScreen, 0, 0);
+
+ screenbox.x1 = screenbox.y1 = 0;
+ screenbox.x2 = pScreen->width;
+ screenbox.y2 = pScreen->height;
+
+ RegionPtr screenreg = REGION_CREATE(pScreen, &screenbox, 0);
+ REGION_INTERSECT(pScreen, newreg, reg, screenreg);
+ REGION_DESTROY (pScreen, screenreg);
+
try {
rfb::Region rfbReg;
- rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, reg),
- REGION_NUM_RECTS(reg),
- (ShortRect*)REGION_RECTS(reg));
+ rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, newreg),
+ REGION_NUM_RECTS(newreg),
+ (ShortRect*)REGION_RECTS(newreg));
server->add_changed(rfbReg);
deferUpdate();
} catch (rdr::Exception& e) {
vlog.error("XserverDesktop::add_changed: %s",e.str());
}
+ REGION_DESTROY (pScreen, newreg);
}
void XserverDesktop::add_copied(RegionPtr dst, int dx, int dy)
{
- if (ignoreHooks_) return;
- if (grabbing) return;
- try {
- rfb::Region rfbReg;
- rfbReg.setExtentsAndOrderedRects((ShortRect*)REGION_EXTENTS(pScreen, dst),
- REGION_NUM_RECTS(dst),
- (ShortRect*)REGION_RECTS(dst));
- server->add_copied(rfbReg, rfb::Point(dx, dy));
- deferUpdate();
- } catch (rdr::Exception& e) {
- vlog.error("XserverDesktop::add_copied: %s",e.str());
- }
+ add_changed (dst);
+ REGION_TRANSLATE (pScreen, dst, -dx, -dy);
+ add_changed (dst);
}
void XserverDesktop::positionCursor()

25
vnc-manminor.patch Normal file
View file

@ -0,0 +1,25 @@
diff -up vnc-4_1_2-unixsrc/unix/vncviewer/vncviewer.man.pedantic vnc-4_1_2-unixsrc/unix/vncviewer/vncviewer.man
--- vnc-4_1_2-unixsrc/unix/vncviewer/vncviewer.man.pedantic 2008-03-13 14:55:08.000000000 +0100
+++ vnc-4_1_2-unixsrc/unix/vncviewer/vncviewer.man 2008-03-13 14:55:58.000000000 +0100
@@ -8,6 +8,10 @@ vncviewer \- VNC viewer for X
.br
.B vncviewer
.RI [ options ]
+.RI [ host ][:: port ]
+.br
+.B vncviewer
+.RI [ options ]
.B \-listen
.RI [ port ]
.SH DESCRIPTION
@@ -182,8 +186,8 @@ prefix from the entries in "/usr/include
.TP
\fB\-via\fR \fIgateway\fR
Automatically create encrypted TCP tunnel to the \fIgateway\fR machine
-before connection, connect to the \fIhost\fR through that tunnel
-(TightVNC\-specific). By default, this option invokes SSH local port
+before connection, connect to the \fIhost\fR through that tunnel. By default,
+this option invokes SSH local port
forwarding, assuming that SSH client binary can be accessed as
/usr/bin/ssh. Note that when using the \fB\-via\fR option, the host
machine name should be specified as known to the gateway machine, e.g.

192
vnc-viewerIPv6.patch Normal file
View file

@ -0,0 +1,192 @@
diff -up vnc-4_1_2-unixsrc/common/network/Makefile.am.ipv6 vnc-4_1_2-unixsrc/common/network/Makefile.am
--- vnc-4_1_2-unixsrc/common/network/Makefile.am.ipv6 2008-06-02 10:22:17.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/network/Makefile.am 2008-06-02 10:52:56.000000000 +0200
@@ -1,5 +1,7 @@
noinst_LTLIBRARIES = libnetwork.la
+libnetwork_la_CPPFLAGS = -DHAVE_GETADDRINFO
+
libnetwork_la_SOURCES = \
Socket.h \
TcpSocket.cxx \
diff -up vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6 vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx
--- vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6 2008-06-02 10:22:17.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx 2008-06-02 10:49:04.000000000 +0200
@@ -109,50 +109,99 @@ TcpSocket::TcpSocket(int sock, bool clos
TcpSocket::TcpSocket(const char *host, int port)
: closeFd(true)
{
- int sock;
+#define CAST_ADDR(x) (*((struct x *)&addr))
+ int sock, err, family, result = -1;
+ size_t addrlen;
+ struct sockaddr_storage addr;
+#ifdef HAVE_GETADDRINFO
+ struct addrinfo *ai, *current, hints;
+#endif
// - Create a socket
initSockets();
- if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
- throw SocketException("unable to create socket", errorNumber);
-#ifndef WIN32
- // - By default, close the socket on exec()
- fcntl(sock, F_SETFD, FD_CLOEXEC);
-#endif
+#ifdef HAVE_GETADDRINFO
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_canonname = NULL;
+ hints.ai_addr = NULL;
+ hints.ai_next = NULL;
+
+ if ((result = getaddrinfo(host, NULL, &hints, &ai)) != 0) {
+ throw Exception("unable to resolve host by name: %s",
+ gai_strerror(result));
+ }
+
+ for (current = ai; current != NULL; current = current->ai_next) {
+ family = current->ai_family;
+ if (family != AF_INET && family != AF_INET6)
+ continue;
+
+ addrlen = current->ai_addrlen;
+ memcpy(&addr, current->ai_addr, addrlen);
+
+ if (family == AF_INET)
+ CAST_ADDR(sockaddr_in).sin_port = htons(port);
+ else
+ CAST_ADDR(sockaddr_in6).sin6_port = htons(port);
- // - Connect it to something
+#else
+ family = AF_INET;
+ addrlen = sizeof(struct sockaddr_in);
- // Try processing the host as an IP address
- struct sockaddr_in addr;
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr(host);
- addr.sin_port = htons(port);
- if ((int)addr.sin_addr.s_addr == -1) {
- // Host was not an IP address - try resolving as DNS name
- struct hostent *hostinfo;
- hostinfo = gethostbyname(host);
- if (hostinfo && hostinfo->h_addr) {
- addr.sin_addr.s_addr = ((struct in_addr *)hostinfo->h_addr)->s_addr;
- } else {
- int e = errorNumber;
- closesocket(sock);
- throw SocketException("unable to resolve host by name", e);
+ // Try processing the host as an IP address
+ memset(&addr, 0, addrlen);
+ CAST_ADDR(sockaddr_in).sin_family = AF_INET;
+ CAST_ADDR(sockaddr_in).sin_addr.s_addr = inet_addr(host);
+ CAST_ADDR(sockaddr_in).sin_port = htons(port);
+ if ((int)CAST_ADDR(sockaddr_in).sin_addr.s_addr == -1) {
+ // Host was not an IP address - try resolving as DNS name
+ struct hostent *hostinfo;
+ hostinfo = gethostbyname(host);
+ if (hostinfo && hostinfo->h_addr) {
+ CAST_ADDR(sockaddr_in).sin_addr.s_addr =
+ ((struct in_addr *)hostinfo->h_addr)->s_addr;
+ } else {
+ err = errorNumber;
+ throw SocketException("unable to resolve host by name", err);
+ }
+ }
+#endif
+ sock = socket (family, SOCK_STREAM, 0);
+ if (sock == -1) {
+ err = errorNumber;
+#ifdef HAVE_GETADDRINFO
+ freeaddrinfo(ai);
+#endif
+ throw SocketException("unable to create socket", err);
}
- }
- // Attempt to connect to the remote host
- for (;;) {
- if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
- int e = errorNumber;
- if (e == EINTR)
- continue;
+ // Attempt to connect to the remote host
+ while ((result = connect(sock, (struct sockaddr *)&addr, addrlen)) == -1) {
+ err = errorNumber;
+ if (err == EINTR)
+ continue;
closesocket(sock);
- throw SocketException("unable to connect to host", e);
- } else break;
+ break;
+ }
+#ifdef HAVE_GETADDRINFO
+ if (result == 0)
+ break;
+ else
+ continue;
}
+ freeaddrinfo(ai);
+#endif
+ if (result == -1)
+ throw SocketException("unable connect to socket", err);
+
+#ifndef WIN32
+ // - By default, close the socket on exec()
+ fcntl(sock, F_SETFD, FD_CLOEXEC);
+#endif
+
// Disable Nagle's algorithm, to reduce latency
enableNagles(sock, false);
diff -up vnc-4_1_2-unixsrc/common/rdr/Exception.cxx.ipv6 vnc-4_1_2-unixsrc/common/rdr/Exception.cxx
--- vnc-4_1_2-unixsrc/common/rdr/Exception.cxx.ipv6 2008-06-02 10:23:35.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/rdr/Exception.cxx 2008-06-02 10:28:51.000000000 +0200
@@ -22,8 +22,23 @@
#include <winsock2.h>
#endif
+#include <stdarg.h>
+
using namespace rdr;
+Exception::Exception(const char *format, ...) {
+ va_list ap;
+ int result;
+
+ va_start(ap, format);
+ result = vsnprintf(str_, len, format, ap);
+ va_end(ap);
+
+ /* XXX - ensure that string ends correctly */
+ if (result > len)
+ str_[len - 1] = '\0';
+}
+
SystemException::SystemException(const char* s, int err_)
: Exception(s), err(err_)
{
diff -up vnc-4_1_2-unixsrc/common/rdr/Exception.h.ipv6 vnc-4_1_2-unixsrc/common/rdr/Exception.h
--- vnc-4_1_2-unixsrc/common/rdr/Exception.h.ipv6 2008-06-02 10:23:05.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/rdr/Exception.h 2008-06-02 10:28:41.000000000 +0200
@@ -27,13 +27,7 @@ namespace rdr {
struct Exception {
enum { len = 256 };
char str_[len];
- Exception(const char* s=0) {
- str_[0] = 0;
- if (s)
- strncat(str_, s, len-1);
- else
- strcat(str_, "Exception");
- }
+ Exception(const char *format, ...);
virtual const char* str() const { return str_; }
};

View file

@ -4,7 +4,7 @@
Summary: A remote display system
Name: vnc
Version: 4.1.2
Release: 22%{?dist}
Release: 24.1%{?dist}
URL: http://www.realvnc.com
Source0: http://www.realvnc.com/dist/vnc-%{vnc_version}-unixsrc.tar.gz
Source1: http://www.realvnc.com/dist/vnc-%{java_vnc_version}-javasrc.tar.gz
@ -27,7 +27,6 @@ Patch16: vnc-64bit.patch
Patch17: vnc-select.patch
Patch19: vnc-ppc64.patch
Patch21: vnc-newfbsize.patch
Patch23: vnc-210617.patch
Patch24: vnc-102434.patch
Patch25: vnc-config.patch
Patch28: vnc-render.patch
@ -37,6 +36,9 @@ Patch33: vnc-always_use_fb.patch
Patch34: vnc-vsnprintf.patch
Patch36: vnc-24bit.patch
Patch37: vnc-noxorg.patch
Patch39: vnc-manminor.patch
Patch40: vnc-bounds.patch
Patch41: vnc-viewerIPv6.patch
License: GPLv2
Group: User Interface/Desktops
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@ -69,7 +71,7 @@ server.
%package server
Summary: A VNC server
Requires: bash >= 2.0, util-linux, xorg-x11-fonts-base, xorg-x11-xauth, chkconfig
Requires: bash >= 2.0, util-linux, xorg-x11-fonts-misc, xorg-x11-xauth, chkconfig
Requires: vnc-libs
Group: User Interface/X
@ -103,7 +105,6 @@ cp -r %{_datadir}/xorg-x11-server-source unix
%patch17 -p1 -b .select
%patch19 -p1 -b .ppc64
%patch21 -p1 -b .newfbsize
%patch23 -p1 -b .ipv6
%patch24 -p1 -b .102434
%patch25 -p1 -b .config
%patch28 -p1 -b .render
@ -124,6 +125,10 @@ cp -a unix/xorg-x11-server-source/{fb/fbrop.h,hw/vnc}
sed -i -e 's,xor,c_xor,' -e 's,and,c_and,' \
unix/xorg-x11-server-source/hw/vnc/{cfb,fb,fbrop}.h
%patch39 -p1 -b .minor
%patch40 -p1 -b .bounds
%patch41 -p1 -b .ipv6
%build
cd common
autoreconf --install --force
@ -147,12 +152,12 @@ aclocal; automake -a; autoconf
--disable-xorgcfg \
--disable-xprint \
--disable-static \
--enable-composite \
--disable-composite \
--enable-xtrap \
--enable-xcsecurity \
--with-default-font-path="unix/:7100,built-ins" \
--with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
--with-fontdir=%{_datadir}/X11/fonts \
--with-os-name="Fedora Core 8" \
--with-os-name="Fedora 8" \
--with-os-vendor="Red Hat, Inc." \
--with-xkb-output=%{_localstatedir}/lib/xkb \
--with-rgb-path=%{_datadir}/X11/rgb \
@ -312,6 +317,21 @@ fi
%{_libdir}/librfb.so.*
%changelog
* Mon Jun 30 2008 Adam Tkac <atkac redhat com> 4.1.2-24.1
- improved IPv6 support in viewer (#438422)
* Wed Mar 19 2008 Adam Tkac <atkac redhat com> 4.1.2-24
- minor vncviewer manpage fixes (#427672, #427701)
- validate framebuffer bounds before GetImage call (#430468)
* Wed Dec 19 2007 Adam Tkac <atkac redhat com> 4.1.2-23.1
- changed default fontpath to
catalogue:/etc/X11/fontpath.d,built-ins (#390971)
- Requires xorg-x11-fonts-misc instead xorg-x11-fonts-base
* Tue Oct 23 2007 Adam Tkac <atkac redhat com> 4.1.2-23
- disabled Composite extension (#242280, #339811)
* Mon Sep 24 2007 Adam Tkac <atkac redhat com> 4.1.2-22
- obsoleted vnc-s390.patch
- build with --disable-xorg