--- vnc4-4.1.1+X4.3.0.orig/unix/xc/config/cf/vnc.def +++ vnc4-4.1.1+X4.3.0/unix/xc/config/cf/vnc.def @@ -5,7 +5,7 @@ #define BuildPexExt NO #define BuildNls NO #define BuildXIE NO -#define BuildGlxExt NO +#define BuildGlxExt YES #define XnestServer NO #define XprtServer NO --- vnc4-4.1.1+X4.3.0.orig/unix/xc/config/cf/vnc.def.in +++ vnc4-4.1.1+X4.3.0/unix/xc/config/cf/vnc.def.in @@ -0,0 +1,38 @@ +#define BuildServersOnly YES +#define BuildFonts NO +#define BuildClients NO +#define BuildDocs NO +#define BuildPexExt NO +#define BuildNls NO +#define BuildXIE NO +#define BuildGlxExt NO +#define XnestServer YES +#define XF86Server NO +#define XprtServer NO + +#ifdef SunArchitecture +#define ProjectRoot /usr/openwin +#define HasGcc2 YES +#define BuildXKB NO +#endif + +#define HasFreetype2 NO +#define BuildVNCExt YES +#define VNCExtDefines -DVNCEXT +#define SiteExtensionDefines VNCExtDefines +#define SiteExtensionDirs vnc + +#define VncUseFb @USE_FB@ + +#define VncUnixDir $(TOP)/.. +#define VncCommonDir VncUnixDir/../common +#define VncExtLibs VncCommonDir/rfb/librfb.a \ + VncCommonDir/Xregion/libXregion.a \ + VncCommonDir/network/libnetwork.a \ + VncCommonDir/rdr/librdr.a + +#define SiteExtensionLibs vnc/LibraryTargetName(vnc) VncExtLibs + +#define ServerTarget(server,subdirs,objects,libs,syslibs) @@\ +CCLINK = $(CXXENVSETUP) $(CXX) @@\ +ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,$(_NOOP_)) --- vnc4-4.1.1+X4.3.0.orig/unix/xc/config/cf/linux.cf +++ vnc4-4.1.1+X4.3.0/unix/xc/config/cf/linux.cf @@ -313,6 +313,8 @@ # define BuildXF86DRI NO # endif #endif +#undef BuildXF86DRI +#define BuildXF86DRI NO /* * Build shared libGL and the DRI modules without -fPIC on some architectures. @@ -816,7 +818,11 @@ # endif # define LinuxMachineDefines -D__powerpc__ # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET +# ifdef __powerpc64__ +# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 +# else # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines +# endif #endif /* PpcArchitecture */ #ifdef s390Architecture --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile @@ -31,12 +31,19 @@ OBJS1 = os2_stubs.o #endif +#ifdef VncUseFb +FB_DEFINES = -DVNC_USE_FB + FBINCLUDE = -I../../fb +#else + FBINCLUDE = -I../../cfb +#endif + SRCSA = xvnc.cc stubs.c $(SRCS1) miinitext.c $(SRCS2) OBJSA = xvnc.o stubs.o $(OBJS1) miinitext.o $(OBJS2) -INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I../../cfb -I../../mfb -I../../mi -I../../include -I../../os \ +INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) $(FB_DEFINES) \ + $(FBINCLUDE) -I../../mfb -I../../mi -I../../include -I../../os \ -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/render $(VNCINCLUDE) DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) \ @@ -48,7 +55,7 @@ * Make sure XINPUT, XF86VidTune, etc arent defined for the miinitext.o * used by Xvnc */ -EXT_DEFINES = ExtensionDefines -UXF86VIDMODE -UXFreeXDGA -UXF86MISC +EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC #endif @@ -70,7 +77,7 @@ SpecialCplusplusObjectRule(xvnc,$(ICONFIGFILES) xvnc,$(EXT_DEFINES) $(NO_OPERATOR_NAMES)) LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) +SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) /* InstallManPage(Xvfb,$(MANDIR)) */ DependTarget() --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc @@ -48,8 +48,12 @@ #include "X11/Xos.h" #include "scrnintstr.h" #include "servermd.h" +#ifdef VNC_USE_FB +#include "fb.h" +#else #define PSZ 8 #include "cfb.h" +#endif #include "mi.h" #include "mibstore.h" #include "colormapst.h" @@ -73,6 +77,7 @@ #undef public #undef xor #undef and +#ifndef VNC_USE_FB extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int); extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int); extern Bool cfb16CreateGC(GCPtr); @@ -83,6 +88,7 @@ unsigned long, char*); extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int, unsigned long, char*); +#endif } #define XVNCVERSION "Free Edition 4.1.1" @@ -129,6 +135,9 @@ static Bool vfbPixmapDepths[33]; static char needswap = 0; static int lastScreen = -1; +#ifdef RENDER +static Bool Render = FALSE; +#endif static bool displaySpecified = false; static bool wellKnownSocketsCreated = false; @@ -220,6 +229,10 @@ VENDOR_STRING); ErrorF("-screen scrn WxHxD set screen's width, height, depth\n"); ErrorF("-pixdepths list-of-int support given pixmap depths\n"); +#ifdef RENDER + ErrorF("+/-render turn on/off RENDER extension support" + "(default on)\n"); +#endif ErrorF("-linebias n adjust thin line pixelization\n"); ErrorF("-blackpixel n pixel value for black\n"); ErrorF("-whitepixel n pixel value for white\n"); @@ -316,6 +329,20 @@ return ret; } +#ifdef RENDER + if (strcmp (argv[i], "+render") == 0) /* +render */ + { + Render = TRUE; + return 1; + } + + if (strcmp (argv[i], "-render") == 0) /* -render */ + { + Render = FALSE; + return 1; + } +#endif + if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */ { Pixel pix; @@ -482,7 +509,7 @@ } #endif - +#ifndef VNC_USE_FB static Bool vfbMultiDepthCreateGC(GCPtr pGC) { switch (vfbBitsPerPixel(pGC->depth)) @@ -541,6 +568,7 @@ break; } } +#endif static ColormapPtr InstalledMaps[MAXSCREENS]; @@ -811,6 +839,16 @@ defaultColorVisualClass = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor; +#ifdef VNC_USE_FB + if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, + dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel)) + return FALSE; + +#ifdef RENDER + if (ret && Render) + fbPictureInit(pScreen, 0, 0); +#endif /* RENDER */ +#else /* VNC_USE_FB */ switch (pvfb->bitsPerPixel) { case 1: @@ -838,6 +876,7 @@ pScreen->CreateGC = vfbMultiDepthCreateGC; pScreen->GetImage = vfbMultiDepthGetImage; pScreen->GetSpans = vfbMultiDepthGetSpans; +#endif pScreen->InstallColormap = vfbInstallColormap; pScreen->UninstallColormap = vfbUninstallColormap; @@ -883,6 +922,9 @@ } } +#ifdef VNC_USE_FB + ret = fbCreateDefColormap(pScreen); +#else if (pvfb->bitsPerPixel == 1) { ret = mfbCreateDefColormap(pScreen); @@ -891,6 +933,7 @@ { ret = cfbCreateDefColormap(pScreen); } +#endif miSetZeroLineBias(pScreen, pvfb->lineBias); @@ -926,6 +969,19 @@ vfbPixmapDepths[vfbScreens[i].depth] = TRUE; } +#ifdef RENDER + /* RENDER needs a good set of pixmaps. */ + if (Render) { + vfbPixmapDepths[1] = TRUE; + vfbPixmapDepths[4] = TRUE; + vfbPixmapDepths[8] = TRUE; +/* vfbPixmapDepths[15] = TRUE; */ + vfbPixmapDepths[16] = TRUE; + vfbPixmapDepths[24] = TRUE; + vfbPixmapDepths[32] = TRUE; + } +#endif + for (i = 1; i <= 32; i++) { if (vfbPixmapDepths[i]) --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/module/Imakefile +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/module/Imakefile @@ -13,15 +13,16 @@ OBJS = vncExtInit.o vncHooks.o xf86vncModule.o XserverDesktop.o INCLUDES = -I.. -I../../include -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -I$(FONTINCSRC) -I$(XF86COMSRC) \ - $(VNCINCLUDE) - DEFINES = $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER + -I../../render $(VNCINCLUDE) + DEFINES = -fPIC $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER LinkSourceFile(vncExtInit.cc,..) LinkSourceFile(vncHooks.cc,..) LinkSourceFile(xf86vncModule.cc,..) LinkSourceFile(XserverDesktop.cc,..) -ModuleObjectRule() +.CCsuf.Osuf: + NormalSharedLibObjCplusplusCompile($(_NOOP_)) /* LibraryModuleTarget(vnc,$(OBJS) $(VNCLIBS)) InstallLibraryModule(vnc,$(MODULEDIR),extensions) --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/vncExtInit.cc +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/vncExtInit.cc @@ -751,7 +751,7 @@ rep.timeout = qcTimeout; rep.addrLen = qcTimeout ? strlen(qcAddress) : 0; rep.userLen = qcTimeout ? strlen(qcUsername) : 0; - rep.opaqueId = (CARD32)queryConnectId; + rep.opaqueId = (CARD32)(long)queryConnectId; rep.length = (rep.userLen + rep.addrLen + 3) >> 2; if (client->swapped) { swaps(&rep.sequenceNumber, n); --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Imakefile +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/Imakefile @@ -19,7 +19,7 @@ SRCS = vncExtInit.cc vncHooks.cc XserverDesktop.cc OBJS = vncExtInit.o vncHooks.o XserverDesktop.o INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I../mfb -I../mi $(VNCINCLUDE) + -I../render $(VNCINCLUDE) #if defined(XFree86Version) && XFree86Version >= 4000 VNCDEFINES = -DGC_HAS_COMPOSITE_CLIP #endif @@ -36,8 +36,8 @@ NormalLintTarget($(SRCS)) NormalLibraryObjectRule() -NormalCplusplusObjectRule() - +.CCsuf.Osuf: + NormalSharedLibObjCplusplusCompile($(_NOOP_)) MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/vncHooks.cc +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/vnc/vncHooks.cc @@ -29,6 +29,9 @@ #include "regionstr.h" #include "dixfontstr.h" #include "colormapst.h" +#ifdef RENDER +#include "picturestr.h" +#endif #ifdef GC_HAS_COMPOSITE_CLIP #define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip) @@ -74,6 +77,9 @@ StoreColorsProcPtr StoreColors; DisplayCursorProcPtr DisplayCursor; ScreenBlockHandlerProcPtr BlockHandler; +#ifdef RENDER + CompositeProcPtr Composite; +#endif } vncHooksScreenRec, *vncHooksScreenPtr; typedef struct { @@ -104,6 +110,13 @@ static Bool vncHooksDisplayCursor(ScreenPtr pScreen, CursorPtr cursor); static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask); +#ifdef RENDER +static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, + PicturePtr pDst, INT16 xSrc, INT16 ySrc, + INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, + CARD16 width, CARD16 height); +#endif + // GC "funcs" @@ -229,6 +242,13 @@ vncHooksScreen->StoreColors = pScreen->StoreColors; vncHooksScreen->DisplayCursor = pScreen->DisplayCursor; vncHooksScreen->BlockHandler = pScreen->BlockHandler; +#ifdef RENDER + PictureScreenPtr ps; + ps = GetPictureScreenIfSet(pScreen); + if (ps) { + vncHooksScreen->Composite = ps->Composite; + } +#endif pScreen->CloseScreen = vncHooksCloseScreen; pScreen->CreateGC = vncHooksCreateGC; @@ -241,6 +261,11 @@ pScreen->StoreColors = vncHooksStoreColors; pScreen->DisplayCursor = vncHooksDisplayCursor; pScreen->BlockHandler = vncHooksBlockHandler; +#ifdef RENDER + if (ps) { + ps->Composite = vncHooksComposite; + } +#endif return TRUE; } @@ -470,6 +495,38 @@ SCREEN_REWRAP(BlockHandler); } +// Composite - needed for RENDER + +#ifdef RENDER +void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, + PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, + INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, + CARD16 height) +{ + ScreenPtr pScreen = pDst->pDrawable->pScreen; + vncHooksScreenPtr vncHooksScreen = \ + ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); + BoxRec box; + PictureScreenPtr ps = GetPictureScreen(pScreen); + + if ((xDst >= 0) && (yDst >= 0)) { + box.x1 = pDst->pDrawable->x + xDst; + box.y1 = pDst->pDrawable->y + yDst; + box.x2 = box.x1 + width; + box.y2 = box.y1 + height; + + RegionHelper changed(pScreen, &box, 0); + vncHooksScreen->desktop->add_changed(changed.reg); + } + + ps->Composite = vncHooksScreen->Composite; + (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, + xMask, yMask, xDst, yDst, width, height); + ps->Composite = vncHooksComposite; +} + +#endif /* RENDER */ + ///////////////////////////////////////////////////////////////////////////// --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c @@ -87,19 +87,20 @@ struct kbd_repeat kbdrep_s; /* don't change, just test */ - kbdrep_s.rate = -1; + /*kbdrep_s.rate = -1;*/ kbdrep_s.delay = -1; if (ioctl( 0, KDKBDREP, &kbdrep_s )) { return 0; } /* do the change */ - if (rate == 0) /* switch repeat off */ - kbdrep_s.rate = 0; - else - kbdrep_s.rate = 10000 / rate; /* convert cps to msec */ - if (kbdrep_s.rate < 1) - kbdrep_s.rate = 1; + /*if (rate == 0)*/ /* switch repeat off */ + /* kbdrep_s.rate = 0;*/ + /*else*/ + /* kbdrep_s.rate = 10000 / rate;*/ /* convert cps to msec */ + /* if (kbdrep_s.rate < 1)*/ + /* kbdrep_s.rate = 1; */ + kbdrep_s.delay = delay; if (kbdrep_s.delay < 1) kbdrep_s.delay = 1; @@ -124,10 +125,10 @@ if (fd == -1) return 0; - kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */ + /*kbdrate_s.rate = (rate + 5) / 10;*/ /* must be integer, so round up */ kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */ - if (kbdrate_s.rate > 50) - kbdrate_s.rate = 50; + /*if (kbdrate_s.rate > 50) + kbdrate_s.rate = 50;*/ if (ioctl( fd, KIOCSRATE, &kbdrate_s )) return 0; --- vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c +++ vnc4-4.1.1+X4.3.0/unix/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c @@ -107,19 +107,19 @@ struct kbd_repeat kbdrep_s; /* don't change, just test */ - kbdrep_s.rate = -1; + /*kbdrep_s.rate = -1;*/ kbdrep_s.delay = -1; if (ioctl( 0, KDKBDREP, &kbdrep_s )) { return 0; } /* do the change */ - if (rate == 0) /* switch repeat off */ - kbdrep_s.rate = 0; - else - kbdrep_s.rate = 10000 / rate; /* convert cps to msec */ - if (kbdrep_s.rate < 1) - kbdrep_s.rate = 1; + /*if (rate == 0)*/ /* switch repeat off */ + /* kbdrep_s.rate = 0;*/ + /*else + kbdrep_s.rate = 10000 / rate;*/ /* convert cps to msec */ + /*if (kbdrep_s.rate < 1) + kbdrep_s.rate = 1;*/ kbdrep_s.delay = delay; if (kbdrep_s.delay < 1) kbdrep_s.delay = 1; @@ -144,10 +144,10 @@ if (fd == -1) return 0; - kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */ + /*kbdrate_s.rate = (rate + 5) / 10;*/ /* must be integer, so round up */ kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */ - if (kbdrate_s.rate > 50) - kbdrate_s.rate = 50; + /*if (kbdrate_s.rate > 50) + kbdrate_s.rate = 50;*/ if (ioctl( fd, KIOCSRATE, &kbdrate_s )) return 0; --- vnc4-4.1.1+X4.3.0.orig/unix/xc/include/Xmd.h +++ vnc4-4.1.1+X4.3.0/unix/xc/include/Xmd.h @@ -60,7 +60,7 @@ #endif #if defined(__alpha) || defined(__alpha__) || \ defined(__ia64__) || defined(ia64) || \ - defined(__sparc64__) || \ + defined(__sparc64__) || defined(__powerpc64__) || \ defined(__s390x__) || \ (defined(__hppa__) && defined(__LP64__)) || \ defined(__x86_64__) || defined(x86_64) --- vnc4-4.1.1+X4.3.0.orig/unix/vncpasswd/vncpasswd.cxx +++ vnc4-4.1.1+X4.3.0/unix/vncpasswd/vncpasswd.cxx @@ -117,6 +117,9 @@ continue; } + if (strlen(passwd.buf) > 8) + fprintf(stderr,"Password too long - only the first 8 characters will be used\n"); + FILE* fp = fopen(fname,"w"); if (!fp) { fprintf(stderr,"Couldn't open %s for writing\n",fname); --- vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.cxx +++ vnc4-4.1.1+X4.3.0/unix/vncviewer/vncviewer.cxx @@ -41,6 +41,7 @@ using namespace network; using namespace rfb; +using namespace std; IntParameter pointerEventInterval("PointerEventInterval", "Time in milliseconds to rate-limit" @@ -95,6 +96,9 @@ StringParameter geometry("geometry", "X geometry specification", ""); StringParameter displayname("display", "The X display", ""); +/* Support for tunnelling */ +StringParameter via("via", "Gateway to tunnel via", ""); + char aboutText[256]; char* programName; extern char buildtime[]; @@ -157,6 +161,61 @@ exit(1); } +/* Tunnelling support. */ +static void +interpretViaParam (char **gatewayHost, char **remoteHost, + int *remotePort, char **vncServerName, + int localPort) +{ + const int SERVER_PORT_OFFSET = 5900; + char *pos = strchr (*vncServerName, ':'); + if (pos == NULL) + *remotePort = SERVER_PORT_OFFSET; + else { + int portOffset = SERVER_PORT_OFFSET; + size_t len; + *pos++ = '\0'; + len = strlen (pos); + if (*pos == ':') { + /* Two colons is an absolute port number, not an offset. */ + pos++; + len--; + portOffset = 0; + } + if (!len || strspn (pos, "-0123456789") != len ) + usage (); + *remotePort = atoi (pos) + portOffset; + } + + if (**vncServerName != '\0') + *remoteHost = *vncServerName; + + *gatewayHost = strDup (via.getValueStr ()); + *vncServerName = new char[50]; + sprintf (*vncServerName, "localhost::%d", localPort); +} + +static void +createTunnel (const char *gatewayHost, const char *remoteHost, + int remotePort, int localPort) +{ + char *cmd = getenv ("VNC_VIA_CMD"); + char *percent; + char lport[10], rport[10]; + sprintf (lport, "%d", localPort); + sprintf (rport, "%d", remotePort); + setenv ("G", gatewayHost, 1); + setenv ("H", remoteHost, 1); + setenv ("R", rport, 1); + setenv ("L", lport, 1); + if (!cmd) + cmd = "/usr/bin/ssh -f -L \"$L\":\"$H\":\"$R\" \"$G\" sleep 20"; + /* Compatibility with TightVNC's method. */ + while ((percent = strchr (cmd, '%')) != NULL) + *percent = '$'; + system (cmd); +} + int main(int argc, char** argv) { sprintf(aboutText, "VNC Viewer Free Edition 4.1.1 for X - built %s\n" @@ -190,8 +249,6 @@ usage(); } - if (vncServerName) - usage(); vncServerName = argv[i]; } @@ -207,6 +264,19 @@ vlog.error("Could not create .vnc directory: environment variable $HOME not set."); try { + /* Tunnelling support. */ + if (strlen (via.getValueStr ()) > 0) { + char *gatewayHost = ""; + char *remoteHost = "localhost"; + int localPort = findFreeTcpPort (); + int remotePort; + if (!vncServerName) + usage(); + interpretViaParam (&gatewayHost, &remoteHost, &remotePort, + &vncServerName, localPort); + createTunnel (gatewayHost, remoteHost, remotePort, localPort); + } + Socket* sock = 0; if (listenMode) { --- vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.man +++ vnc4-4.1.1+X4.3.0/unix/vncviewer/vncviewer.man @@ -174,6 +174,23 @@ specified as an X11 keysym name (these can be obtained by removing the XK_ prefix from the entries in "/usr/include/X11/keysymdef.h"). Default is F8. +.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 +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. +"localhost" denotes the \fIgateway\fR, not the machine where vncviewer +was launched. The environment variable \fIVNC_VIA_CMD\fR can override +the default tunnel command of +\fB/usr/bin/ssh\ -f\ -L\ "$L":"$H":"$R"\ "$G"\ sleep\ 20\fR. The tunnel +command is executed with the environment variables \fIL\fR, \fIH\fR, +\fIR\fR, and \fIG\fR taken the values of the local port number, the remote +host, the port number on the remote host, and the gateway machine +respectively. + .SH SEE ALSO .BR Xvnc (1), .BR vncpasswd (1), --- vnc4-4.1.1+X4.3.0.orig/unix/x0vncserver/x0vncserver.cxx +++ vnc4-4.1.1+X4.3.0/unix/x0vncserver/x0vncserver.cxx @@ -36,7 +36,7 @@ #include #include #include - +#include //#include @@ -48,6 +48,9 @@ StringParameter displayname("display", "The X display", ""); IntParameter rfbport("rfbport", "TCP port to listen for RFB protocol",5900); +BoolParameter localhostOnly("localhost", + "Only allow connections from localhost", + false); IntParameter queryConnectTimeout("QueryConnectTimeout", "Number of seconds to show the Accept Connection dialog before " "rejecting the connection", @@ -293,7 +296,7 @@ QueryConnHandler qcHandler(dpy, &server); server.setQueryConnectionHandler(&qcHandler); - TcpListener listener((int)rfbport); + TcpListener listener((int)rfbport, localhostOnly); vlog.info("Listening on port %d", (int)rfbport); while (true) { @@ -307,6 +310,8 @@ TXWindow::handleXEvents(dpy); // Process expired timers and get the time until the next one + tv.tv_sec = 0; + tv.tv_usec = 100000; int timeoutMs = Timer::checkTimeouts(); soonestTimeout(&timeoutMs, server.checkTimeouts()); if (timeoutMs) { --- vnc4-4.1.1+X4.3.0.orig/unix/boilerplate.mk +++ vnc4-4.1.1+X4.3.0/unix/boilerplate.mk @@ -15,7 +15,7 @@ CFLAGS = @CFLAGS@ $(DIR_CFLAGS) CCLD = $(CC) CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ +CXXFLAGS = @CXXFLAGS@ $(DIR_CXXFLAGS) CXXLD = $(CXX) CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ --- vnc4-4.1.1+X4.3.0.orig/unix/configure.in +++ vnc4-4.1.1+X4.3.0/unix/configure.in @@ -65,6 +65,18 @@ AC_SUBST(ZLIB_INCLUDE) AC_SUBST(ZLIB_LIB) +AC_ARG_WITH(fb, +[ --with-fb use the new 'fb' framebuffer implementation]) +if test "$with_installed_zlib" = yes; then + echo "using 'fb' framebuffer" + USE_FB=YES +else + echo "using 'mfb' and 'cfb' framebuffer" + USE_FB=NO +fi + +AC_SUBST(USE_FB) + BOILERPLATE=boilerplate.mk if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then @@ -79,4 +91,5 @@ vncviewer/Makefile:common.mk:vncviewer/Makefile.in:$BOILERPLATE \ vncconfig/Makefile:common.mk:vncconfig/Makefile.in:$BOILERPLATE \ vncpasswd/Makefile:common.mk:vncpasswd/Makefile.in:$BOILERPLATE \ + xc/config/cf/vnc.def \ ) --- vnc4-4.1.1+X4.3.0.orig/unix/xc.patch +++ vnc4-4.1.1+X4.3.0/unix/xc.patch @@ -2,7 +2,7 @@ --- xc/programs/Xserver/Imakefile Fri Jun 6 11:14:39 2003 *************** *** 409,412 **** ---- 409,429 ---- +--- 409,435 ---- #endif #endif /* XsunServer */ + XCOMM @@ -13,12 +13,18 @@ + CFB16DIR = cfb16 + CFB24DIR = cfb24 + CFB32DIR = cfb32 ++ FBDIR = fb + XVNCDDXDIR = vnc/Xvnc ++ #if VncUseFb ++ XVNCDIRS = $(STDDIRS) $(FBDIR) $(XVNCDDXDIR) $(DEPDIRS) ++ XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) FbPostFbLibs ++ #else + XVNCDIRS = $(STDDIRS) $(MFBDIR) \ + $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ + $(XVNCDDXDIR) $(DEPDIRS) -+ XVNCOBJS = $(XVNCDDXDIR)/stubs.o $(XVNCDDXDIR)/miinitext.o + XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) CFBLibs PostFbLibs ++ #endif ++ XVNCOBJS = $(XVNCDDXDIR)/stubs.o $(XVNCDDXDIR)/miinitext.o + XVNCSYSLIBS = $(FONTLIBS) $(SYSLIBS) + ServerTarget(Xvnc,$(XVNCDIRS),$(XVNCOBJS), \ + $(LIBCWRAPPER) $(XVNCLIBS) $(LOADABLEEXTS),$(XVNCSYSLIBS)) --- vnc4-4.1.1+X4.3.0.orig/unix/vncserver +++ vnc4-4.1.1+X4.3.0/unix/vncserver @@ -1,5 +1,6 @@ #!/usr/bin/env perl # +# Copyright (C) 2004-2006 Ola Lundqvist # Copyright (C) 2002-2005 RealVNC Ltd. # Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. # @@ -23,6 +24,13 @@ # vncserver - wrapper script to start an X VNC server. # +# This file was heavily edited by Ola Lundqvist using +# options from vnc package. +# Most modifications are written by Marcus.Brinkmann@ruhr-uni-bochum.de and +# now incorporated by Ola. + +# Please report all errors to Debian and not to ORL. + # # First make sure we're operating in a sane environment. # @@ -35,18 +43,75 @@ $geometry = "1024x768"; $depth = 16; -$vncJavaFiles = (((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") || +$vncJavaFiles = (((-d "/usr/share/vnc-java") && "/usr/share/vnc-java") || + ((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") || ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes")); + $vncUserDir = "$ENV{HOME}/.vnc"; $xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority"; $defaultXStartup = ("#!/bin/sh\n\n". + "# Uncomment the following two lines for normal desktop:\n". + "# unset SESSION_MANAGER\n". + "# exec /etc/X11/xinit/xinitrc\n\n". + "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n". "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n". "xsetroot -solid grey\n". "vncconfig -iconic &\n". - "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n". - "twm &\n"); + "x-terminal-emulator -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n". + "x-window-manager &\n"); + +######## Adding configuration possibility ################ +$Config_file = "/etc/vnc.conf"; +&ReadConfigFile(); +$Config_file = "$ENV{HOME}/.vncrc"; +&ReadConfigFile(); + +if (!$XFConfigPath) { + foreach ("/etc/X11/xorg.conf", "/etc/X11/XF86Config-4", "/etc/X11/XF86Config" ){ + $XFConfigPath = $_; + last if ( -e $XFConfigPath ); + } +} +if (!$fontPath) { + &ReadXFConfigFont; +} +if (!$fontPath) { + $fontPath = "/usr/X11R6/lib/X11/fonts/Type1/,". + "/usr/X11R6/lib/X11/fonts/Speedo/,". + "/usr/X11R6/lib/X11/fonts/misc/,". + "/usr/X11R6/lib/X11/fonts/75dpi/,". + "/usr/X11R6/lib/X11/fonts/100dpi/,". + "/usr/share/fonts/X11/misc/,". + "/usr/share/fonts/X11/Type1/,". + "/usr/share/fonts/X11/75dpi/,". + "/usr/share/fonts/X11/100dpi/" +} +if (!$colorPath) { + &ReadXFConfigColor; +} +if (!$colorPath) { + foreach ("/etc/X11/rgb", "/usr/share/X11/rgb", "/usr/X11R6/lib/X11/rgb"){ + $colorPath = $_; + last if ( -e "${colorPath}.txt" ); + } +} + +########################################################## + +$vncUserDirUnderTmp = ($vncUserDir =~ m|^/tmp/.+|) ? 1 : 0; +$xstartup = ($vncUserDirUnderTmp) ? + "$ENV{HOME}/.vncstartup" : "$vncUserDir/xstartup"; +$xstartup = $vncStartup if ($vncStartup); + +unless ($xauthorityFile) { + if ($vncUserDirUnderTmp) { + $xauthorityFile = "$vncUserDir/.Xauthority"; + } else { + $xauthorityFile = "$ENV{HOME}/.Xauthority"; + } +} chop($host = `uname -n`); @@ -54,12 +119,22 @@ # Check command line options &ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1, - "-help",0,"-h",0,"--help",0); + "-help",0,"-h",0,"--help",0, + "-clean",0, "-fp",1, + "-alwaysshared",0, "-nevershared",0, + "-httpport",1,"-basehttpport",1); &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'}); &Kill() if ($opt{'-kill'}); +$useClasses = 0; +if (defined $vncJavaFiles) { + if(-d $vncJavaFiles) { + $useClasses = 1; + } +} + # Uncomment this line if you want default geometry, depth and pixelformat # to match the current X display: # &GetXDisplayDefaults(); @@ -75,8 +150,26 @@ $pixelformat = $opt{'-pixelformat'}; } -&CheckGeometryAndDepth(); +if ($opt{'-fp'}) { + @fontPathElements = split(/\s*,\s*/, "$opt{'-fp'}"); + $fontPath = ''; + + foreach $i (0.."$#fontPathElements") { + $tempFontPath = $fontPathElements[$i]; + if ($tempFontPath !~ m!^[^/]*/[^/]*:\d+$!) { + $tempFontPath =~ s/:unscaled$//; + if (-r "$tempFontPath/fonts.dir") { + $fontPath .= "$fontPathElements[$i],"; + } + } else { + $fontPath .= "$fontPathElements[$i],"; + } + } + chop $fontPath; +} + +&CheckGeometryAndDepth(); # Create the user's vnc directory if necessary. @@ -85,13 +178,18 @@ die "$prog: Could not create $vncUserDir.\n"; } } - + +($z,$z,$mode) = lstat("$vncUserDir"); +if (!-d _ || !-o _ || ($vncUserDirUnderTmp && ($mode & 0777) != 0700)) { + die "$prog: Wrong type or access mode of $vncUserDir.\n"; +} + # Make sure the user has a password. ($z,$z,$mode) = stat("$vncUserDir/passwd"); if (!(-e "$vncUserDir/passwd") || ($mode & 077)) { warn "\nYou will require a password to access your desktops.\n\n"; - system("vncpasswd -q $vncUserDir/passwd"); + system("vncpasswd $vncUserDir/passwd"); if (($? >> 8) != 0) { exit 1; } @@ -116,18 +214,12 @@ $desktopLog = "$vncUserDir/$host:$displayNumber.log"; unlink($desktopLog); -# Make an X server cookie - use as the seed the sum of the current time, our -# PID and part of the encrypted form of the password. Ideally we'd use -# /dev/urandom, but that's only available on Linux. - -srand(time+$$+unpack("L",`cat $vncUserDir/passwd`)); -$cookie = ""; -for (1..16) { - $cookie .= sprintf("%02x", int(rand(256)) % 256); -} - -system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie"); -system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); +# Make an X server cookie - use mcookie +$cookie = `/usr/bin/mcookie`; +open (XAUTH, "|xauth -f $xauthorityFile source -"); +print XAUTH "add $host:$displayNumber . $cookie\n"; +print XAUTH "add $host/unix:$displayNumber . $cookie\n"; +close XAUTH; if ($opt{'-name'}) { $desktopName = $opt{'-name'}; @@ -137,9 +229,21 @@ # Now start the X VNC Server -$cmd = "Xvnc :$displayNumber"; +$cmd = "Xvnc4 :$displayNumber"; $cmd .= " -desktop " . "edString($desktopName); -$cmd .= " -httpd $vncJavaFiles" if ($vncJavaFiles); +if ($useClasses) { + $cmd .= " -httpd $vncJavaFiles"; + print ("Found $vncJavaFiles for http connections.\n"); + if ($opt{'-httpport'}) { + $cmd .= " -httpport $opt{'-httpport'}"; + print ("Listening to $opt{'-httpport'} for http connections.\n"); + } + elsif ($opt{'-basehttpport'}) { + my $v = $opt{'-basehttpport'} + $displayNumber; + print ("Listening to $v for http connections.\n"); + $cmd .= " -httpport $v"; + } +} $cmd .= " -auth $xauthorityFile"; $cmd .= " -geometry $geometry" if ($geometry); $cmd .= " -depth $depth" if ($depth); @@ -154,6 +258,10 @@ # $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/"; # $cmd .= " -co /usr/lib/X11/rgb"; # +$cmd .= " -fp $fontPath" if ($fontPath); +$cmd .= " -co $colorPath" if ($colorPath); +$cmd .= " -alwaysshared" if ($opt{'-alwaysshared'}); +$cmd .= " -nevershared" if ($opt{'-nevershared'}); foreach $arg (@ARGV) { $cmd .= " " . "edString($arg); @@ -165,7 +273,7 @@ $pidFile = "$vncUserDir/$host:$displayNumber.pid"; system("$cmd & echo \$! >$pidFile"); -# Give Xvnc a chance to start up +# Give Xvnc4 a chance to start up sleep(3); @@ -173,17 +281,17 @@ # Create the user's xstartup script if necessary. -if (!(-e "$vncUserDir/xstartup")) { - warn "Creating default startup script $vncUserDir/xstartup\n"; - open(XSTARTUP, ">$vncUserDir/xstartup"); +if (!(-e "$xstartup")) { + warn "Creating default startup script $xstartup\n"; + open(XSTARTUP, ">$xstartup"); print XSTARTUP $defaultXStartup; close(XSTARTUP); - chmod 0755, "$vncUserDir/xstartup"; + chmod 0755, "$xstartup"; } # Run the X startup script. -warn "Starting applications specified in $vncUserDir/xstartup\n"; +warn "Starting applications specified in $xstartup\n"; warn "Log file is $desktopLog\n\n"; # If the unix domain socket exists then use that (DISPLAY=:n) otherwise use @@ -198,10 +306,70 @@ } $ENV{VNCDESKTOP}= $desktopName; -system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &"); +system("$xstartup >> " . "edString($desktopLog) . " 2>&1 &"); exit; +############################ Debian functions ################################# +# I thank Manoj for the code below. +# +# ReadConfigFile reads in a config file and sets variables according to it. +# + +sub ReadConfigFile +{ + open(CONFIG, "$Config_file") || return; + my $lineno = 0; + while () { + chomp; + $lineno++; + s/\#.*//og; + next if /^\s*$/og; + $_ .= ";" unless /;\s*$/; + if (/^\s*([^=]+)\s*=\s*(\S.*)$/o) { + my $ret = eval "$1=$2"; + if ($@) { + print STDERR "Error parsing config file $Config_file!\n"; + print STDERR "$lineno:$_\n"; + } + } + } +} + +sub ReadXFConfigFont +{ + open(CONFIG, "$XFConfigPath") || return; + my $lineno = 0; + while () { + chomp; + $lineno++; + s/\#.*//og; + next if /^\s*$/og; + if (/^\s*FontPath\s*"(\S.*)"\s*$/o) { + $fontPath .= "," if $fontPath; + $fontPath .= $1; + } + } +} + +sub ReadXFConfigColor +{ + open(CONFIG, "$XFConfigPath") || return; + my $lineno = 0; + while ( && !$colorPath) { + chomp; + $lineno++; + s/\#.*//og; + next if /^\s*$/og; + if (/^\s*RgbPath\s*"(\S.*)"\s*$/o) { + $colorPath = $1; + } + } +} + + +########## End of debian functions ########### + ############################################################################### # @@ -415,11 +583,25 @@ sub Usage { - die("\nusage: $prog [:] [-name ] [-depth ]\n". - " [-geometry x]\n". - " [-pixelformat rgbNNN|bgrNNN]\n". - " ...\n\n". - " $prog -kill \n\n"); + die("VNC4 server\n". + "\n". + "Usage: $prog [] [:]\n". + " $prog -kill :\n". + "\n". + " are Xvnc4 options, or:\n". + "\n". + " -name \n". + " -depth \n". + " -geometry x\n". + " -httpport number\n". + " -basehttpport number\n". + " -alwaysshared\n". + " -nevershared\n". + " -pixelformat rgb\n". + " -pixelformat bgr\n". + " ...\n". + "\n". + "See vnc4server and Xvnc4 manual pages for more information.\n"); } @@ -443,12 +625,12 @@ if (! -r $pidFile) { die "\nCan't find file $pidFile\n". - "You'll have to kill the Xvnc process manually\n\n"; + "You'll have to kill the Xvnc4 process manually\n\n"; } $SIG{'HUP'} = 'IGNORE'; chop($pid = `cat $pidFile`); - warn "Killing Xvnc process ID $pid\n"; + warn "Killing Xvnc4 process ID $pid\n"; system("kill $pid"); unlink $pidFile; exit; @@ -518,7 +700,7 @@ # cmd: - foreach $cmd ("uname","xauth","Xvnc","vncpasswd") { + foreach $cmd ("uname","xauth","Xvnc4","vncpasswd") { for (split(/:/,$ENV{PATH})) { if (-x "$_/$cmd") { next cmd; --- vnc4-4.1.1+X4.3.0.orig/common/Xregion/Makefile.in +++ vnc4-4.1.1+X4.3.0/common/Xregion/Makefile.in @@ -12,4 +12,8 @@ $(AR) $(library) $(OBJS) $(RANLIB) $(library) +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC + +DIR_CFLAGS = -DPIC -fPIC # followed by boilerplate.mk --- vnc4-4.1.1+X4.3.0.orig/common/network/Makefile.in +++ vnc4-4.1.1+X4.3.0/common/network/Makefile.in @@ -14,4 +14,8 @@ $(AR) $(library) $(OBJS) $(RANLIB) $(library) +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC + +DIR_CXXFLAGS = -DPIC -fPIC # followed by boilerplate.mk --- vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.cxx +++ vnc4-4.1.1+X4.3.0/common/network/TcpSocket.cxx @@ -54,6 +54,29 @@ static rfb::LogWriter vlog("TcpSocket"); +/* Tunnelling support. */ +int network::findFreeTcpPort (void) +{ + int sock, port; + struct sockaddr_in addr; + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = INADDR_ANY; + + if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) + throw SocketException ("unable to create socket", errorNumber); + + for (port = TUNNEL_PORT_OFFSET + 99; port > TUNNEL_PORT_OFFSET; port--) { + addr.sin_port = htons ((unsigned short) port); + if (bind (sock, (struct sockaddr *)&addr, sizeof (addr)) == 0) { + close (sock); + return port; + } + } + throw SocketException ("no free port in range", 0); + return 0; +} + // -=- Socket initialisation static bool socketsInitialised = false; @@ -117,10 +140,14 @@ } // Attempt to connect to the remote host - if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) { - int e = errorNumber; - closesocket(sock); - throw SocketException("unable to connect to host", e); + for (;;) { + if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) { + int e = errorNumber; + if (e == EINTR) + continue; + closesocket(sock); + throw SocketException("unable to connect to host", e); + } else break; } // Disable Nagle's algorithm, to reduce latency --- vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.h +++ vnc4-4.1.1+X4.3.0/common/network/TcpSocket.h @@ -32,8 +32,14 @@ #include +/* Tunnelling support. */ +#define TUNNEL_PORT_OFFSET 5500 + namespace network { + /* Tunnelling support. */ + int findFreeTcpPort (void); + class TcpSocket : public Socket { public: TcpSocket(int sock, bool close=true); --- vnc4-4.1.1+X4.3.0.orig/common/rdr/Makefile.in +++ vnc4-4.1.1+X4.3.0/common/rdr/Makefile.in @@ -16,4 +16,8 @@ $(AR) $(library) $(OBJS) $(RANLIB) $(library) +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC + +DIR_CXXFLAGS = -DPIC -fPIC # followed by boilerplate.mk --- vnc4-4.1.1+X4.3.0.orig/common/rfb/Makefile.in +++ vnc4-4.1.1+X4.3.0/common/rfb/Makefile.in @@ -65,4 +65,9 @@ $(AR) $(library) $(OBJS) $(RANLIB) $(library) +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC + +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC # followed by boilerplate.mk --- vnc4-4.1.1+X4.3.0.orig/common/rfb/SConnection.cxx +++ vnc4-4.1.1+X4.3.0/common/rfb/SConnection.cxx @@ -181,6 +181,16 @@ vlog.info("Client requests security type %s(%d)", secTypeName(secType),secType); + std::list secTypes; + std::list::iterator i; + securityFactory->getSecTypes(&secTypes, reverseConnection); + for (i=secTypes.begin(); i!=secTypes.end(); i++) + if (*i == secType) + break; + + if (*i != secType) + throwConnFailedException("Unexpected security type"); + try { state_ = RFBSTATE_SECURITY; security = securityFactory->getSSecurity(secType, reverseConnection); --- vnc4-4.1.1+X4.3.0.orig/common/rfb/ServerCore.cxx +++ vnc4-4.1.1+X4.3.0/common/rfb/ServerCore.cxx @@ -29,7 +29,7 @@ ("IdleTimeout", "The number of seconds after which an idle VNC connection will be dropped " "(zero means no timeout)", - 3600, 0); + 0, 0); rfb::IntParameter rfb::Server::clientWaitTimeMillis ("ClientWaitTimeMillis", "The number of milliseconds to wait for a client which is no longer " --- vnc4-4.1.1+X4.3.0.orig/common/boilerplate.mk +++ vnc4-4.1.1+X4.3.0/common/boilerplate.mk @@ -15,7 +15,7 @@ CFLAGS = @CFLAGS@ $(DIR_CFLAGS) CCLD = $(CC) CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ +CXXFLAGS = @CXXFLAGS@ $(DIR_CXXFLAGS) CXXLD = $(CXX) CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ --- vnc4-4.1.1+X4.3.0.orig/common/Makefile.in +++ vnc4-4.1.1+X4.3.0/common/Makefile.in @@ -1,4 +1,6 @@ SUBDIRS = @ZLIB_DIR@ rdr network Xregion rfb +DIR_CFLAGS = -DPIC -fPIC +DIR_CXXFLAGS = -DPIC -fPIC # followed by boilerplate.mk --- vnc4-4.1.1+X4.3.0.orig/debian/compat +++ vnc4-4.1.1+X4.3.0/debian/compat @@ -0,0 +1 @@ +4 --- vnc4-4.1.1+X4.3.0.orig/debian/control +++ vnc4-4.1.1+X4.3.0/debian/control @@ -0,0 +1,60 @@ +Source: vnc4 +Section: x11 +Priority: optional +Maintainer: Ola Lundqvist +Build-Depends: debhelper (>= 4.0.0), perl, zlib1g-dev, xutils, libx11-dev, libxtst-dev, x-dev, libxext-dev +Standards-Version: 3.6.2 + +Package: vnc4server +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, vnc4-common | vnc-common, xbase-clients, x11-common | xserver-common +Provides: vnc-server, x0vnc-server, xserver +Recommends: xfonts-base +Suggests: vnc-java +Description: Virtual network computing server software + VNC stands for Virtual Network Computing. It is, in essence, a remote + display system which allows you to view a computing `desktop' environment + not only on the machine where it is running, but from anywhere on the + Internet and from a wide variety of machine architectures. + . + This package provides a vncserver to which X clients can connect and the + server generates a display that can be viewed with a vncviewer. + . + It contains an X server connector so clients can connect to your local X + desktop directly. + . + Note: This server does not need a display. You need a vncviewer to see + something. This viewer may also be on a computer running other operating + systems. + +Package: xvnc4viewer +Section: net +Architecture: any +Provides: vnc-viewer +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: vnc4-common | vnc-common +Description: Virtual network computing client software for X + VNC stands for Virtual Network Computing. It is, in essence, a remote + display system which allows you to view a computing `desktop' environment + not only on the machine where it is running, but from anywhere on the + Internet and from a wide variety of machine architectures. + . + It is implemented in a client/server model. This package provides a vncclient + for X, with this you can connect to a vncserver somewhere in the network + and display its content in a window. There are vncserver available for X + and for Win95/NT. + +Package: vnc4-common +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: xvnc4viewer|vncviewer, vnc4server +Provides: vnc-common +Conflicts: vnc-common (<< 3.3.7-6), vncserver (<< 3.3.6-1) +Description: Virtual network computing server software + VNC stands for Virtual Network Computing. It is, in essence, a remote + display system which allows you to view a computing `desktop' environment + not only on the machine where it is running, but from anywhere on the + Internet and from a wide variety of machine architectures. + . + It is implemented in a client/server model. This package provides common + utilities for the server and client packages. --- vnc4-4.1.1+X4.3.0.orig/debian/README.GENERATED +++ vnc4-4.1.1+X4.3.0/debian/README.GENERATED @@ -0,0 +1,9 @@ +This is how the .orig.tar.gz file is generated from two upstream sources. + +tar xfz vnc-4_1_1-unixsrc.tar.gz +mv vnc-4_1_1-unixsrc/ vnc4-4.1.1+X4.3.0 +cd vnc4-4.1.1+X4.3.0/unix/ +tar xfz ../../X430src-1.tgz +tar xfz ../../X430src-2.tgz +tar xfz ../../X430src-3.tgz +patch -Np0 < xc.patch --- vnc4-4.1.1+X4.3.0.orig/debian/vnc.conf +++ vnc4-4.1.1+X4.3.0/debian/vnc.conf @@ -0,0 +1,103 @@ +# /etc/vnc.conf written by Marcus Brinkmann. This file is in the Public Domain. +# +# This is the configuration file for the vncserver package. +# It is perl syntax, but only variable assignment is allowed. +# A semicolon will be added if missing. +# Every value has suitable defaults, so you probably don't need any file. +# +# This file will be sourced by `vncserver' and `vncpasswd'. +# After this file, $(HOME)/.vncrc will be sourced, so values can be +# overwritten on a per-user basis. If you want to reactivate the default +# value there, you have to specify an empty value. For example, $fontPath +# will set to the default value after +# +# $fontPath = "/foo"; +# $fontPath = ""; +# +# If you are missing something, please let me know. +# Marcus.Brinkmann@ruhr-uni-bochum.de + +# System configuration +# -------------------- +# +# This section contains entries that should be true for all users. + +# $vncClasses should be the path to the java classes of server. +# $vncClasses = "/usr/share/vncserver"; + +# $XFConfigPath can be set to the global XF86Config file. This will be +# parsed to gain default values for $fontPath and $colorPath. +# If you want to disable this feature, point it to an +# invalid file, "/foo" for example. +# $XFConfigPath = "/etc/X11/XF86Config-4"; + +# $fontPath should be a comma seperated list of fonts to be added to the font +# path. If not specified, and $XFConfigPath is valid, vncserver +# will read the $fontPath from there. If both are not set, the +# default will apply. +# Example: $fontPath = "tcp/localhost:7100"; # would make vnc to use xfs. +# Example: $fontPath = ""; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/misc/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/Type1/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/Speedo/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/75dpi/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/100dpi/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/freefont/,"; +# $fontPath .= "/usr/X11R6/lib/X11/fonts/sharefont/"; +# I don't know what the default is, though. + +# $colorPath should be the RGB file to be used by X. This can also be taken from +# XF86Config file if specified by $XFConfigPath +# $colorPath = "/usr/X11R6/lib/X11/rgb"; + +# User configuration +# ------------------ +# +# This section contains entries that may change from user to user. + +# $vncUserDir contains the filename for the log files directory of Xvnc +# (the server) and the viewers that are connected to it. +# $vncUserDir = "$ENV{HOME}/.vnc"; + +# $vncPasswdFile contains the filename of the password file for Xvnc. +# $vncPasswdFile = $vncUserDir . "/passwd"; + +# $vncStartup points to a script that will be started at the very beginning. +# $vncStartup = "/etc/X11/Xsession"; + +# $xauthorityFile should be the path to the authority file that should be used +# by your vnc X server. +# $xauthorityFile = "$ENV{HOME}/.Xauthority"; + +# $defaultDesktopName should be set to the default name of the desktop. +# This can be changed at the command line with -name. +# $defaultDesktopName = "X"; + +# $geometry sets framebuffer width & height. Default will be calculated if +# server is started from within a running X servers. Can be changed at +# the commandline (-geometry). A fixed default will be used if +# vncserver is not invoked in a running X session. +# Example: $geometry ="640x480"; + +# $depth sets the framebuffer color depth. Must be between 8 and 32. +# $pixelformat sets the default pixelformat. +# The default will be calculated if none of both is specified +# and when vncserver is called from within a running X servers. +# Can be changed at the command line with option -depth. +# A fixed default value will be used if vncserver is not +# invoked in a running X session. +# Example: $depth = "16"; +# $pixelformat = "rgb565"; + +# $getDefaultFrom sets the display from which you can query the default of +# the above three options, if you don't want to start vncserver +# from within a running X server. It will be added to the call +# of xdpyinfo. +# It is useful to get the default from the X server you will +# run xvncviewer in. +# Example: $getDefaultFrom = "-display localhost:0" + +# $rfbwait sets the maximum time in msec to wait for vnc client viewer. +# $rfbwait = "120000"; --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4-common.examples +++ vnc4-4.1.1+X4.3.0/debian/vnc4-common.examples @@ -0,0 +1 @@ +debian/vnc.conf --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4-common.install +++ vnc4-4.1.1+X4.3.0/debian/vnc4-common.install @@ -0,0 +1,2 @@ +debian/tmp/usr/bin/vnc4passwd usr/bin +debian/tmp/usr/share/man/man1/vnc4passwd.1 usr/share/man/man1 --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4-common.postinst +++ vnc4-4.1.1+X4.3.0/debian/vnc4-common.postinst @@ -0,0 +1,14 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ]; then + MAN=/usr/share/man/man1 + BIN=/usr/bin + update-alternatives --install \ + $BIN/vncpasswd vncpasswd $BIN/vnc4passwd 75 \ + --slave \ + $MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/vnc4passwd.1.gz +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4-common.prerm +++ vnc4-4.1.1+X4.3.0/debian/vnc4-common.prerm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ] ; then + BIN=/usr/bin + update-alternatives --remove \ + vncpasswd $BIN/vnc4passwd +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4server.postinst +++ vnc4-4.1.1+X4.3.0/debian/vnc4server.postinst @@ -0,0 +1,26 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ]; then + MAN=/usr/share/man/man1 + BIN=/usr/bin + update-alternatives --install \ + $BIN/vncserver vncserver $BIN/vnc4server 65 \ + --slave \ + $MAN/vncserver.1.gz vncserver.1.gz $MAN/vnc4server.1.gz + update-alternatives --install \ + $BIN/Xvnc Xvnc $BIN/Xvnc4 75 \ + --slave \ + $MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xvnc4.1.gz + update-alternatives --install \ + $BIN/x0vncserver x0vncserver $BIN/x0vnc4server 75 \ + --slave \ + $MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0vnc4server.1.gz + update-alternatives --install \ + $BIN/vncconfig vncconfig $BIN/vnc4config 65 \ + --slave \ + $MAN/vncconfig.1.gz vncconfig.1.gz $MAN/vnc4config.1.gz +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4server.prerm +++ vnc4-4.1.1+X4.3.0/debian/vnc4server.prerm @@ -0,0 +1,17 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ] ; then + BIN=/usr/bin + update-alternatives --remove \ + vncserver $BIN/vnc4server + update-alternatives --remove \ + Xvnc $BIN/Xvnc4 + update-alternatives --remove \ + x0vncserver $BIN/x0vnc4server + update-alternatives --remove \ + vnc4config $BIN/vnc4config +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/xvnc4viewer.install +++ vnc4-4.1.1+X4.3.0/debian/xvnc4viewer.install @@ -0,0 +1,3 @@ +debian/tmp/usr/bin/xvnc4viewer usr/bin +debian/tmp/usr/share/man/man1/xvnc4viewer.1 usr/share/man/man1 + --- vnc4-4.1.1+X4.3.0.orig/debian/xvnc4viewer.menu +++ vnc4-4.1.1+X4.3.0/debian/xvnc4viewer.menu @@ -0,0 +1,5 @@ +?package(xvnc4viewer):needs="X11" \ + section="Apps/Net" \ + title="VNC Viewer" \ + command="xvnc4viewer" \ + hints="VNC viewer" --- vnc4-4.1.1+X4.3.0.orig/debian/xvnc4viewer.postinst +++ vnc4-4.1.1+X4.3.0/debian/xvnc4viewer.postinst @@ -0,0 +1,18 @@ +#!/bin/sh -e + +if [ "$1" = "configure" ]; then + MAN=/usr/share/man/man1 + BIN=/usr/bin + update-alternatives --install \ + $BIN/vncviewer vncviewer $BIN/xvnc4viewer 75 \ + --slave \ + $MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xvnc4viewer.1.gz \ + --slave \ + $MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xvnc4viewer.1.gz \ + --slave \ + $BIN/xvncviewer xvncviewer $BIN/xvnc4viewer +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/xvnc4viewer.prerm +++ vnc4-4.1.1+X4.3.0/debian/xvnc4viewer.prerm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +if [ "$1" = "remove" ] ; then + BIN=/usr/bin + update-alternatives --remove \ + vncviewer $BIN/xvnc4viewer +fi + +#DEBHELPER# + +exit 0 --- vnc4-4.1.1+X4.3.0.orig/debian/patches/vncserver +++ vnc4-4.1.1+X4.3.0/debian/patches/vncserver @@ -0,0 +1,570 @@ +#!/usr/bin/perl +# +# Copyright (C) 2002-2003 RealVNC Ltd. +# Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. +# +# This 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. +# +# This software 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 this software; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# + +# +# vncserver - wrapper script to start an X VNC server. +# + +# +# First make sure we're operating in a sane environment. +# + +&SanityCheck(); + +# +# Global variables. You may want to configure some of these for your site. +# + +$geometry = "1024x768"; +$depth = 16; +$vncJavaFiles = (((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") || + ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes")); +$vncUserDir = "$ENV{HOME}/.vnc"; +$xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority"; + +$defaultXStartup + = ("#!/bin/sh\n\n". + "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n". + "xsetroot -solid grey\n". + "vncconfig -iconic &\n". + "x-terminal-emulator -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n". + "x-window-manager &\n"); + +chop($host = `uname -n`); + + +# Check command line options + +&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1, + "-help",0,"-h",0,"--help",0); + +&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'}); + +&Kill() if ($opt{'-kill'}); + +# Uncomment this line if you want default geometry, depth and pixelformat +# to match the current X display: +# &GetXDisplayDefaults(); + +if ($opt{'-geometry'}) { + $geometry = $opt{'-geometry'}; +} +if ($opt{'-depth'}) { + $depth = $opt{'-depth'}; + $pixelformat = ""; +} +if ($opt{'-pixelformat'}) { + $pixelformat = $opt{'-pixelformat'}; +} + +&CheckGeometryAndDepth(); + + +# Create the user's vnc directory if necessary. + +if (!(-e $vncUserDir)) { + if (!mkdir($vncUserDir,0755)) { + die "$prog: Could not create $vncUserDir.\n"; + } +} + +# Make sure the user has a password. + +($z,$z,$mode) = stat("$vncUserDir/passwd"); +if (!(-e "$vncUserDir/passwd") || ($mode & 077)) { + warn "\nYou will require a password to access your desktops.\n\n"; + system("vncpasswd -q $vncUserDir/passwd"); + if (($? >> 8) != 0) { + exit 1; + } +} + +# Find display number. + +if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) { + $displayNumber = $1; + shift(@ARGV); + if (!&CheckDisplayNumber($displayNumber)) { + die "A VNC server is already running as :$displayNumber\n"; + } +} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/)) { + &Usage(); +} else { + $displayNumber = &GetDisplayNumber(); +} + +$vncPort = 5900 + $displayNumber; + +$desktopLog = "$vncUserDir/$host:$displayNumber.log"; +unlink($desktopLog); + +# Make an X server cookie - use as the seed the sum of the current time, our +# PID and part of the encrypted form of the password. Ideally we'd use +# /dev/urandom, but that's only available on Linux. + +srand(time+$$+unpack("L",`cat $vncUserDir/passwd`)); +$cookie = ""; +for (1..16) { + $cookie .= sprintf("%02x", int(rand(256)) % 256); +} + +system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie"); +system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); + +if ($opt{'-name'}) { + $desktopName = $opt{'-name'}; +} else { + $desktopName = "$host:$displayNumber ($ENV{USER})"; +} + +# Now start the X VNC Server + +$cmd = "Xvnc :$displayNumber"; +$cmd .= " -desktop " . "edString($desktopName); +$cmd .= " -httpd $vncJavaFiles" if ($vncJavaFiles); +$cmd .= " -auth $xauthorityFile"; +$cmd .= " -geometry $geometry" if ($geometry); +$cmd .= " -depth $depth" if ($depth); +$cmd .= " -pixelformat $pixelformat" if ($pixelformat); +$cmd .= " -rfbwait 30000"; +$cmd .= " -rfbauth $vncUserDir/passwd"; +$cmd .= " -rfbport $vncPort"; +$cmd .= " -pn"; + +# Add font path and color database stuff here, e.g.: +# +# $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/"; +# $cmd .= " -co /usr/lib/X11/rgb"; +# + +foreach $arg (@ARGV) { + $cmd .= " " . "edString($arg); +} +$cmd .= " >> " . "edString($desktopLog) . " 2>&1"; + +# Run $cmd and record the process ID. + +$pidFile = "$vncUserDir/$host:$displayNumber.pid"; +system("$cmd & echo \$! >$pidFile"); + +# Give Xvnc a chance to start up + +sleep(3); + +warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n"; + +# Create the user's xstartup script if necessary. + +if (!(-e "$vncUserDir/xstartup")) { + warn "Creating default startup script $vncUserDir/xstartup\n"; + open(XSTARTUP, ">$vncUserDir/xstartup"); + print XSTARTUP $defaultXStartup; + close(XSTARTUP); + chmod 0755, "$vncUserDir/xstartup"; +} + +# Run the X startup script. + +warn "Starting applications specified in $vncUserDir/xstartup\n"; +warn "Log file is $desktopLog\n\n"; + +# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use +# TCP (DISPLAY=host:n) + +if (-e "/tmp/.X11-unix/X$displayNumber" || + -e "/usr/spool/sockets/X11/$displayNumber") +{ + $ENV{DISPLAY}= ":$displayNumber"; +} else { + $ENV{DISPLAY}= "$host:$displayNumber"; +} +$ENV{VNCDESKTOP}= $desktopName; + +system("$vncUserDir/xstartup >> " . "edString($desktopLog) . " 2>&1 &"); + +exit; + + +############################################################################### +# +# CheckGeometryAndDepth simply makes sure that the geometry and depth values +# are sensible. +# + +sub CheckGeometryAndDepth +{ + if ($geometry =~ /^(\d+)x(\d+)$/) { + $width = $1; $height = $2; + + if (($width<1) || ($height<1)) { + die "$prog: geometry $geometry is invalid\n"; + } + + while (($width % 4)!=0) { + $width = $width + 1; + } + + while (($height % 2)!=0) { + $height = $height + 1; + } + + $geometry = "${width}x$height"; + } else { + die "$prog: geometry $geometry is invalid\n"; + } + + if (($depth < 8) || ($depth > 32)) { + die "Depth must be between 8 and 32\n"; + } +} + + +# +# GetDisplayNumber gets the lowest available display number. A display number +# n is taken if something is listening on the VNC server port (5900+n) or the +# X server port (6000+n). +# + +sub GetDisplayNumber +{ + foreach $n (1..99) { + if (&CheckDisplayNumber($n)) { + return $n+0; # Bruce Mah's workaround for bug in perl 5.005_02 + } + } + + die "$prog: no free display number on $host.\n"; +} + + +# +# CheckDisplayNumber checks if the given display number is available. A +# display number n is taken if something is listening on the VNC server port +# (5900+n) or the X server port (6000+n). +# + +sub CheckDisplayNumber +{ + local ($n) = @_; + + socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n"; + eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))'; + if (!bind(S, pack('S n x12', $AF_INET, 6000 + $n))) { + close(S); + return 0; + } + close(S); + + socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n"; + eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))'; + if (!bind(S, pack('S n x12', $AF_INET, 5900 + $n))) { + close(S); + return 0; + } + close(S); + + if (-e "/tmp/.X$n-lock") { + warn "\nWarning: $host:$n is taken because of /tmp/.X$n-lock\n"; + warn "Remove this file if there is no X server $host:$n\n"; + return 0; + } + + if (-e "/tmp/.X11-unix/X$n") { + warn "\nWarning: $host:$n is taken because of /tmp/.X11-unix/X$n\n"; + warn "Remove this file if there is no X server $host:$n\n"; + return 0; + } + + if (-e "/usr/spool/sockets/X11/$n") { + warn("\nWarning: $host:$n is taken because of ". + "/usr/spool/sockets/X11/$n\n"); + warn "Remove this file if there is no X server $host:$n\n"; + return 0; + } + + return 1; +} + + +# +# GetXDisplayDefaults uses xdpyinfo to find out the geometry, depth and pixel +# format of the current X display being used. If successful, it sets the +# options as appropriate so that the X VNC server will use the same settings +# (minus an allowance for window manager decorations on the geometry). Using +# the same depth and pixel format means that the VNC server won't have to +# translate pixels when the desktop is being viewed on this X display (for +# TrueColor displays anyway). +# + +sub GetXDisplayDefaults +{ + local (@lines, @matchlines, $width, $height, $defaultVisualId, $i, + $red, $green, $blue); + + $wmDecorationWidth = 4; # a guess at typical size for window manager + $wmDecorationHeight = 24; # decoration size + + return if (!defined($ENV{DISPLAY})); + + @lines = `xdpyinfo 2>/dev/null`; + + return if ($? != 0); + + @matchlines = grep(/dimensions/, @lines); + if (@matchlines) { + ($width, $height) = ($matchlines[0] =~ /(\d+)x(\d+) pixels/); + + $width -= $wmDecorationWidth; + $height -= $wmDecorationHeight; + + $geometry = "${width}x$height"; + } + + @matchlines = grep(/default visual id/, @lines); + if (@matchlines) { + ($defaultVisualId) = ($matchlines[0] =~ /id:\s+(\S+)/); + + for ($i = 0; $i < @lines; $i++) { + if ($lines[$i] =~ /^\s*visual id:\s+$defaultVisualId$/) { + if (($lines[$i+1] !~ /TrueColor/) || + ($lines[$i+2] !~ /depth/) || + ($lines[$i+4] !~ /red, green, blue masks/)) + { + return; + } + last; + } + } + + return if ($i >= @lines); + + ($depth) = ($lines[$i+2] =~ /depth:\s+(\d+)/); + ($red,$green,$blue) + = ($lines[$i+4] + =~ /masks:\s+0x([0-9a-f]+), 0x([0-9a-f]+), 0x([0-9a-f]+)/); + + $red = hex($red); + $green = hex($green); + $blue = hex($blue); + + if ($red > $blue) { + $red = int(log($red) / log(2)) - int(log($green) / log(2)); + $green = int(log($green) / log(2)) - int(log($blue) / log(2)); + $blue = int(log($blue) / log(2)) + 1; + $pixelformat = "rgb$red$green$blue"; + } else { + $blue = int(log($blue) / log(2)) - int(log($green) / log(2)); + $green = int(log($green) / log(2)) - int(log($red) / log(2)); + $red = int(log($red) / log(2)) + 1; + $pixelformat = "bgr$blue$green$red"; + } + } +} + + +# +# quotedString returns a string which yields the original string when parsed +# by a shell. +# + +sub quotedString +{ + local ($in) = @_; + + $in =~ s/\'/\'\"\'\"\'/g; + + return "'$in'"; +} + + +# +# removeSlashes turns slashes into underscores for use as a file name. +# + +sub removeSlashes +{ + local ($in) = @_; + + $in =~ s|/|_|g; + + return "$in"; +} + + +# +# Usage +# + +sub Usage +{ + die("\nusage: $prog [:] [-name ] [-depth ]\n". + " [-geometry x]\n". + " [-pixelformat rgbNNN|bgrNNN]\n". + " ...\n\n". + " $prog -kill \n\n"); +} + + +# +# Kill +# + +sub Kill +{ + $opt{'-kill'} =~ s/(:\d+)\.\d+$/$1/; # e.g. turn :1.0 into :1 + + if ($opt{'-kill'} =~ /^:\d+$/) { + $pidFile = "$vncUserDir/$host$opt{'-kill'}.pid"; + } else { + if ($opt{'-kill'} !~ /^$host:/) { + die "\nCan't tell if $opt{'-kill'} is on $host\n". + "Use -kill : instead\n\n"; + } + $pidFile = "$vncUserDir/$opt{'-kill'}.pid"; + } + + if (! -r $pidFile) { + die "\nCan't find file $pidFile\n". + "You'll have to kill the Xvnc process manually\n\n"; + } + + $SIG{'HUP'} = 'IGNORE'; + chop($pid = `cat $pidFile`); + warn "Killing Xvnc process ID $pid\n"; + system("kill $pid"); + unlink $pidFile; + exit; +} + + +# +# ParseOptions takes a list of possible options and a boolean indicating +# whether the option has a value following, and sets up an associative array +# %opt of the values of the options given on the command line. It removes all +# the arguments it uses from @ARGV and returns them in @optArgs. +# + +sub ParseOptions +{ + local (@optval) = @_; + local ($opt, @opts, %valFollows, @newargs); + + while (@optval) { + $opt = shift(@optval); + push(@opts,$opt); + $valFollows{$opt} = shift(@optval); + } + + @optArgs = (); + %opt = (); + + arg: while (defined($arg = shift(@ARGV))) { + foreach $opt (@opts) { + if ($arg eq $opt) { + push(@optArgs, $arg); + if ($valFollows{$opt}) { + if (@ARGV == 0) { + &Usage(); + } + $opt{$opt} = shift(@ARGV); + push(@optArgs, $opt{$opt}); + } else { + $opt{$opt} = 1; + } + next arg; + } + } + push(@newargs,$arg); + } + + @ARGV = @newargs; +} + + +# +# Routine to make sure we're operating in a sane environment. +# + +sub SanityCheck +{ + local ($cmd); + + # + # Get the program name + # + + ($prog) = ($0 =~ m|([^/]+)$|); + + # + # Check we have all the commands we'll need on the path. + # + + cmd: + foreach $cmd ("uname","xauth","Xvnc","vncpasswd") { + for (split(/:/,$ENV{PATH})) { + if (-x "$_/$cmd") { + next cmd; + } + } + die "$prog: couldn't find \"$cmd\" on your PATH.\n"; + } + + # + # Check the HOME environment variable is set + # + + if (!defined($ENV{HOME})) { + die "$prog: The HOME environment variable is not set.\n"; + } + chdir($ENV{HOME}); + + # + # Find socket constants. 'use Socket' is a perl5-ism, so we wrap it in an + # eval, and if it fails we try 'require "sys/socket.ph"'. If this fails, + # we just guess at the values. If you find perl moaning here, just + # hard-code the values of AF_INET and SOCK_STREAM. You can find these out + # for your platform by looking in /usr/include/sys/socket.h and related + # files. + # + + chop($os = `uname`); + chop($osrev = `uname -r`); + + eval 'use Socket'; + if ($@) { + eval 'require "sys/socket.ph"'; + if ($@) { + if (($os eq "SunOS") && ($osrev !~ /^4/)) { + $AF_INET = 2; + $SOCK_STREAM = 2; + } else { + $AF_INET = 2; + $SOCK_STREAM = 1; + } + } else { + $AF_INET = &AF_INET; + $SOCK_STREAM = &SOCK_STREAM; + } + } else { + $AF_INET = &AF_INET; + $SOCK_STREAM = &SOCK_STREAM; + } +} --- vnc4-4.1.1+X4.3.0.orig/debian/patches/vnc-4.0-x0vncserver-localhost.patch +++ vnc4-4.1.1+X4.3.0/debian/patches/vnc-4.0-x0vncserver-localhost.patch @@ -0,0 +1,34 @@ +From: Hein Roehrig + +Here is a patch to have the -localhost option in the x0vncserver +command as well... important when trying to secure the VNC connection +via ssh. + +Thanks, +Hein + +--- vnc4-4.0/x0vncserver/x0vncserver.cxx.~1~ 2004-10-23 10:59:42.000000000 -0600 ++++ vnc4-4.0/x0vncserver/x0vncserver.cxx 2004-10-23 11:48:41.000000000 -0600 +@@ -47,6 +47,9 @@ + StringParameter displayname("display", "The X display", ""); + IntParameter rfbport("rfbport", "TCP port to listen for RFB protocol",5900); + VncAuthPasswdFileParameter vncAuthPasswdFile; ++BoolParameter localhostOnly("localhost", ++ "Only allow connections from localhost", ++ false); + + static void CleanupSignalHandler(int sig) + { +@@ -230,7 +233,7 @@ + desktop.setVNCServer(&server); + + TcpSocket::initTcpSockets(); +- TcpListener listener((int)rfbport); ++ TcpListener listener((int)rfbport, localhostOnly); + vlog.info("Listening on port %d", (int)rfbport); + + while (true) { + + + + --- vnc4-4.1.1+X4.3.0.orig/debian/patches/vncsofpicfix.patch +++ vnc4-4.1.1+X4.3.0/debian/patches/vncsofpicfix.patch @@ -0,0 +1,11 @@ +--- buildtemp/xc/programs/Xserver/vnc/module/Imakefile~ 2004-08-19 12:42:56.000000000 +0200 ++++ buildtemp/xc/programs/Xserver/vnc/module/Imakefile 2004-08-19 22:51:01.000000000 +0200 +@@ -13,7 +13,7 @@ + INCLUDES = -I.. -I../../include -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + -I$(FONTINCSRC) -I$(XF86COMSRC) \ + $(VNCINCLUDE) +- DEFINES = $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER ++ DEFINES = -fPIC $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER + + LinkSourceFile(vncExtInit.cc,..) + LinkSourceFile(vncHooks.cc,..) --- vnc4-4.1.1+X4.3.0.orig/debian/patches/xccompilefix.patch +++ vnc4-4.1.1+X4.3.0/debian/patches/xccompilefix.patch @@ -0,0 +1,30 @@ +--- buildtemp/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c~ 2001-11-08 05:00:14.000000000 +0100 ++++ buildtemp/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c 2004-08-09 09:02:19.000000000 +0200 +@@ -80,19 +80,20 @@ + struct kbd_repeat kbdrep_s; + + /* don't change, just test */ +- kbdrep_s.rate = -1; ++ /*kbdrep_s.rate = -1;*/ + kbdrep_s.delay = -1; + if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + return 0; + } + + /* do the change */ +- if (rate == 0) /* switch repeat off */ +- kbdrep_s.rate = 0; +- else +- kbdrep_s.rate = 10000 / rate; /* convert cps to msec */ +- if (kbdrep_s.rate < 1) +- kbdrep_s.rate = 1; ++ /*if (rate == 0)*/ /* switch repeat off */ ++ /* kbdrep_s.rate = 0;*/ ++ /*else*/ ++ /* kbdrep_s.rate = 10000 / rate;*/ /* convert cps to msec */ ++ /* if (kbdrep_s.rate < 1)*/ ++ /* kbdrep_s.rate = 1; */ ++ + kbdrep_s.delay = delay; + if (kbdrep_s.delay < 1) + kbdrep_s.delay = 1; --- vnc4-4.1.1+X4.3.0.orig/debian/patches/nolonger/vnc-4.0b5-vncviewer-tls.diff +++ vnc4-4.1.1+X4.3.0/debian/patches/nolonger/vnc-4.0b5-vncviewer-tls.diff @@ -0,0 +1,836 @@ +--- vnc-4.0b5-unixsrc/x0vncserver/Makefile.in.tls 2004-06-11 16:36:08.113307745 +0100 ++++ vnc-4.0b5-unixsrc/x0vncserver/Makefile.in 2004-06-11 16:36:46.864918325 +0100 +@@ -7,9 +7,9 @@ + + DEP_LIBS = ../rfb/librfb.a ../network/libnetwork.a ../rdr/librdr.a + +-EXTRA_LIBS = @ZLIB_LIB@ @X_PRE_LIBS@ @X_LIBS@ -lXtst -lXext -lX11 @X_EXTRA_LIBS@ ++EXTRA_LIBS = @ZLIB_LIB@ @X_PRE_LIBS@ @X_LIBS@ -lXtst -lXext -lX11 @X_EXTRA_LIBS@ @LIBGNUTLS_LIBS@ + +-DIR_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS ++DIR_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@ @LIBGNUTLS_CFLAGS@ # X_CFLAGS are really CPPFLAGS + + all:: $(program) + +--- vnc-4.0b5-unixsrc/configure.in.tls 2004-06-11 16:36:08.147303017 +0100 ++++ vnc-4.0b5-unixsrc/configure.in 2004-06-11 16:36:46.865918186 +0100 +@@ -63,6 +63,14 @@ + AC_SUBST(ZLIB_INCLUDE) + AC_SUBST(ZLIB_LIB) + ++AC_ARG_ENABLE(gnutls, [ --enable-gnutls build with gnutls support]) ++if test "x$enable_gnutls" = "xyes"; then ++ AC_LANG_PUSH(C) ++ AM_PATH_LIBGNUTLS(1.0.0, [AC_DEFINE(HAVE_GNUTLS)], AC_MSG_ERROR([Unable to find GNUTLS])) ++ LIBGNUTLS_CFLAGS="-DHAVE_GNUTLS $LIBGNUTLS_CFLAGS" ++ AC_LANG_PUSH(C) ++fi ++ + AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=) + AC_SUBST(VSNPRINTF_DEFINE) + +--- vnc-4.0b5-unixsrc/rfb/CSecurity.h.tls 2004-06-11 16:36:08.167300236 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurity.h 2004-06-11 16:36:46.867917908 +0100 +@@ -38,8 +38,14 @@ + class CConnection; + class CSecurity { + public: ++ enum statusEnum { ++ RFB_SECURITY_ERROR, ++ RFB_SECURITY_COMPLETED, ++ RFB_SECURITY_DEFER, ++ RFB_SECURITY_AUTH_TYPES ++ }; + virtual ~CSecurity() {} +- virtual bool processMsg(CConnection* cc, bool* done)=0; ++ virtual statusEnum processMsg(CConnection* cc)=0; + virtual void destroy() { delete this; } + virtual int getType() const = 0; + virtual const char* description() const = 0; +--- vnc-4.0b5-unixsrc/rfb/CSecurityTLS.cxx.tls 2004-06-11 16:36:36.557351881 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurityTLS.cxx 2004-06-11 16:36:46.868917769 +0100 +@@ -0,0 +1,122 @@ ++/* ++ * Copyright (C) 2004 Red Hat Inc. ++ * ++ * This 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. ++ * ++ * This software 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 this software; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++ * USA. ++ */ ++ ++#ifdef HAVE_GNUTLS ++ ++#include ++#include ++#include ++#include ++#include ++ ++#undef TLS_DEBUG ++ ++using namespace rfb; ++ ++static LogWriter vlog("TLS"); ++ ++#ifdef TLS_DEBUG ++static void debug_log(int level, const char* str) ++{ ++ vlog.debug(str); ++} ++#endif ++ ++void CSecurityTLS::initGlobal() ++{ ++ static bool globalInitDone = false; ++ ++ if (!globalInitDone) { ++ gnutls_global_init(); ++ ++#ifdef TLS_DEBUG ++ gnutls_global_set_log_level(10); ++ gnutls_global_set_log_function(debug_log); ++#endif ++ ++ globalInitDone = true; ++ } ++} ++ ++CSecurityTLS::CSecurityTLS() : session(0), anon_cred(0) ++{ ++} ++ ++CSecurityTLS::~CSecurityTLS() ++{ ++ if (session) { ++ gnutls_bye(session, GNUTLS_SHUT_RDWR); ++ gnutls_anon_free_client_credentials (anon_cred); ++ gnutls_deinit (session); ++ } ++ ++ /* FIXME: should be doing gnutls_global_deinit() at some point */ ++} ++ ++CSecurityTLS::statusEnum CSecurityTLS::processMsg(CConnection* cc) ++{ ++ rdr::FdInStream* is; ++ rdr::FdOutStream* os; ++ ++ if ((is = dynamic_cast(cc->getInStream())) == 0) { ++ vlog.error("Cannot use TLS security type with anything other than FdInStream"); ++ return RFB_SECURITY_ERROR; ++ } ++ ++ if ((os = dynamic_cast(cc->getOutStream())) == 0) { ++ vlog.error("Cannot use TLS security type with anything other than FdOutStream"); ++ return RFB_SECURITY_ERROR; ++ } ++ ++ initGlobal(); ++ ++ gnutls_init(&session, GNUTLS_CLIENT); ++ gnutls_set_default_priority(session); ++ ++ int kx_priority[] = { GNUTLS_KX_ANON_DH, 0 }; ++ gnutls_kx_set_priority(session, kx_priority); ++ ++ gnutls_anon_allocate_client_credentials(&anon_cred); ++ gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred); ++ ++ gnutls_transport_set_ptr2(session, ++ (gnutls_transport_ptr)is->getFd(), ++ (gnutls_transport_ptr)os->getFd()); ++ ++ int err; ++ do { ++ err = gnutls_handshake(session); ++ } while (err != GNUTLS_E_SUCCESS && !gnutls_error_is_fatal(err)); ++ ++ if (err != GNUTLS_E_SUCCESS) { ++ vlog.error("TLS Handshake failed: %s\n", gnutls_strerror (err)); ++ gnutls_bye(session, GNUTLS_SHUT_RDWR); ++ gnutls_anon_free_client_credentials(anon_cred); ++ gnutls_deinit(session); ++ session = 0; ++ return RFB_SECURITY_ERROR; ++ } ++ ++ is->useTLS(session); ++ os->useTLS(session); ++ ++ return RFB_SECURITY_AUTH_TYPES; ++} ++ ++#endif /* HAVE_GNUTLS */ +--- vnc-4.0b5-unixsrc/rfb/CConnection.h.tls 2004-06-11 16:36:08.248288973 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CConnection.h 2004-06-11 16:36:46.869917630 +0100 +@@ -59,6 +59,11 @@ + // first one is most preferred. + void addSecType(rdr::U8 secType); + ++ // addAuthType() should be called once for each authentication type which ++ // the client supports. The order in which they're added is such that the ++ // first one is most preferred. ++ void addAuthType(rdr::U8 authType); ++ + // setClientSecTypeOrder() determines whether the client should obey + // the server's security type preference, by picking the first server security + // type that the client supports, or whether it should pick the first type +@@ -150,6 +155,7 @@ + private: + void processVersionMsg(); + void processSecurityTypesMsg(); ++ void processAuthTypesMsg(); + void processSecurityMsg(); + void processSecurityResultMsg(); + void processInitMsg(); +@@ -164,9 +170,11 @@ + bool deleteStreamsWhenDone; + bool shared; + CSecurity* security; +- enum { maxSecTypes = 8 }; ++ enum { maxSecTypes = 8, maxAuthTypes = 8 }; + int nSecTypes; + rdr::U8 secTypes[maxSecTypes]; ++ int nAuthTypes; ++ rdr::U8 authTypes[maxAuthTypes]; + bool clientSecTypeOrder; + stateEnum state_; + +--- vnc-4.0b5-unixsrc/rfb/Makefile.in.tls 2004-06-11 16:36:08.250288695 +0100 ++++ vnc-4.0b5-unixsrc/rfb/Makefile.in 2004-06-11 16:36:46.869917630 +0100 +@@ -8,6 +8,7 @@ + CMsgWriter.cxx \ + CMsgWriterV3.cxx \ + CSecurityVncAuth.cxx \ ++ CSecurityTLS.cxx \ + ComparingUpdateTracker.cxx \ + Configuration.cxx \ + ConnParams.cxx \ +@@ -52,7 +53,7 @@ + + OBJS = d3des.o $(CXXSRCS:.cxx=.o) + +-DIR_CPPFLAGS = -I$(top_srcdir) @VSNPRINTF_DEFINE@ ++DIR_CPPFLAGS = -I$(top_srcdir) @VSNPRINTF_DEFINE@ @LIBGNUTLS_CFLAGS@ + + library = librfb.a + +@@ -63,4 +64,6 @@ + $(AR) $(library) $(OBJS) + $(RANLIB) $(library) + ++DIR_CFLAGS = -DPIC -fPIC ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +--- vnc-4.0b5-unixsrc/rfb/CSecurityVncAuth.cxx.tls 2004-06-11 16:36:08.252288416 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurityVncAuth.cxx 2004-06-11 16:36:46.869917630 +0100 +@@ -41,9 +41,8 @@ + { + } + +-bool CSecurityVncAuth::processMsg(CConnection* cc, bool* done) ++CSecurity::statusEnum CSecurityVncAuth::processMsg(CConnection* cc) + { +- *done = false; + rdr::InStream* is = cc->getInStream(); + rdr::OutStream* os = cc->getOutStream(); + +@@ -52,12 +51,11 @@ + CharArray passwd; + if (!upg->getUserPasswd(0, &passwd.buf)) { + vlog.error("Getting password failed"); +- return false; ++ return RFB_SECURITY_ERROR; + } + vncAuthEncryptChallenge(challenge, passwd.buf); + memset(passwd.buf, 0, strlen(passwd.buf)); + os->writeBytes(challenge, vncAuthChallengeSize); + os->flush(); +- *done = true; +- return true; ++ return RFB_SECURITY_COMPLETED; + } +--- vnc-4.0b5-unixsrc/rfb/secTypes.cxx.tls 2004-06-11 16:36:08.254288138 +0100 ++++ vnc-4.0b5-unixsrc/rfb/secTypes.cxx 2004-06-11 16:36:46.870917491 +0100 +@@ -28,6 +28,7 @@ + if (strcasecmp(name, "VncAuth") == 0) return secTypeVncAuth; + if (strcasecmp(name, "RA2") == 0) return secTypeRA2; + if (strcasecmp(name, "RA2ne") == 0) return secTypeRA2ne; ++ if (strcasecmp(name, "TLS") == 0) return secTypeTLS; + return secTypeInvalid; + } + +@@ -38,6 +39,7 @@ + case secTypeVncAuth: return "VncAuth"; + case secTypeRA2: return "RA2"; + case secTypeRA2ne: return "RA2ne"; ++ case secTypeTLS: return "TLS"; + default: return "[unknown secType]"; + } + } +@@ -46,6 +48,7 @@ + { + switch (num) { + case secTypeRA2: return true; ++ case secTypeTLS: return true; + default: return false; + } + } +--- vnc-4.0b5-unixsrc/rfb/CSecurityTLS.h.tls 2004-06-11 16:36:31.135105991 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurityTLS.h 2004-06-11 16:36:46.870917491 +0100 +@@ -0,0 +1,48 @@ ++/* ++ * Copyright (C) 2004 Red Hat Inc. ++ * ++ * This 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. ++ * ++ * This software 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 this software; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++ * USA. ++ */ ++ ++#ifndef __C_SECURITY_TLS_H__ ++#define __C_SECURITY_TLS_H__ ++ ++#ifdef HAVE_GNUTLS ++ ++#include ++#include ++#include ++ ++namespace rfb { ++ class CSecurityTLS : public CSecurity { ++ public: ++ CSecurityTLS(); ++ virtual ~CSecurityTLS(); ++ virtual statusEnum processMsg(CConnection* cc); ++ virtual int getType() const { return secTypeTLS; }; ++ virtual const char* description() const { return "TLS Encryption"; } ++ ++ private: ++ static void initGlobal(); ++ ++ gnutls_session session; ++ gnutls_anon_server_credentials anon_cred; ++ }; ++} ++ ++#endif /* HAVE_GNUTLS */ ++ ++#endif /* __C_SECURITY_TLS_H__ */ +--- vnc-4.0b5-unixsrc/rfb/CSecurityNone.h.tls 2004-06-11 16:36:08.312280073 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurityNone.h 2004-06-11 16:36:46.871917352 +0100 +@@ -28,8 +28,8 @@ + + class CSecurityNone : public CSecurity { + public: +- virtual bool processMsg(CConnection* cc, bool* done) { +- *done = true; return true; ++ virtual statusEnum processMsg(CConnection* cc) { ++ return RFB_SECURITY_COMPLETED; + } + virtual int getType() const {return secTypeNone;} + virtual const char* description() const {return "No Encryption";} +--- vnc-4.0b5-unixsrc/rfb/CConnection.cxx.tls 2004-06-11 16:36:08.315279656 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CConnection.cxx 2004-06-11 16:36:46.980902194 +0100 +@@ -33,7 +33,8 @@ + + CConnection::CConnection() + : is(0), os(0), reader_(0), writer_(0), +- shared(false), security(0), nSecTypes(0), clientSecTypeOrder(false), ++ shared(false), security(0), ++ nSecTypes(0), nAuthTypes(0), clientSecTypeOrder(false), + state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false) + { + } +@@ -64,11 +65,19 @@ + + void CConnection::addSecType(rdr::U8 secType) + { ++ vlog.debug("adding %d", secType); + if (nSecTypes == maxSecTypes) + throw Exception("too many security types"); + secTypes[nSecTypes++] = secType; + } + ++void CConnection::addAuthType(rdr::U8 authType) ++{ ++ if (nAuthTypes == maxAuthTypes) ++ throw Exception("too many authentication types"); ++ authTypes[nAuthTypes++] = authType; ++} ++ + void CConnection::setClientSecTypeOrder(bool clientOrder) { + clientSecTypeOrder = clientOrder; + } +@@ -204,15 +213,72 @@ + processSecurityMsg(); + } + ++void CConnection::processAuthTypesMsg() ++{ ++ vlog.debug("processing authentication types message"); ++ ++ int authType = secTypeInvalid; ++ ++ int nServerAuthTypes = is->readU8(); ++ if (nServerAuthTypes == 0) ++ throwConnFailedException(); ++ ++ int authTypePos = nAuthTypes; ++ for (int i = 0; i < nServerAuthTypes; i++) { ++ rdr::U8 serverAuthType = is->readU8(); ++ vlog.debug("Server offers security type %s(%d)", ++ secTypeName(serverAuthType),serverAuthType); ++ ++ // If we haven't already chosen a authType, try this one ++ // If we are using the client's preference for types, ++ // we keep trying types, to find the one that matches and ++ // which appears first in the client's list of supported types. ++ if (authType == secTypeInvalid || clientSecTypeOrder) { ++ for (int j = 0; j < nAuthTypes; j++) { ++ if (authTypes[j] == serverAuthType && j < authTypePos) { ++ authType = authTypes[j]; ++ authTypePos = j; ++ break; ++ } ++ } ++ // NB: Continue reading the remaining server authTypes, but ignore them ++ } ++ } ++ ++ // Inform the server of our decision ++ if (authType != secTypeInvalid) { ++ os->writeU8(authType); ++ os->flush(); ++ vlog.debug("Choosing authentication type %s(%d)",secTypeName(authType),authType); ++ } ++ ++ if (authType == secTypeInvalid) { ++ state_ = RFBSTATE_INVALID; ++ vlog.error("No matching authentication types"); ++ throw Exception("No matching authentication types"); ++ } ++ ++ security = getCSecurity(authType); ++ processSecurityMsg(); ++} ++ + void CConnection::processSecurityMsg() + { + vlog.debug("processing security message"); +- bool done; +- if (!security->processMsg(this, &done)) ++ switch (security->processMsg(this)) { ++ case CSecurity::RFB_SECURITY_ERROR: + throwAuthFailureException(); +- if (done) { ++ case CSecurity::RFB_SECURITY_COMPLETED: + state_ = RFBSTATE_SECURITY_RESULT; + processSecurityResultMsg(); ++ break; ++ case CSecurity::RFB_SECURITY_DEFER: ++ break; ++ case CSecurity::RFB_SECURITY_AUTH_TYPES: ++ processAuthTypesMsg(); ++ break; ++ default: ++ throw Exception("CConnection::processSecurityMsg: invalid security status"); + } + } + +--- vnc-4.0b5-unixsrc/rfb/CSecurityVncAuth.h.tls 2004-06-11 16:36:08.317279378 +0100 ++++ vnc-4.0b5-unixsrc/rfb/CSecurityVncAuth.h 2004-06-11 16:36:46.980902194 +0100 +@@ -30,7 +30,7 @@ + public: + CSecurityVncAuth(UserPasswdGetter* pg); + virtual ~CSecurityVncAuth(); +- virtual bool processMsg(CConnection* cc, bool* done); ++ virtual statusEnum processMsg(CConnection* cc); + virtual int getType() const {return secTypeVncAuth;}; + virtual const char* description() const {return "No Encryption";} + private: +--- vnc-4.0b5-unixsrc/network/Makefile.in.tls 2004-06-11 16:36:08.319279100 +0100 ++++ vnc-4.0b5-unixsrc/network/Makefile.in 2004-06-11 16:36:46.981902055 +0100 +@@ -3,7 +3,7 @@ + + OBJS = $(SRCS:.cxx=.o) + +-DIR_CPPFLAGS = -I$(top_srcdir) @SOCKLEN_T_DEFINE@ ++DIR_CPPFLAGS = -I$(top_srcdir) @SOCKLEN_T_DEFINE@ @LIBGNUTLS_CFLAGS@ + + library = libnetwork.a + +@@ -14,4 +14,5 @@ + $(AR) $(library) $(OBJS) + $(RANLIB) $(library) + ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +--- vnc-4.0b5-unixsrc/vncconfig/Makefile.in.tls 2004-06-11 16:36:08.322278683 +0100 ++++ vnc-4.0b5-unixsrc/vncconfig/Makefile.in 2004-06-11 16:36:47.034894685 +0100 +@@ -8,9 +8,9 @@ + DEP_LIBS = ../tx/libtx.a ../rfb/librfb.a ../network/libnetwork.a \ + ../rdr/librdr.a + +-EXTRA_LIBS = @X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ ++EXTRA_LIBS = @X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ @LIBGNUTLS_LIBS@ + +-DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS ++DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx @X_CFLAGS@ @LIBGNUTLS_CFLAGS@ # X_CFLAGS are really CPPFLAGS + + all:: $(program) + +--- vnc-4.0b5-unixsrc/rdr/FdInStream.h.tls 2004-06-11 16:36:08.324278405 +0100 ++++ vnc-4.0b5-unixsrc/rdr/FdInStream.h 2004-06-11 16:36:47.035894546 +0100 +@@ -25,6 +25,10 @@ + + #include + ++#ifdef HAVE_GNUTLS ++#include ++#endif ++ + namespace rdr { + + class FdInStreamBlockCallback { +@@ -47,6 +51,10 @@ + int pos(); + void readBytes(void* data, int length); + ++#ifdef HAVE_GNUTLS ++ void useTLS(gnutls_session session); ++#endif ++ + void startTiming(); + void stopTiming(); + unsigned int kbitsPerSecond(); +@@ -63,6 +71,10 @@ + int timeoutms; + FdInStreamBlockCallback* blockCallback; + ++#ifdef HAVE_GNUTLS ++ gnutls_session tlsSession; ++#endif ++ + bool timing; + unsigned int timeWaitedIn100us; + unsigned int timedKbits; +--- vnc-4.0b5-unixsrc/rdr/FdOutStream.cxx.tls 2004-06-11 16:36:08.327277987 +0100 ++++ vnc-4.0b5-unixsrc/rdr/FdOutStream.cxx 2004-06-11 16:36:47.035894546 +0100 +@@ -45,6 +45,9 @@ + FdOutStream::FdOutStream(int fd_, int timeoutms_, int bufSize_) + : fd(fd_), timeoutms(timeoutms_), + bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0) ++#ifdef HAVE_GNUTLS ++ ,tlsSession(0) ++#endif + { + ptr = start = new U8[bufSize]; + end = start + bufSize; +@@ -113,6 +116,13 @@ + return nItems; + } + ++#ifdef HAVE_GNUTLS ++void FdOutStream::useTLS(gnutls_session session) ++{ ++ tlsSession = session; ++} ++#endif ++ + // + // writeWithTimeout() writes up to the given length in bytes from the given + // buffer to the file descriptor. If there is a timeout set and that timeout +@@ -127,7 +137,9 @@ + { + int n; + ++#ifndef HAVE_GNUTLS + do { ++#endif + + do { + fd_set fds; +@@ -159,15 +171,32 @@ + + if (n == 0) throw TimedOut(); + +- do { +- n = ::write(fd, data, length); +- } while (n < 0 && (errno == EINTR)); ++#ifdef HAVE_GNUTLS ++ if (!tlsSession) { ++#endif ++ ++ do { ++ n = ::write(fd, data, length); ++ } while (n < 0 && (errno == EINTR)); ++ ++#ifdef HAVE_GNUTLS ++ } else { ++ ++ do { ++ n = gnutls_record_send(tlsSession, data, length); ++ } while (n == GNUTLS_E_INTERRUPTED); ++ ++ if (n < 0) throw TLSException("send",n); ++ } ++#else + + // NB: This outer loop simply fixes a broken Winsock2 EWOULDBLOCK + // condition, found only under Win98 (first edition), with slow + // network connections. Should in fact never ever happen... + } while (n < 0 && (errno == EWOULDBLOCK)); + ++#endif /* HAVE_GNUTLS */ ++ + if (n < 0) throw SystemException("write",errno); + + return n; +--- vnc-4.0b5-unixsrc/rdr/FdOutStream.h.tls 2004-06-11 16:36:08.329277709 +0100 ++++ vnc-4.0b5-unixsrc/rdr/FdOutStream.h 2004-06-11 16:36:47.088887176 +0100 +@@ -25,6 +25,10 @@ + + #include + ++#ifdef HAVE_GNUTLS ++#include ++#endif ++ + namespace rdr { + + class FdOutStream : public OutStream { +@@ -41,6 +45,10 @@ + int length(); + void writeBytes(const void* data, int length); + ++#ifdef HAVE_GNUTLS ++ void useTLS(gnutls_session session); ++#endif ++ + private: + int overrun(int itemSize, int nItems); + int writeWithTimeout(const void* data, int length); +@@ -49,6 +57,10 @@ + int bufSize; + int offset; + U8* start; ++ ++#ifdef HAVE_GNUTLS ++ gnutls_session tlsSession; ++#endif + }; + + } +--- vnc-4.0b5-unixsrc/rdr/Makefile.in.tls 2004-06-11 16:36:08.331277431 +0100 ++++ vnc-4.0b5-unixsrc/rdr/Makefile.in 2004-06-11 16:36:47.089887037 +0100 +@@ -5,7 +5,7 @@ + + OBJS = $(SRCS:.cxx=.o) + +-DIR_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@ ++DIR_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@ @LIBGNUTLS_CFLAGS@ + + library = librdr.a + +--- vnc-4.0b5-unixsrc/rdr/Exception.cxx.tls 2004-06-11 16:36:08.333277153 +0100 ++++ vnc-4.0b5-unixsrc/rdr/Exception.cxx 2004-06-11 16:36:47.089887037 +0100 +@@ -62,3 +62,17 @@ + strncat(str_, buf, len-1-strlen(str_)); + strncat(str_, ")", len-1-strlen(str_)); + } ++ ++#ifdef HAVE_GNUTLS ++TLSException::TLSException(const char* s, int err_) ++ : Exception(s, "rdr::TLSException"), err(err_) ++{ ++ strncat(str_, ": ", len-1-strlen(str_)); ++ strncat(str_, gnutls_strerror(err), len-1-strlen(str_)); ++ strncat(str_, " (", len-1-strlen(str_)); ++ char buf[20]; ++ sprintf(buf,"%d",err); ++ strncat(str_, buf, len-1-strlen(str_)); ++ strncat(str_, ")", len-1-strlen(str_)); ++} ++#endif /* HAVE_GNUTLS */ +--- vnc-4.0b5-unixsrc/rdr/FdInStream.cxx.tls 2004-06-11 16:36:08.335276875 +0100 ++++ vnc-4.0b5-unixsrc/rdr/FdInStream.cxx 2004-06-11 16:36:47.142879667 +0100 +@@ -53,6 +53,9 @@ + bool closeWhenDone_) + : fd(fd_), closeWhenDone(closeWhenDone_), + timeoutms(timeoutms_), blockCallback(0), ++#ifdef HAVE_GNUTLS ++ tlsSession(0), ++#endif + timing(false), timeWaitedIn100us(5), timedKbits(0), + bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0) + { +@@ -169,6 +172,13 @@ + } + #endif + ++#ifdef HAVE_GNUTLS ++void FdInStream::useTLS(gnutls_session session) ++{ ++ tlsSession = session; ++} ++#endif ++ + // + // readWithTimeoutOrCallback() reads up to the given length in bytes from the + // file descriptor into a buffer. If the wait argument is false, then zero is +@@ -217,12 +227,29 @@ + blockCallback->blockCallback(); + } + +- do { +- n = ::read(fd, buf, len); +- } while (n < 0 && errno == EINTR); ++#ifdef HAVE_GNUTLS ++ if (!tlsSession) { ++#endif ++ ++ do { ++ n = ::read(fd, buf, len); ++ } while (n < 0 && errno == EINTR); + +- if (n < 0) throw SystemException("read",errno); +- if (n == 0) throw EndOfStream(); ++ if (n < 0) throw SystemException("read",errno); ++ if (n == 0) throw EndOfStream(); ++ ++#ifdef HAVE_GNUTLS ++ } else { ++ ++ do { ++ n = gnutls_record_recv(tlsSession, buf, len); ++ } while (n == GNUTLS_E_INTERRUPTED); ++ ++ if (n < 0) throw TLSException("recv",n); ++ if (n == 0) throw EndOfStream(); ++ ++ } ++#endif + + if (timing) { + gettimeofday(&after, 0); +--- vnc-4.0b5-unixsrc/rdr/Exception.h.tls 2004-06-11 16:36:08.337276597 +0100 ++++ vnc-4.0b5-unixsrc/rdr/Exception.h 2004-06-11 16:36:47.143879528 +0100 +@@ -22,6 +22,10 @@ + #include + #include + ++#ifdef HAVE_GNUTLS ++#include ++#endif ++ + namespace rdr { + + struct Exception { +@@ -44,7 +48,7 @@ + struct SystemException : public Exception { + int err; + SystemException(const char* s, int err_); +- }; ++ }; + + struct TimedOut : public Exception { + TimedOut(const char* s="Timed out") : Exception(s,"rdr::TimedOut") {} +@@ -54,6 +58,13 @@ + EndOfStream(const char* s="End of stream") + : Exception(s,"rdr::EndOfStream") {} + }; ++ ++#ifdef HAVE_GNUTLS ++ struct TLSException : public Exception { ++ int err; ++ TLSException(const char* s, int err_); ++ }; ++#endif + } + + #endif +--- vnc-4.0b5-unixsrc/vncviewer/Makefile.in.tls 2004-06-11 16:36:08.339276319 +0100 ++++ vnc-4.0b5-unixsrc/vncviewer/Makefile.in 2004-06-11 16:36:47.144879388 +0100 +@@ -8,9 +8,9 @@ + DEP_LIBS = ../tx/libtx.a ../rfb/librfb.a ../network/libnetwork.a \ + ../rdr/librdr.a + +-EXTRA_LIBS = @ZLIB_LIB@ @X_PRE_LIBS@ @X_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@ ++EXTRA_LIBS = @ZLIB_LIB@ @X_PRE_LIBS@ @X_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@ @LIBGNUTLS_LIBS@ + +-DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS ++DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx @X_CFLAGS@ @LIBGNUTLS_CFLAGS@ # X_CFLAGS are really CPPFLAGS + + all:: $(program) + +--- vnc-4.0b5-unixsrc/vncviewer/CConn.cxx.tls 2004-06-11 16:36:08.341276041 +0100 ++++ vnc-4.0b5-unixsrc/vncviewer/CConn.cxx 2004-06-11 16:36:47.201871462 +0100 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -64,8 +65,16 @@ + menuKeysym = XStringToKeysym(menuKeyStr.buf); + + setShared(shared); ++ ++#ifdef HAVE_GNUTLS ++ addSecType(secTypeTLS); ++#endif + addSecType(secTypeNone); + addSecType(secTypeVncAuth); ++ ++ addAuthType(secTypeNone); ++ addAuthType(secTypeVncAuth); ++ + CharArray encStr(preferredEncoding.getData()); + int encNum = encodingNum(encStr.buf); + if (encNum != -1) { +@@ -216,6 +225,10 @@ + return new CSecurityNone(); + case secTypeVncAuth: + return new CSecurityVncAuth(this); ++#ifdef HAVE_GNUTLS ++ case secTypeTLS: ++ return new CSecurityTLS(); ++#endif + default: + throw rfb::Exception("Unsupported secType?"); + } +--- vnc-4.0b5-unixsrc/tx/Makefile.in.tls 2004-06-11 16:36:08.392268949 +0100 ++++ vnc-4.0b5-unixsrc/tx/Makefile.in 2004-06-11 16:36:47.202871323 +0100 +@@ -4,7 +4,7 @@ + + OBJS = $(SRCS:.cxx=.o) + +-DIR_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS ++DIR_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@ @LIBGNUTLS_CFLAGS@ # X_CFLAGS are really CPPFLAGS + + library = libtx.a + --- vnc4-4.1.1+X4.3.0.orig/debian/patches/tunnel-and-fpic-vnc4-4.3.0-3.patch +++ vnc4-4.1.1+X4.3.0/debian/patches/tunnel-and-fpic-vnc4-4.3.0-3.patch @@ -0,0 +1,765 @@ +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/boilerplate.mk vnc4-4.1.1+X4.3.0.orig/common/boilerplate.mk +--- vnc4-4.1.1+X4.3.0.orig_old/common/boilerplate.mk 2004-07-14 03:23:21.000000000 +1000 ++++ vnc4-4.1.1+X4.3.0.orig/common/boilerplate.mk 2006-02-22 15:16:24.000000000 +1100 +@@ -15,7 +15,7 @@ + CFLAGS = @CFLAGS@ $(DIR_CFLAGS) + CCLD = $(CC) + CXX = @CXX@ +-CXXFLAGS = @CXXFLAGS@ ++CXXFLAGS = @CXXFLAGS@ $(DIR_CXXFLAGS) + CXXLD = $(CXX) + CPPFLAGS = @CPPFLAGS@ + DEFS = @DEFS@ +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/Makefile.in vnc4-4.1.1+X4.3.0.orig/common/Makefile.in +--- vnc4-4.1.1+X4.3.0.orig_old/common/Makefile.in 2004-07-14 03:28:00.000000000 +1000 ++++ vnc4-4.1.1+X4.3.0.orig/common/Makefile.in 2006-02-22 15:16:24.000000000 +1100 +@@ -1,4 +1,6 @@ + + SUBDIRS = @ZLIB_DIR@ rdr network Xregion rfb + ++DIR_CFLAGS = -DPIC -fPIC ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/network/Makefile.in vnc4-4.1.1+X4.3.0.orig/common/network/Makefile.in +--- vnc4-4.1.1+X4.3.0.orig_old/common/network/Makefile.in 2006-02-22 15:15:16.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/network/Makefile.in 2006-02-22 15:16:24.000000000 +1100 +@@ -17,4 +17,5 @@ + DIR_CFLAGS = -DPIC -fPIC + DIR_CXXFLAGS = -DPIC -fPIC + ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/network/TcpSocket.cxx vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.cxx +--- vnc4-4.1.1+X4.3.0.orig_old/common/network/TcpSocket.cxx 2005-03-12 02:08:41.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.cxx 2006-02-22 15:16:24.000000000 +1100 +@@ -54,6 +54,29 @@ + + static rfb::LogWriter vlog("TcpSocket"); + ++/* Tunnelling support. */ ++int network::findFreeTcpPort (void) ++{ ++ int sock, port; ++ struct sockaddr_in addr; ++ memset(&addr, 0, sizeof(addr)); ++ addr.sin_family = AF_INET; ++ addr.sin_addr.s_addr = INADDR_ANY; ++ ++ if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) ++ throw SocketException ("unable to create socket", errorNumber); ++ ++ for (port = TUNNEL_PORT_OFFSET + 99; port > TUNNEL_PORT_OFFSET; port--) { ++ addr.sin_port = htons ((unsigned short) port); ++ if (bind (sock, (struct sockaddr *)&addr, sizeof (addr)) == 0) { ++ close (sock); ++ return port; ++ } ++ } ++ throw SocketException ("no free port in range", 0); ++ return 0; ++} ++ + + // -=- Socket initialisation + static bool socketsInitialised = false; +@@ -117,10 +140,14 @@ + } + + // Attempt to connect to the remote host +- if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) { +- int e = errorNumber; +- closesocket(sock); +- throw SocketException("unable to connect to host", e); ++ for (;;) { ++ if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) { ++ int e = errorNumber; ++ if (e == EINTR) ++ continue; ++ closesocket(sock); ++ throw SocketException("unable to connect to host", e); ++ } else break; + } + + // Disable Nagle's algorithm, to reduce latency +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/network/TcpSocket.h vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.h +--- vnc4-4.1.1+X4.3.0.orig_old/common/network/TcpSocket.h 2005-03-12 02:08:41.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/network/TcpSocket.h 2006-02-22 15:16:24.000000000 +1100 +@@ -32,8 +32,14 @@ + + #include + ++/* Tunnelling support. */ ++#define TUNNEL_PORT_OFFSET 5500 ++ + namespace network { + ++ /* Tunnelling support. */ ++ int findFreeTcpPort (void); ++ + class TcpSocket : public Socket { + public: + TcpSocket(int sock, bool close=true); +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/rdr/Makefile.in vnc4-4.1.1+X4.3.0.orig/common/rdr/Makefile.in +--- vnc4-4.1.1+X4.3.0.orig_old/common/rdr/Makefile.in 2006-02-22 15:15:16.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/rdr/Makefile.in 2006-02-22 15:16:24.000000000 +1100 +@@ -19,4 +19,5 @@ + DIR_CFLAGS = -DPIC -fPIC + DIR_CXXFLAGS = -DPIC -fPIC + ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/rfb/Makefile.in vnc4-4.1.1+X4.3.0.orig/common/rfb/Makefile.in +--- vnc4-4.1.1+X4.3.0.orig_old/common/rfb/Makefile.in 2006-02-22 15:15:16.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/rfb/Makefile.in 2006-02-22 15:16:24.000000000 +1100 +@@ -68,4 +68,6 @@ + DIR_CFLAGS = -DPIC -fPIC + DIR_CXXFLAGS = -DPIC -fPIC + ++DIR_CFLAGS = -DPIC -fPIC ++DIR_CXXFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/rfb/ServerCore.cxx vnc4-4.1.1+X4.3.0.orig/common/rfb/ServerCore.cxx +--- vnc4-4.1.1+X4.3.0.orig_old/common/rfb/ServerCore.cxx 2005-03-12 02:08:41.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/rfb/ServerCore.cxx 2006-02-22 15:16:24.000000000 +1100 +@@ -29,7 +29,7 @@ + ("IdleTimeout", + "The number of seconds after which an idle VNC connection will be dropped " + "(zero means no timeout)", +- 3600, 0); ++ 0, 0); + rfb::IntParameter rfb::Server::clientWaitTimeMillis + ("ClientWaitTimeMillis", + "The number of milliseconds to wait for a client which is no longer " +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/common/Xregion/Makefile.in vnc4-4.1.1+X4.3.0.orig/common/Xregion/Makefile.in +--- vnc4-4.1.1+X4.3.0.orig_old/common/Xregion/Makefile.in 2006-02-22 15:15:16.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/common/Xregion/Makefile.in 2006-02-22 15:16:24.000000000 +1100 +@@ -15,4 +15,5 @@ + DIR_CFLAGS = -DPIC -fPIC + DIR_CXXFLAGS = -DPIC -fPIC + ++DIR_CFLAGS = -DPIC -fPIC + # followed by boilerplate.mk +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/configure.in vnc4-4.1.1+X4.3.0.orig/unix/configure.in +--- vnc4-4.1.1+X4.3.0.orig_old/unix/configure.in 2005-01-12 03:37:17.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/configure.in 2006-02-22 15:16:24.000000000 +1100 +@@ -65,6 +65,18 @@ + AC_SUBST(ZLIB_INCLUDE) + AC_SUBST(ZLIB_LIB) + ++AC_ARG_WITH(fb, ++[ --with-fb use the new 'fb' framebuffer implementation]) ++if test "$with_installed_zlib" = yes; then ++ echo "using 'fb' framebuffer" ++ USE_FB=YES ++else ++ echo "using 'mfb' and 'cfb' framebuffer" ++ USE_FB=NO ++fi ++ ++AC_SUBST(USE_FB) ++ + BOILERPLATE=boilerplate.mk + + if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then +@@ -79,4 +91,5 @@ + vncviewer/Makefile:common.mk:vncviewer/Makefile.in:$BOILERPLATE \ + vncconfig/Makefile:common.mk:vncconfig/Makefile.in:$BOILERPLATE \ + vncpasswd/Makefile:common.mk:vncpasswd/Makefile.in:$BOILERPLATE \ ++ xc/config/cf/vnc.def \ + ) +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/vncserver vnc4-4.1.1+X4.3.0.orig/unix/vncserver +--- vnc4-4.1.1+X4.3.0.orig_old/unix/vncserver 2005-02-23 23:28:18.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/vncserver 2006-02-22 15:16:24.000000000 +1100 +@@ -42,6 +42,10 @@ + + $defaultXStartup + = ("#!/bin/sh\n\n". ++ "# Uncomment the following two lines for normal desktop:\n". ++ "# unset SESSION_MANAGER\n". ++ "# exec /etc/X11/xinit/xinitrc\n\n". ++ "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n". + "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n". + "xsetroot -solid grey\n". + "vncconfig -iconic &\n". +@@ -116,18 +120,12 @@ + $desktopLog = "$vncUserDir/$host:$displayNumber.log"; + unlink($desktopLog); + +-# Make an X server cookie - use as the seed the sum of the current time, our +-# PID and part of the encrypted form of the password. Ideally we'd use +-# /dev/urandom, but that's only available on Linux. +- +-srand(time+$$+unpack("L",`cat $vncUserDir/passwd`)); +-$cookie = ""; +-for (1..16) { +- $cookie .= sprintf("%02x", int(rand(256)) % 256); +-} +- +-system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie"); +-system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); ++# Make an X server cookie - use mcookie ++$cookie = `/usr/bin/mcookie`; ++open (XAUTH, "|xauth -f $xauthorityFile source -"); ++print XAUTH "add $host:$displayNumber . $cookie\n"; ++print XAUTH "add $host/unix:$displayNumber . $cookie\n"; ++close XAUTH; + + if ($opt{'-name'}) { + $desktopName = $opt{'-name'}; +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/vncviewer/vncviewer.cxx vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.cxx +--- vnc4-4.1.1+X4.3.0.orig_old/unix/vncviewer/vncviewer.cxx 2005-03-12 02:08:41.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.cxx 2006-02-22 15:16:24.000000000 +1100 +@@ -41,6 +41,7 @@ + + using namespace network; + using namespace rfb; ++using namespace std; + + IntParameter pointerEventInterval("PointerEventInterval", + "Time in milliseconds to rate-limit" +@@ -95,6 +96,9 @@ + StringParameter geometry("geometry", "X geometry specification", ""); + StringParameter displayname("display", "The X display", ""); + ++/* Support for tunnelling */ ++StringParameter via("via", "Gateway to tunnel via", ""); ++ + char aboutText[256]; + char* programName; + extern char buildtime[]; +@@ -157,6 +161,61 @@ + exit(1); + } + ++/* Tunnelling support. */ ++static void ++interpretViaParam (char **gatewayHost, char **remoteHost, ++ int *remotePort, char **vncServerName, ++ int localPort) ++{ ++ const int SERVER_PORT_OFFSET = 5900; ++ char *pos = strchr (*vncServerName, ':'); ++ if (pos == NULL) ++ *remotePort = SERVER_PORT_OFFSET; ++ else { ++ int portOffset = SERVER_PORT_OFFSET; ++ size_t len; ++ *pos++ = '\0'; ++ len = strlen (pos); ++ if (*pos == ':') { ++ /* Two colons is an absolute port number, not an offset. */ ++ pos++; ++ len--; ++ portOffset = 0; ++ } ++ if (!len || strspn (pos, "-0123456789") != len ) ++ usage (); ++ *remotePort = atoi (pos) + portOffset; ++ } ++ ++ if (**vncServerName != '\0') ++ *remoteHost = *vncServerName; ++ ++ *gatewayHost = strDup (via.getValueStr ()); ++ *vncServerName = new char[50]; ++ sprintf (*vncServerName, "localhost::%d", localPort); ++} ++ ++static void ++createTunnel (const char *gatewayHost, const char *remoteHost, ++ int remotePort, int localPort) ++{ ++ char *cmd = getenv ("VNC_VIA_CMD"); ++ char *percent; ++ char lport[10], rport[10]; ++ sprintf (lport, "%d", localPort); ++ sprintf (rport, "%d", remotePort); ++ setenv ("G", gatewayHost, 1); ++ setenv ("H", remoteHost, 1); ++ setenv ("R", rport, 1); ++ setenv ("L", lport, 1); ++ if (!cmd) ++ cmd = "/usr/bin/ssh -f -L \"$L\":\"$H\":\"$R\" \"$G\" sleep 20"; ++ /* Compatibility with TightVNC's method. */ ++ while ((percent = strchr (cmd, '%')) != NULL) ++ *percent = '$'; ++ system (cmd); ++} ++ + int main(int argc, char** argv) + { + sprintf(aboutText, "VNC Viewer Free Edition 4.1.1 for X - built %s\n" +@@ -190,8 +249,6 @@ + usage(); + } + +- if (vncServerName) +- usage(); + vncServerName = argv[i]; + } + +@@ -207,6 +264,19 @@ + vlog.error("Could not create .vnc directory: environment variable $HOME not set."); + + try { ++ /* Tunnelling support. */ ++ if (strlen (via.getValueStr ()) > 0) { ++ char *gatewayHost = ""; ++ char *remoteHost = "localhost"; ++ int localPort = findFreeTcpPort (); ++ int remotePort; ++ if (!vncServerName) ++ usage(); ++ interpretViaParam (&gatewayHost, &remoteHost, &remotePort, ++ &vncServerName, localPort); ++ createTunnel (gatewayHost, remoteHost, remotePort, localPort); ++ } ++ + Socket* sock = 0; + + if (listenMode) { +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/vncviewer/vncviewer.man vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.man +--- vnc4-4.1.1+X4.3.0.orig_old/unix/vncviewer/vncviewer.man 2005-03-04 00:10:40.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/vncviewer/vncviewer.man 2006-02-22 15:16:24.000000000 +1100 +@@ -174,6 +174,23 @@ + specified as an X11 keysym name (these can be obtained by removing the XK_ + prefix from the entries in "/usr/include/X11/keysymdef.h"). Default is F8. + ++.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 ++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. ++"localhost" denotes the \fIgateway\fR, not the machine where vncviewer ++was launched. The environment variable \fIVNC_VIA_CMD\fR can override ++the default tunnel command of ++\fB/usr/bin/ssh\ -f\ -L\ "$L":"$H":"$R"\ "$G"\ sleep\ 20\fR. The tunnel ++command is executed with the environment variables \fIL\fR, \fIH\fR, ++\fIR\fR, and \fIG\fR taken the values of the local port number, the remote ++host, the port number on the remote host, and the gateway machine ++respectively. ++ + .SH SEE ALSO + .BR Xvnc (1), + .BR vncpasswd (1), +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/config/cf/vnc.def.in vnc4-4.1.1+X4.3.0.orig/unix/xc/config/cf/vnc.def.in +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/config/cf/vnc.def.in 1970-01-01 10:00:00.000000000 +1000 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/config/cf/vnc.def.in 2006-02-22 15:16:24.000000000 +1100 +@@ -0,0 +1,38 @@ ++#define BuildServersOnly YES ++#define BuildFonts NO ++#define BuildClients NO ++#define BuildDocs NO ++#define BuildPexExt NO ++#define BuildNls NO ++#define BuildXIE NO ++#define BuildGlxExt NO ++#define XnestServer YES ++#define XF86Server NO ++#define XprtServer NO ++ ++#ifdef SunArchitecture ++#define ProjectRoot /usr/openwin ++#define HasGcc2 YES ++#define BuildXKB NO ++#endif ++ ++#define HasFreetype2 NO ++#define BuildVNCExt YES ++#define VNCExtDefines -DVNCEXT ++#define SiteExtensionDefines VNCExtDefines ++#define SiteExtensionDirs vnc ++ ++#define VncUseFb @USE_FB@ ++ ++#define VncUnixDir $(TOP)/.. ++#define VncCommonDir VncUnixDir/../common ++#define VncExtLibs VncCommonDir/rfb/librfb.a \ ++ VncCommonDir/Xregion/libXregion.a \ ++ VncCommonDir/network/libnetwork.a \ ++ VncCommonDir/rdr/librdr.a ++ ++#define SiteExtensionLibs vnc/LibraryTargetName(vnc) VncExtLibs ++ ++#define ServerTarget(server,subdirs,objects,libs,syslibs) @@\ ++CCLINK = $(CXXENVSETUP) $(CXX) @@\ ++ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,$(_NOOP_)) +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Imakefile vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Imakefile +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Imakefile 2004-07-14 03:21:33.000000000 +1000 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Imakefile 2006-02-22 15:16:24.000000000 +1100 +@@ -19,7 +19,7 @@ + SRCS = vncExtInit.cc vncHooks.cc XserverDesktop.cc + OBJS = vncExtInit.o vncHooks.o XserverDesktop.o + INCLUDES = -I../include -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(FONTINCSRC) \ +- -I../mfb -I../mi $(VNCINCLUDE) ++ -I../render $(VNCINCLUDE) + #if defined(XFree86Version) && XFree86Version >= 4000 + VNCDEFINES = -DGC_HAS_COMPOSITE_CLIP + #endif +@@ -36,8 +36,8 @@ + NormalLintTarget($(SRCS)) + + NormalLibraryObjectRule() +-NormalCplusplusObjectRule() +- ++.CCsuf.Osuf: ++ NormalSharedLibObjCplusplusCompile($(_NOOP_)) + + MakeSubdirs($(SUBDIRS)) + DependSubdirs($(SUBDIRS)) +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/module/Imakefile vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/module/Imakefile +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/module/Imakefile 2006-02-22 15:15:16.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/module/Imakefile 2006-02-22 15:16:24.000000000 +1100 +@@ -13,7 +13,7 @@ + OBJS = vncExtInit.o vncHooks.o xf86vncModule.o XserverDesktop.o + INCLUDES = -I.. -I../../include -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + -I$(FONTINCSRC) -I$(XF86COMSRC) \ +- $(VNCINCLUDE) ++ -I../../render $(VNCINCLUDE) + DEFINES = -fPIC $(STD_DEFINES) -DGC_HAS_COMPOSITE_CLIP -DXFree86LOADER + + LinkSourceFile(vncExtInit.cc,..) +@@ -21,7 +21,8 @@ + LinkSourceFile(xf86vncModule.cc,..) + LinkSourceFile(XserverDesktop.cc,..) + +-ModuleObjectRule() ++.CCsuf.Osuf: ++ NormalSharedLibObjCplusplusCompile($(_NOOP_)) + /* + LibraryModuleTarget(vnc,$(OBJS) $(VNCLIBS)) + InstallLibraryModule(vnc,$(MODULEDIR),extensions) +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/vncHooks.cc vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/vncHooks.cc +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/vncHooks.cc 2005-03-12 02:08:41.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/vncHooks.cc 2006-02-22 15:16:24.000000000 +1100 +@@ -29,6 +29,9 @@ + #include "regionstr.h" + #include "dixfontstr.h" + #include "colormapst.h" ++#ifdef RENDER ++#include "picturestr.h" ++#endif + + #ifdef GC_HAS_COMPOSITE_CLIP + #define COMPOSITE_CLIP(gc) ((gc)->pCompositeClip) +@@ -74,6 +77,9 @@ + StoreColorsProcPtr StoreColors; + DisplayCursorProcPtr DisplayCursor; + ScreenBlockHandlerProcPtr BlockHandler; ++#ifdef RENDER ++ CompositeProcPtr Composite; ++#endif + } vncHooksScreenRec, *vncHooksScreenPtr; + + typedef struct { +@@ -104,6 +110,13 @@ + static Bool vncHooksDisplayCursor(ScreenPtr pScreen, CursorPtr cursor); + static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout, + pointer pReadmask); ++#ifdef RENDER ++static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, ++ PicturePtr pDst, INT16 xSrc, INT16 ySrc, ++ INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, ++ CARD16 width, CARD16 height); ++#endif ++ + + // GC "funcs" + +@@ -229,6 +242,13 @@ + vncHooksScreen->StoreColors = pScreen->StoreColors; + vncHooksScreen->DisplayCursor = pScreen->DisplayCursor; + vncHooksScreen->BlockHandler = pScreen->BlockHandler; ++#ifdef RENDER ++ PictureScreenPtr ps; ++ ps = GetPictureScreenIfSet(pScreen); ++ if (ps) { ++ vncHooksScreen->Composite = ps->Composite; ++ } ++#endif + + pScreen->CloseScreen = vncHooksCloseScreen; + pScreen->CreateGC = vncHooksCreateGC; +@@ -241,6 +261,11 @@ + pScreen->StoreColors = vncHooksStoreColors; + pScreen->DisplayCursor = vncHooksDisplayCursor; + pScreen->BlockHandler = vncHooksBlockHandler; ++#ifdef RENDER ++ if (ps) { ++ ps->Composite = vncHooksComposite; ++ } ++#endif + + return TRUE; + } +@@ -470,6 +495,38 @@ + SCREEN_REWRAP(BlockHandler); + } + ++// Composite - needed for RENDER ++ ++#ifdef RENDER ++void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, ++ PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, ++ INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, ++ CARD16 height) ++{ ++ ScreenPtr pScreen = pDst->pDrawable->pScreen; ++ vncHooksScreenPtr vncHooksScreen = \ ++ ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); ++ BoxRec box; ++ PictureScreenPtr ps = GetPictureScreen(pScreen); ++ ++ if ((xDst >= 0) && (yDst >= 0)) { ++ box.x1 = pDst->pDrawable->x + xDst; ++ box.y1 = pDst->pDrawable->y + yDst; ++ box.x2 = box.x1 + width; ++ box.y2 = box.y1 + height; ++ ++ RegionHelper changed(pScreen, &box, 0); ++ vncHooksScreen->desktop->add_changed(changed.reg); ++ } ++ ++ ps->Composite = vncHooksScreen->Composite; ++ (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, ++ xMask, yMask, xDst, yDst, width, height); ++ ps->Composite = vncHooksComposite; ++} ++ ++#endif /* RENDER */ ++ + + + ///////////////////////////////////////////////////////////////////////////// +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile 2005-03-11 01:51:39.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/Imakefile 2006-02-22 15:16:24.000000000 +1100 +@@ -31,12 +31,19 @@ + OBJS1 = os2_stubs.o + #endif + ++#ifdef VncUseFb ++FB_DEFINES = -DVNC_USE_FB ++ FBINCLUDE = -I../../fb ++#else ++ FBINCLUDE = -I../../cfb ++#endif ++ + SRCSA = xvnc.cc stubs.c $(SRCS1) miinitext.c $(SRCS2) + + OBJSA = xvnc.o stubs.o $(OBJS1) miinitext.o $(OBJS2) + +-INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ +- -I../../cfb -I../../mfb -I../../mi -I../../include -I../../os \ ++INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) $(FB_DEFINES) \ ++ $(FBINCLUDE) -I../../mfb -I../../mi -I../../include -I../../os \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/render $(VNCINCLUDE) + + DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) \ +@@ -48,7 +55,7 @@ + * Make sure XINPUT, XF86VidTune, etc arent defined for the miinitext.o + * used by Xvnc + */ +-EXT_DEFINES = ExtensionDefines -UXF86VIDMODE -UXFreeXDGA -UXF86MISC ++EXT_DEFINES = ExtensionDefines -UXINPUT -UXF86VIDMODE -UXFreeXDGA -UXF86MISC + #endif + + +@@ -70,7 +77,7 @@ + SpecialCplusplusObjectRule(xvnc,$(ICONFIGFILES) xvnc,$(EXT_DEFINES) $(NO_OPERATOR_NAMES)) + + LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) +-SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) ++SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) + + /* InstallManPage(Xvfb,$(MANDIR)) */ + DependTarget() +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2005-03-11 02:52:58.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2006-02-22 15:16:24.000000000 +1100 +@@ -48,8 +48,12 @@ + #include "X11/Xos.h" + #include "scrnintstr.h" + #include "servermd.h" ++#ifdef VNC_USE_FB ++#include "fb.h" ++#else + #define PSZ 8 + #include "cfb.h" ++#endif + #include "mi.h" + #include "mibstore.h" + #include "colormapst.h" +@@ -73,6 +77,7 @@ + #undef public + #undef xor + #undef and ++#ifndef VNC_USE_FB + extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int); + extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int); + extern Bool cfb16CreateGC(GCPtr); +@@ -83,6 +88,7 @@ + unsigned long, char*); + extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int, + unsigned long, char*); ++#endif + } + + #define XVNCVERSION "Free Edition 4.1.1" +@@ -129,6 +135,9 @@ + static Bool vfbPixmapDepths[33]; + static char needswap = 0; + static int lastScreen = -1; ++#ifdef RENDER ++static Bool Render = FALSE; ++#endif + + static bool displaySpecified = false; + static bool wellKnownSocketsCreated = false; +@@ -220,6 +229,10 @@ + VENDOR_STRING); + ErrorF("-screen scrn WxHxD set screen's width, height, depth\n"); + ErrorF("-pixdepths list-of-int support given pixmap depths\n"); ++#ifdef RENDER ++ ErrorF("+/-render turn on/off RENDER extension support" ++ "(default on)\n"); ++#endif + ErrorF("-linebias n adjust thin line pixelization\n"); + ErrorF("-blackpixel n pixel value for black\n"); + ErrorF("-whitepixel n pixel value for white\n"); +@@ -316,6 +329,20 @@ + return ret; + } + ++#ifdef RENDER ++ if (strcmp (argv[i], "+render") == 0) /* +render */ ++ { ++ Render = TRUE; ++ return 1; ++ } ++ ++ if (strcmp (argv[i], "-render") == 0) /* -render */ ++ { ++ Render = FALSE; ++ return 1; ++ } ++#endif ++ + if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */ + { + Pixel pix; +@@ -482,7 +509,7 @@ + } + #endif + +- ++#ifndef VNC_USE_FB + static Bool vfbMultiDepthCreateGC(GCPtr pGC) + { + switch (vfbBitsPerPixel(pGC->depth)) +@@ -541,6 +568,7 @@ + break; + } + } ++#endif + + static ColormapPtr InstalledMaps[MAXSCREENS]; + +@@ -811,6 +839,16 @@ + defaultColorVisualClass + = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor; + ++#ifdef VNC_USE_FB ++ if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, ++ dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel)) ++ return FALSE; ++ ++#ifdef RENDER ++ if (ret && Render) ++ fbPictureInit(pScreen, 0, 0); ++#endif /* RENDER */ ++#else /* VNC_USE_FB */ + switch (pvfb->bitsPerPixel) + { + case 1: +@@ -838,6 +876,7 @@ + pScreen->CreateGC = vfbMultiDepthCreateGC; + pScreen->GetImage = vfbMultiDepthGetImage; + pScreen->GetSpans = vfbMultiDepthGetSpans; ++#endif + + pScreen->InstallColormap = vfbInstallColormap; + pScreen->UninstallColormap = vfbUninstallColormap; +@@ -883,6 +922,9 @@ + } + } + ++#ifdef VNC_USE_FB ++ ret = fbCreateDefColormap(pScreen); ++#else + if (pvfb->bitsPerPixel == 1) + { + ret = mfbCreateDefColormap(pScreen); +@@ -891,6 +933,7 @@ + { + ret = cfbCreateDefColormap(pScreen); + } ++#endif + + miSetZeroLineBias(pScreen, pvfb->lineBias); + +@@ -926,6 +969,19 @@ + vfbPixmapDepths[vfbScreens[i].depth] = TRUE; + } + ++#ifdef RENDER ++ /* RENDER needs a good set of pixmaps. */ ++ if (Render) { ++ vfbPixmapDepths[1] = TRUE; ++ vfbPixmapDepths[4] = TRUE; ++ vfbPixmapDepths[8] = TRUE; ++/* vfbPixmapDepths[15] = TRUE; */ ++ vfbPixmapDepths[16] = TRUE; ++ vfbPixmapDepths[24] = TRUE; ++ vfbPixmapDepths[32] = TRUE; ++ } ++#endif ++ + for (i = 1; i <= 32; i++) + { + if (vfbPixmapDepths[i]) +diff -Naur vnc4-4.1.1+X4.3.0.orig_old/unix/xc.patch vnc4-4.1.1+X4.3.0.orig/unix/xc.patch +--- vnc4-4.1.1+X4.3.0.orig_old/unix/xc.patch 2004-12-01 22:33:15.000000000 +1100 ++++ vnc4-4.1.1+X4.3.0.orig/unix/xc.patch 2006-02-22 15:16:24.000000000 +1100 +@@ -2,7 +2,7 @@ + --- xc/programs/Xserver/Imakefile Fri Jun 6 11:14:39 2003 + *************** + *** 409,412 **** +---- 409,429 ---- ++--- 409,435 ---- + #endif + #endif /* XsunServer */ + + XCOMM +@@ -13,12 +13,18 @@ + + CFB16DIR = cfb16 + + CFB24DIR = cfb24 + + CFB32DIR = cfb32 +++ FBDIR = fb + + XVNCDDXDIR = vnc/Xvnc +++ #if VncUseFb +++ XVNCDIRS = $(STDDIRS) $(FBDIR) $(XVNCDDXDIR) $(DEPDIRS) +++ XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) FbPostFbLibs +++ #else + + XVNCDIRS = $(STDDIRS) $(MFBDIR) \ + + $(CFB8DIR) $(CFB16DIR) $(CFB24DIR) $(CFB32DIR) \ + + $(XVNCDDXDIR) $(DEPDIRS) +-+ XVNCOBJS = $(XVNCDDXDIR)/stubs.o $(XVNCDDXDIR)/miinitext.o + + XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) CFBLibs PostFbLibs +++ #endif +++ XVNCOBJS = $(XVNCDDXDIR)/stubs.o $(XVNCDDXDIR)/miinitext.o + + XVNCSYSLIBS = $(FONTLIBS) $(SYSLIBS) + + ServerTarget(Xvnc,$(XVNCDIRS),$(XVNCOBJS), \ + + $(LIBCWRAPPER) $(XVNCLIBS) $(LOADABLEEXTS),$(XVNCSYSLIBS)) --- vnc4-4.1.1+X4.3.0.orig/debian/patches/vnc4-build-ppc.patch +++ vnc4-4.1.1+X4.3.0/debian/patches/vnc4-build-ppc.patch @@ -0,0 +1,45 @@ +Package: vnc4 +Version: 4.1.1+X4.3.0-6 +Severity: wishlist +Tags: patch + +When building 'vnc4' on ppc64/unstable, I get the following error: + +gcc -O2 -fsigned-char -fno-merge-constants -I../../../programs/Xserver/fb -I../../../programs/Xserver/mi -I../../../programs/Xserver/include -I../../../exports/include/X11 -I../../../include/fonts -I../../../programs/Xserver/hw/xfree86/common -I../../../programs/Xserver/render -I../../../include/extensions -I../../../programs/Xserver/Xext -I../../.. -I../../../exports/include -I/usr/X11R6/include -Dlinux -D__powerpc__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DXF86BIGFONT -DDPMSExtension -DPANORAMIX -DRENDER -DRANDR -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DXvMCExtension -DSMART_SCHEDULE -DBUILDDEBUG -DXResExtension -DX_BYTE_ORDER=X_BIG_ENDIAN -DNDEBUG -DFUNCPROTO=15 -DNARROWPROTO -DIN_MODULE -DXFree86Module -c fbblt.c +fbblt.c: In function 'fbBlt': +fbblt.c:136: error: duplicate case value + +With the attached patch 'vnc4' can be compiled on ppc64. + +Regards +Andreas Jochens + +diff -urN ../tmp-orig/vnc4-4.1.1+X4.3.0/unix/xc/config/cf/linux.cf ./unix/xc/config/cf/linux.cf +--- ../tmp-orig/vnc4-4.1.1+X4.3.0/unix/xc/config/cf/linux.cf 2006-04-21 11:53:04.000000000 +0000 ++++ ./unix/xc/config/cf/linux.cf 2006-04-21 09:02:32.000000000 +0000 +@@ -818,7 +818,11 @@ + # endif + # define LinuxMachineDefines -D__powerpc__ + # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DPART_NET ++# ifdef __powerpc64__ ++# define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 ++# else + # define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines ++# endif + #endif /* PpcArchitecture */ + + #ifdef s390Architecture +diff -urN ../tmp-orig/vnc4-4.1.1+X4.3.0/unix/xc/include/Xmd.h ./unix/xc/include/Xmd.h +--- ../tmp-orig/vnc4-4.1.1+X4.3.0/unix/xc/include/Xmd.h 2002-05-31 18:45:39.000000000 +0000 ++++ ./unix/xc/include/Xmd.h 2006-04-21 10:18:20.000000000 +0000 +@@ -60,7 +60,7 @@ + #endif + #if defined(__alpha) || defined(__alpha__) || \ + defined(__ia64__) || defined(ia64) || \ +- defined(__sparc64__) || \ ++ defined(__sparc64__) || defined(__powerpc64__) || \ + defined(__s390x__) || \ + (defined(__hppa__) && defined(__LP64__)) || \ + defined(__x86_64__) || defined(x86_64) + + --- vnc4-4.1.1+X4.3.0.orig/debian/rules +++ vnc4-4.1.1+X4.3.0/debian/rules @@ -0,0 +1,180 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-unix-stamp configure-common-stamp + +configure-common-stamp: + dh_testdir + # Add here commands to configure the package. + (cd common; CFLAGS="$(CFLAGS)" ./configure \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ + --with-installed-zlib) + touch configure-common-stamp + +configure-unix-stamp: + dh_testdir + # Add here commands to configure the package. + (cd unix; CFLAGS="$(CFLAGS)" ./configure \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ + --with-installed-zlib) + touch configure-unix-stamp + +#Architecture +build: build-arch build-indep + +build-arch: build-arch-unix-stamp build-arch-common-stamp build-arch-x-stamp + +build-arch-x-stamp: build-arch-common-stamp build-arch-unix-stamp + (cd unix/xc; make World) + touch build-arch-x-stamp + +build-arch-common-stamp: configure-common-stamp + (cd common; $(MAKE)) + touch build-arch-common-stamp + +build-arch-unix-stamp: configure-unix-stamp build-arch-common-stamp + (cd unix; $(MAKE)) + touch build-arch-unix-stamp + +build-indep: build-indep-stamp +build-indep-stamp: + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + touch build-indep-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-arch-common-stamp build-arch-unix-stamp build-arch-x-stamp build-indep-stamp configure-unix-stamp configure-common-stamp #CONFIGURE-STAMP# + # Add here commands to clean up after the build process. + -rm -f config.log config.status config.cache config.guess config.sub + -(cd unix/xc; $(MAKE) clean) + -(cd unix/xc; $(MAKE) distclean) + -(cd common; $(MAKE) clean) + -(cd common; $(MAKE) distclean) + -(cd unix; $(MAKE) clean) + -(cd unix; $(MAKE) distclean) + -rm -f \ + unix/tx/Makefile \ + unix/vncconfig/Makefile \ + unix/vncpasswd/Makefile \ + unix/vncviewer/Makefile \ + unix/x0vncserver/Makefile \ + unix/Makefile \ + common/Xregion/Makefile \ + common/network/Makefile \ + common/rdr/Makefile \ + common/rfb/Makefile \ + common/Makefile + -rm -f unix/config.log unix/config.cache unix/config.status + -rm -f common/config.log common/config.cache common/config.status + dh_clean + +install: install-indep install-arch +install-indep: +# dh_testdir +# dh_testroot +# dh_clean -k -i +# dh_installdirs -i +# +# # Add here commands to install the indep part of the package into +# # debian/-doc. +# #INSTALLDOC# +# dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp. + #$(MAKE) install DESTDIR=$(CURDIR)/debian/vnc4 + mkdir -p $(CURDIR)/debian/tmp/usr/bin + mkdir -p $(CURDIR)/debian/tmp/usr/share/man/man1 + mkdir -p $(CURDIR)/debian/tmp/usr/lib/xorg/modules/extensions + (cd unix; ./vncinstall \ + $(CURDIR)/debian/tmp/usr/bin \ + $(CURDIR)/debian/tmp/usr/share/man \ + $(CURDIR)/debian/tmp/usr/lib/xorg/modules/extensions) + rename "s/vncviewer/xvncviewer/;" \ + debian/tmp/usr/bin/* \ + debian/tmp/usr/share/man/man1/* + rename "s/vnc/vnc4/;" \ + debian/tmp/usr/bin/* \ + debian/tmp/usr/share/man/man1/* + -rename "s/vnc.so/libvnc.so/;" \ + debian/tmp/usr/lib/xorg/modules/extensions/vnc.so + dh_install -s + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep +# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4server.README.Debian +++ vnc4-4.1.1+X4.3.0/debian/vnc4server.README.Debian @@ -0,0 +1,14 @@ +Note about vnc module and XF86Config + +This package install the vnc.so XFree86 version 4 module to the +/usr/X11R6/lib/modules/extensions directory and can be enabled like any other +module by adding a Load "vnc" line to the Module section of XF86Config. +The parameters listed in the Xvnc manual page can be set as options in +XF86Config e.g. Option "passwordFile" "/root/.vnc/passwd". +Note that for some reason options cannot be set in the Module section of +XF86Config - try the Screen section. + +You can also configure the vncserver by adding a vnc.conf file to /etc. +You can se a sample file in /usr/share/doc/vnc4-common/examples + + -- Ola Lundqvist , Sun Oct 24 21:47:14 2004 --- vnc4-4.1.1+X4.3.0.orig/debian/vnc4server.install +++ vnc4-4.1.1+X4.3.0/debian/vnc4server.install @@ -0,0 +1,9 @@ +debian/tmp/usr/bin/vnc4server usr/bin +debian/tmp/usr/bin/Xvnc4 usr/bin +debian/tmp/usr/bin/x0vnc4server usr/bin +debian/tmp/usr/bin/vnc4config usr/bin +debian/tmp/usr/lib usr +debian/tmp/usr/share/man/man1/vnc4server.1 usr/share/man/man1 +debian/tmp/usr/share/man/man1/x0vnc4server.1 usr/share/man/man1 +debian/tmp/usr/share/man/man1/vnc4config.1 usr/share/man/man1 +debian/tmp/usr/share/man/man1/Xvnc4.1 usr/share/man/man1 --- vnc4-4.1.1+X4.3.0.orig/debian/changelog +++ vnc4-4.1.1+X4.3.0/debian/changelog @@ -0,0 +1,179 @@ +vnc4 (4.1.1+X4.3.0-10) unstable; urgency=high + + * Correction of critical security issue. Thanks to Martin Kogler + that informed me about the issue, + and provided the patch. + This flaw was originally found by Steve Wiseman of intelliadmin.com. + * Applied patch from Javier Kohen that + inform the user that only 8 first characters of the password will + actually be used when typing more than 8 characters, closes: + #355619. + + -- Ola Lundqvist Mon, 15 May 2006 20:35:17 +0200 + +vnc4 (4.1.1+X4.3.0-9) unstable; urgency=low + + * Final corrections that closes: #363296. + + -- Ola Lundqvist Thu, 27 Apr 2006 07:04:56 +0200 + +vnc4 (4.1.1+X4.3.0-8) unstable; urgency=low + + * Correction in passwd call, closes: #364665. Thanks to + Taco IJsselmuiden for the fix. + + -- Ola Lundqvist Mon, 24 Apr 2006 22:21:12 +0200 + +vnc4 (4.1.1+X4.3.0-7) unstable; urgency=low + + * Applied patch from Andreas Jochens to make it build + on ppc, closes: #364145. + * Corrected issue in vncserver so it work rgb path, closes: #364091. + * Run Xvnc4 instead of Xvnc. + + -- Ola Lundqvist Fri, 21 Apr 2006 21:11:11 +0200 + +vnc4 (4.1.1+X4.3.0-6) unstable; urgency=low + + * Incorporated changes to vncserver script from 4.0-8 version of this + package. + * Merged patch from Peter Cordes (for + tightvncserver) so it can work with xorg version 7.0, + closes: #363296. + * Moved to xorig dir for extensions, closes: #363309. + + -- Ola Lundqvist Wed, 19 Apr 2006 21:51:08 +0200 + +vnc4 (4.1.1+X4.3.0-5) unstable; urgency=low + + * Changed dependency from xserver-common to x11-common, closes: + #362089. + + -- Ola Lundqvist Mon, 17 Apr 2006 15:11:31 +0200 + +vnc4 (4.1.1+X4.3.0-4) unstable; urgency=low + + * Applied patch from Chris Donoghue . + This patch is originally from Fedora and contain support for -fPIC + and also tunneling via ssh support. + Closes: #353711, #353563, #353577, #350480. + + -- Ola Lundqvist Sat, 25 Feb 2006 13:03:26 +0100 + +vnc4 (4.1.1+X4.3.0-3) unstable; urgency=low + + * Made vnc.so optional for some architectures as it is only built + on some because of the X build configuration, closes: #352520. + + -- Ola Lundqvist Sun, 19 Feb 2006 15:06:41 +0100 + +vnc4 (4.1.1+X4.3.0-2) unstable; urgency=low + + * Corrected a build issue with gcc4 and 64 bit architectures, closes: + #350480, #350405, #352520. + * Fix for x0vncserver so that it actually work. The reason was that a + timeout variable was not initialized, closes: #352863. + + -- Ola Lundqvist Sun, 19 Feb 2006 11:43:56 +0100 + +vnc4 (4.1.1+X4.3.0-1) unstable; urgency=low + + + * New upstream version of vnc and X11, closes: #335995. + New type of build. + * This new version have updated linux.cf file, closes: #276238. + * Updated build dependency, closes: #346902. Thanks to + Danilo Piazzalunga . + * This version build with gcc4, + closes: #273536, #335160, #332682, #333255, #280103. + * Renamed vnc.so to libvnc.so, closes: #328523, #319366. Thanks to + Martin Stolle for giving this fix. + * Updated standards version to 3.6.2. + * Now provides xserver, closes: #320576. + * Corrected minor doc bug, closes: #300952. + + -- Ola Lundqvist Fri, 27 Jan 2006 18:59:46 +0100 + +vnc4 (4.0-8) unstable; urgency=medium + + * Added alternative for vncconfig, closes: #291591. + * Added menu entry, closes: #288054. + * Modified the vncinstall script so that it chmod files so that root + can modify them. This allow dh_strip to strip them. + + -- Ola Lundqvist Sat, 22 Jan 2005 10:55:33 +0100 + +vnc4 (4.0-7) unstable; urgency=low + + * Changed recommends of xfont-base to xfonts-base. Closes: #285483. + * Maintainer upload of -fPIC patch, closes: #283020. + * Now uses the work vncserver in the package description, closes: #284503. + + -- Ola Lundqvist Sat, 25 Dec 2004 21:33:58 +0100 + +vnc4 (4.0-6.1) unstable; urgency=high + + * Non-maintainer upload. + * High-urgency upload for sarge-targetted RC bugfix. + * Make sure everything that's included in vnc.so is built with -fPIC, + closes: #283020 + + -- Steve Langasek Tue, 14 Dec 2004 04:57:48 -0800 + +vnc4 (4.0-6) unstable; urgency=low + + * Added x dependencies, closes: #282521. + * Closed wrong bug in last upload, closes: #273739. + * Set BuildGlxExt to YES in xc/config/cf/vnc.def, closes: #269765. + * Added patch from Hein Roehrig to add + support for the -localhost option in x0vncserver as well. + + -- Ola Lundqvist Thu, 25 Nov 2004 20:39:21 +0100 + +vnc4 (4.0-5) unstable; urgency=low + + * Changed vncserver start script so it starts x-terminal-emulator and + x-window-manager instead of xterm and twm, closes: #273976. + * Moved in functionality from tightvncserver script. + This means that the options -clean, -fp, -alwaysshared, -nevershared + -httpport and -basehttpport is added. + * Fixed description of vnc4server package, closes: #73739. + + -- Ola Lundqvist Sun, 17 Oct 2004 20:58:47 +0200 + +vnc4 (4.0-4) unstable; urgency=medium + + * Fixed vncpasswd error in prerm of vnc4-common. + * Fixed x0vncserver error in prerm of vnc4server. + * Fixed vncviewer error in prerm of xvncviewer (was pointint at + xrealvncviewer instead xvnc4vewier). + * Added conflict with vnc-common << 3.3.7-6 because of + vncpasswd error there. + + -- Ola Lundqvist Thu, 16 Sep 2004 08:32:12 +0200 + +vnc4 (4.0-3) unstable; urgency=medium + + * Added dependency on vnc-common from vnc4server, closes: #270588. + + -- Ola Lundqvist Sat, 11 Sep 2004 11:59:23 +0200 + +vnc4 (4.0-2) unstable; urgency=medium + + * Now build libraries with -fPIC so vnc.so can be built properly, + closes: #266739. + * Removed tls build dep. Not needed. + + -- Ola Lundqvist Thu, 19 Aug 2004 12:07:12 +0200 + +vnc4 (4.0-1) unstable; urgency=low + + * Initial Release, closes: #250579, #260157. + Used some descriptions from the vnc package. + * This release fix a couple of issues in realvnc version 3. + - Broken on ia64, closes: #233313. + * Added source tar file of XFree86 (X420src-1.tgz). This is needed + in order to build Xvnc and vnc.so. I added this tar-file to the + orig tarball too in the xsrc dir. + + -- Ola Lundqvist Sun, 8 Aug 2004 14:54:54 +0200 --- vnc4-4.1.1+X4.3.0.orig/debian/copyright +++ vnc4-4.1.1+X4.3.0/debian/copyright @@ -0,0 +1,182 @@ +This package was debianized by Ola Lundqvist on +Sun, 8 Aug 2004 14:54:54 +0200. + +It was downloaded from: + http://www.realvnc.com/ + +Copyright: + +Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. + + This software is distributed under the GNU General Public Licence as published + by the Free Software Foundation. See the file LICENCE.TXT (in the source + vnc4 source package) for the conditions under which this software is made + available. VNC also contains code from other sources. See the + Acknowledgements section below, and the individual files for details of the + conditions under which they are made available. + + You should have received a copy of the GNU General Public License with + your Debian GNU system, in /usr/share/common-licenses/GPL, or with the + Debian GNU source package as the file LICENSE.TXT. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + +This distribution contains public domain DES software by Richard Outerbridge. +This is: + + Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge. + (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992. + + +This distribution contains software from the X Window System. This is: + + Copyright 1987, 1988, 1998 The Open Group + + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of The Open Group shall not be + used in advertising or otherwise to promote the sale, use or other dealings + in this Software without prior written authorization from The Open Group. + + + Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Digital not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + + +This distribution contains zlib compression software. This is: + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + +This distribution contains Java DES software by Dave Zimmerman + and Jef Poskanzer . This is: + + Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved. + + Permission to use, copy, modify, and distribute this software and its + documentation for NON-COMMERCIAL or COMMERCIAL purposes and without fee + is hereby granted, provided that this copyright notice is kept intact. + + WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE + LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + + THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE + CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE + PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT + NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE + SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE + SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE + PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET + WORKSHOP SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF + FITNESS FOR HIGH RISK ACTIVITIES. + + Copyright (C) 1996 by Jef Poskanzer . All rights + reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Visit the ACME Labs Java page for up-to-date versions of this and other + fine Java utilities: http://www.acme.com/java/ + +------------------------------------------------------------------------------- + +In addition to this the upstream source of XFree86 version 4.2.0 is included +in order to be able to build the Xvnc and vnc.so binaries. That software has +the following license and copyright information: + +Copyright (C) 1999,2000,2001 Compaq Computer Corporation +Copyright (C) 1999,2000,2001 Hewlett-Packard Company +Copyright (C) 1999,2000,2001 IBM Corporation +Copyright (C) 1999,2000,2001 Hummingbird Communications Ltd. +Copyright (C) 1999,2000,2001 Silicon Graphics, Inc. +Copyright (C) 1999,2000,2001 Sun Microsystems, Inc. +Copyright (C) 1999,2000,2001 The Open Group + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Soft- +ware"), to deal in the Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, provided that the above copyright +notice(s) and this permission notice appear in all copies of the Soft- +ware and that both the above copyright notice(s) and this permission +notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- +ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY