Thanks. I'll try to add this one.

Inguza Technology AB
Sent from a phone
Den 5 maj 2014 15:30 skrev "Beat Vontobel" <b.vonto...@meteonews.ch>:

> Hi Ola, hi Markus,
>
> just found this bug report after hitting the same problem and writing
> a patch.
>
> > Then my conclusion is that this is a wishlist bug.  Rather easy to
> > fix, but still not something that is stated that it should work.
>
> Actually, I agree more with Markus and do not think it's just
> wishlist, but a real bug:
>
> As Markus says, vnc4server's man page clearly states that all unknown
> options are passed on to Xvnc4 and references that man page, which
> documents both -SecurityTypes as well as -rfbauth (which produces the
> same bug) as options, both unknown to vnc4server.
>
> So they should be passed on and work correctly (otherwise there's no
> way of running a passwordless server, as e.g. helpful if you only
> allow connections through an ssh tunnel and authenticate there).
>
> Unfortunately, an -rfbauth is hardcoded into vnc4server (without being
> mentioned in the docs). This conflicts with both -SecurityTypes as
> well as the manual use of -rfbauth to vnc4server.
>
> > If you can provide a patch I will include that one in next upload.
>
> I had to fix it for me anyway. So here is one. Not really tested. :)
> It just worked for me. The idea is...
>
>  * to work exactly as before without any of the two options.
>
>  * If -rfbauth is given use the explicitly requested file instead
>    of the default ~/.vnc/passwd.
>
>  * If -SecurityTypes None is given ignore -rfbauth completely (both
>    the default and a manual option).
>
> See below.
>
> Cheers,
> Beat
>
>
>
> --- vnc4server.orig     2012-02-05 20:01:12.000000000 +0000
> +++ vnc4server  2014-05-05 12:55:30.117011996 +0000
> @@ -122,6 +122,7 @@
>               "-help",0,"-h",0,"--help",0,
>               "-clean",0, "-fp",1,
>               "-alwaysshared",0, "-nevershared",0,
> +              "-rfbauth",1,"-SecurityTypes",1,
>               "-httpport",1,"-basehttpport",1);
>
>  &Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
> @@ -186,12 +187,20 @@
>
>  # 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 $vncUserDir/passwd");
> -    if (($? >> 8) != 0) {
> -       exit 1;
> +unless ($opt{'-SecurityTypes'} eq "None") {
> +    if ($opt{'-rfbauth'}) {
> +        $rfbAuthFile = $opt{'-rfbauth'};
> +    } else {
> +        $rfbAuthFile = "$vncUserDir/passwd";
> +    }
> +
> +    ($z,$z,$mode) = stat($rfbAuthFile);
> +    if (!(-e $rfbAuthFile) || ($mode & 077)) {
> +        warn "\nYou will require a password to access your desktops.\n\n";
> +        system("vncpasswd " . &quotedString($rfbAuthFile));
> +        if (($? >> 8) != 0) {
> +            exit 1;
> +        }
>      }
>  }
>
> @@ -257,7 +266,8 @@
>  $cmd .= " -depth $depth" if ($depth);
>  $cmd .= " -pixelformat $pixelformat" if ($pixelformat);
>  $cmd .= " -rfbwait 30000";
> -$cmd .= " -rfbauth $vncUserDir/passwd";
> +$cmd .= " -rfbauth " . &quotedString($rfbAuthFile) if ($rfbAuthFile);
> +$cmd .= " -SecurityTypes $opt{'-SecurityTypes'}" if
> ($opt{'-SecurityTypes'});
>  $cmd .= " -rfbport $vncPort";
>  $cmd .= " -pn";
>
>

Reply via email to