Package: tightvncserver
Version: 1.3.9-4
Severity: important
Tags: patch kfreebsd

When trying to run tightvncserver on my GNU/kFreeBSD box, I got
"tightvncserver: no free display number".  It was unable to bind to any port
due to an invalid argument to bind. I patched the perl script to use
sockaddr_in() instead of pack(), and it now works for me.

Please note that I am not familiar with perl, so I can not comment on any other
side-effects this change could bring. It should be quite easy to review,
though, since I only touched two lines of code (patch below).

-- System Information:
Debian Release: lenny/sid
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 6.3-1-486
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages tightvncserver depends on:
ii  libc0.1                2.7-13            GNU C Library: Shared libraries
ii  libjpeg62              6b-14             The Independent JPEG Group's JPEG
ii  libx11-6               2:1.1.5-1         X11 client-side library
ii  libxext6               2:1.0.4-1         X11 miscellaneous extension librar
ii  perl                   5.10.0-14         Larry Wall's Practical Extraction
ii  x11-common             1:7.3+17          X Window System (X.Org) infrastruc
ii  xbase-clients          1:7.3+17          miscellaneous X clients - metapack
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

Versions of packages tightvncserver recommends:
ii  xfonts-base                   1:1.0.0-5  standard fonts for X

Versions of packages tightvncserver suggests:
pn  tightvnc-java                 <none>     (no description available)

-- no debconf information

--- tightvnc-1.3.9/vncserver    2008-09-27 18:37:41.000000000 -0500
+++ tightvnc-1.3.9.working/vncserver    2008-09-27 18:37:24.000000000 -0500
@@ -453,7 +453,7 @@

     socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
     eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
-    unless (bind(S, pack('S n x12', $AF_INET, 6000 + $n))) {
+    unless (bind(S, sockaddr_in(6000 + $n, &INADDR_ANY))) {
        close(S);
        return 0;
     }
@@ -461,7 +461,7 @@

     socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
     eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
-    unless (bind(S, pack('S n x12', $AF_INET, 5900 + $n))) {
+    unless (bind(S, sockaddr_in(5900 + $n, &INADDR_ANY))) {
        close(S);
        return 0;
     }



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to