[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#514310: marked as done (vncsnapshot: argument parsing (-tunnel) broken)

Your message dated Sun, 15 Nov 2009 15:39:11 +0000
with message-id <E1N9hC3-000672-DY@ries.debian.org>
and subject line Bug#514310: fixed in vncsnapshot 1.2a-5
has caused the Debian Bug report #514310,
regarding vncsnapshot: argument parsing (-tunnel) broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

514310: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514310
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: vncsnapshot
Version: 1.2a-1+b1
Severity: normal

Took some playing around with ltrace to catch this, but

  vncsnapshot -tunnel ${host}:3 /tmp/${host}.03.jpg

gives a Usage message which includes

> Usage: vncsnapshot [<OPTIONS>] [<HOST>]:<DISPLAY#> filename
>        vncsnapshot [<OPTIONS>] -listen [<DISPLAY#>] filename
>        vncsnapshot [<OPTIONS>] -tunnel <HOST>:<DISPLAY#> filename
>        vncsnapshot [<OPTIONS>] -via <GATEWAY> [<HOST>]:<DISPLAY#> filename

Turns out -tunnel (tunnel.c, processTunnelArgs) looks at the *last*
argument for host:port:

  pdisplay = strchr(argv[*pargc - 1], ':');

rather than tunnelArgIndex.  This would suggest

  vncsnapshot -tunnel /tmp/${host}.03.jpg ${host}:3 

which in fact gets around the argument parsing, and prompts for a
password, and then fails with:

  Couldn't convert '/tmp/${host}.03.jpg' to host address
  Unable to connect to VNC server

Anyway, here's a patch (with debugging noise left in) that makes
vncsnapshot -tunnel work.  -via is probably broken too, I haven't
tried it yet.  The key bits are
  * actually *use* tunnelArgIndex
  * use localhost::port so it doesn't add 5900 to it again

(It looks like upstream hasn't been touched since 2004, so getting
 this fixed in debian directly would probably be worthwhile.)

--- vncsnapshot-1.2a.orig/tunnel.c
+++ vncsnapshot-1.2a/tunnel.c
@@ -106,6 +106,8 @@
   if (!runCommand(cmd))
     return False;
+  fprintf(stderr, "Successfully runCommand(%s)\n", cmd);
   return True;
@@ -115,11 +117,16 @@
   char *pdisplay;
+  fprintf(stderr, "processTunnelArgs:");
+  showArgs(*pargc, argv);
   if (tunnelArgIndex >= *pargc - 1)
-  pdisplay = strchr(argv[*pargc - 1], ':');
-  if (pdisplay == NULL || pdisplay == argv[*pargc - 1])
+  fprintf(stderr, "tAI=%d: %s\n", tunnelArgIndex, argv[tunnelArgIndex]);
+  fprintf(stderr, "tAI+1: %s\n", argv[tunnelArgIndex+1]);
+  pdisplay = strchr(argv[tunnelArgIndex + 1], ':');
+  if (pdisplay == NULL || pdisplay == argv[tunnelArgIndex + 1])
   *pdisplay++ = '\0';
@@ -130,12 +137,15 @@
   if (*remotePort < 100)
     *remotePort += SERVER_PORT_OFFSET;
-  sprintf(lastArgv, "localhost:%d", localPort);
+  sprintf(lastArgv, "localhost::%d", localPort); /* see argsresources.c, GetArgsAndResources, Two colons comment */
-  *remoteHost = argv[*pargc - 1];
-  argv[*pargc - 1] = lastArgv;
+  *remoteHost = argv[tunnelArgIndex + 1];
+  argv[tunnelArgIndex + 1] = lastArgv;
   removeArgs(pargc, argv, tunnelArgIndex, 1);
+  showArgs(*pargc, argv);
 static void
--- vncsnapshot-1.2a.orig/argsresources.c
+++ vncsnapshot-1.2a/argsresources.c
@@ -337,3 +337,10 @@
     *((Bool *)arg) = value;
     return 1;
+void showArgs(int argc, char** argv) {
+  int i;
+  for (i=0; i<argc; i++) {
+    fprintf(stderr, "\tARGV[%d]=%s\n", i, argv[i]);
+  }

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages vncsnapshot depends on:
ii  libc6                  2.3.6.ds1-13etch8 GNU C Library: Shared libraries
ii  libgcc1                1:4.1.1-21        GCC support library
ii  libjpeg62              6b-13             The Independent JPEG Group's JPEG 
ii  libstdc++6             4.1.1-21          The GNU Standard C++ Library v3
ii  vnc-common             3.3.7-14          Virtual network computing server s
ii  zlib1g                 1:1.2.3-13        compression library - runtime

vncsnapshot recommends no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: vncsnapshot
Source-Version: 1.2a-5

We believe that the bug you reported is fixed in the latest version of
vncsnapshot, which is due to be installed in the Debian FTP archive:

  to main/v/vncsnapshot/vncsnapshot_1.2a-5.diff.gz
  to main/v/vncsnapshot/vncsnapshot_1.2a-5.dsc
  to main/v/vncsnapshot/vncsnapshot_1.2a-5_i386.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 514310@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Benoit Mortier <benoit.mortier@opensides.be> (supplier of updated vncsnapshot package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)

Hash: SHA1

Format: 1.8
Date: Fri, 13 Nov 2009 19:08:53 +0100
Source: vncsnapshot
Binary: vncsnapshot
Architecture: source i386
Version: 1.2a-5
Distribution: unstable
Urgency: low
Maintainer: Benoit Mortier <benoit.mortier@opensides.be>
Changed-By: Benoit Mortier <benoit.mortier@opensides.be>
 vncsnapshot - A utility that takes JPEG snapshots from VNC servers
Closes: 483484 514310 536181
 vncsnapshot (1.2a-5) unstable; urgency=low
   * New maintainer (Closes: #483484)
   * cannot capture vnc screen on amd64 (Closes: #536181)
   * argument parsing (-tunnel) broken (Closes: #514310)
 51baeea4692a90bfd52359d77c5ed3216c761d11 1128 vncsnapshot_1.2a-5.dsc
 f6d2fc6b4f288c379a0e58d3ed618e55928198d2 3386 vncsnapshot_1.2a-5.diff.gz
 1e181ca2b028edbbaee8e244cd0b9c7345fcbb0b 39786 vncsnapshot_1.2a-5_i386.deb
 e328e408a0c0c22835b785fd66cfe2e9b26cfb1f66dfdbd53efb87c9adb5f920 1128 vncsnapshot_1.2a-5.dsc
 ec2a2540db37c142ab7e5532688e0d0954762dbba5fa2cbe5182f3577a8eef95 3386 vncsnapshot_1.2a-5.diff.gz
 0d952095192e1766fd23b931fa6b92d4df4614425daedea3674430cb677e8a0a 39786 vncsnapshot_1.2a-5_i386.deb
 8c8422b471dd6f2f31bf1f10b575fb8a 1128 x11 optional vncsnapshot_1.2a-5.dsc
 25cf030c483b7da1127e1dc4fbab6aa5 3386 x11 optional vncsnapshot_1.2a-5.diff.gz
 b84916d97675af8dced91de5b04a8be7 39786 x11 optional vncsnapshot_1.2a-5_i386.deb

Version: GnuPG v1.4.10 (GNU/Linux)


--- End Message ---

Reply to: