Did crawl through the code and kind of figured out how it is supposed to work.
Turns out rfbport was passed through as misc option and not used in the wrapper 
at all.

Attached a debdiff Patch for tigervncserver to include rfbport.
Not a Perl programmer mind you...

Hopefully the attachment works, never tried this from shell before.
--------------------------------------------------------------------------------------------------------------------------------------------
 Philipp Wolski - KISTERS AG - Stau 75 - 26122 Oldenburg - Germany
Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns Kisters | 
Aufsichtsratsvorsitzender: Dr. Thomas Klevers
Phone: +49 441 93602 -158 | Fax: +49 441 93602 -222 | E-Mail: 
philipp.wol...@kisters.de | WWW: http://www.kisters.de
--------------------------------------------------------------------------------------------------------------------------------------------
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet. 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorised 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
diff -Nru tigervnc-1.7.0+dfsg/debian/changelog tigervnc-1.7.0+dfsg/debian/changelog
--- tigervnc-1.7.0+dfsg/debian/changelog	2017-04-09 16:38:13.000000000 +0200
+++ tigervnc-1.7.0+dfsg/debian/changelog	2017-07-14 15:38:26.000000000 +0200
@@ -1,3 +1,12 @@
+tigervnc (1.7.0+dfsg-8) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Added rfbport to supported commandline arguments for
+    tightvncserver wrapper (closes: #867175)
+
+ -- Philipp Wolski <philipp.wol...@kisters.de>  Fri, 14 Jul 2017 15:38:26 +0200
+
 tigervnc (1.7.0+dfsg-7) unstable; urgency=high
 
   [ Joachim Falk ]
diff -Nru tigervnc-1.7.0+dfsg/debian/helpers/usr/bin/tigervncserver tigervnc-1.7.0+dfsg/debian/helpers/usr/bin/tigervncserver
--- tigervnc-1.7.0+dfsg/debian/helpers/usr/bin/tigervncserver	2017-04-09 16:38:13.000000000 +0200
+++ tigervnc-1.7.0+dfsg/debian/helpers/usr/bin/tigervncserver	2017-07-14 15:26:40.000000000 +0200
@@ -691,7 +691,11 @@
   my $vncPort    = 5900 + $options->{'displayNumber'};
   my $desktopLog = &desktopLog($options);
   my $pidFile    = &pidFile($options);
-  
+ 
+  if ($options->{'rfbport'}) {
+    $vncPort = $options->{'rfbport'};
+  } 
+
   # Make sure the user has a password if required.
   &CreateVNCPasswd($options);
   # Make sure the user has a x509 certificate if required.
@@ -791,7 +795,7 @@
   {
     my $i = 300;
     for (; $i >= 0; $i = $i-1) {
-      last if &checkTCPPortUsed(5900 + $options->{'displayNumber'});
+      last if &checkTCPPortUsed($vncPort);
       if ($xvncServerPid == waitpid($xvncServerPid, WNOHANG)) { $i = -2; last; }
       usleep 100000;
     }
@@ -947,6 +951,7 @@
     $prefix."[-xdisplaydefaults]    Get geometry and pixelformat from running X\n".
     $prefix."[-wmDecoration <dim>]  Shrink geometry from xdisplaydefaults by dim\n".
     $prefix."[-localhost yes|no]    Only accept VNC connections from localhost\n".
+    $prefix."[-rfbport port]        TCP port to listen for RFB protocol\n".
     $prefix."[-httpPort     port]   Port of internal http server\n".
     $prefix."[-baseHttpPort port]   Calculate http port from base port + display nr\n".
     $prefix."[-fg]                  No daemonization and\n".
@@ -1039,6 +1044,7 @@
       pixelformat		=> undef,
       getDefaultFrom		=> undef,
       rfbwait			=> 30000,
+      rfbport			=> undef,
       localhost			=> undef,
       SecurityTypes		=>
         undef, # later derived depening on localhost setting
@@ -1213,6 +1219,7 @@
       'X509Key=s'	  => \$opts{'X509Key'},
       'X509Cert=s'	  => \$opts{'X509Cert'},
       'I-KNOW-THIS-IS-INSECURE' => \$options->{'I-KNOW-THIS-IS-INSECURE'},
+      'rfbport=i'         => \$options->{'rfbport'},
     );
     
     &usage(!$rc) if (!$rc || $opts{'help'});
@@ -1265,6 +1272,7 @@
         push @cmd, "-xstartup", $opts{'vncStartup'} if !$opts{'noxstartup'} && defined $opts{'vncStartup'};
         push @cmd, "-autokill" if $opts{'autokill'};
         push @cmd, "-httpPort", $options->{'httpPort'} if ($options->{'httpPort'});
+        push @cmd, "-rfbport", $options->{'rfbport'} if ($options->{'rfbport'});
         push @cmd, "-baseHttpPort", $options->{'baseHttpPort'} if ($options->{'baseHttpPort'});
         push @cmd, "-localhost", $options->{'localhost'} if defined $options->{'localhost'};
         push @cmd, "-useold" if $opts{'useold'};

Reply via email to