File vncserver.patch of Package tightvnc

--- vncserver
+++ vncserver
@@ -36,9 +36,9 @@
 $geometry = "1024x768";
 $depth = 24;
 $desktopName = "X";
-$vncClasses = "/usr/local/vnc/classes";
+$vncClasses = "/usr/share/vnc/classes";
 $vncUserDir = "$ENV{HOME}/.vnc";
-$fontPath = "unix/:7100";
+$fontPath = "/usr/share/fonts/misc:unscaled,/usr/share/fonts/local,/usr/share/fonts/75dpi:unscaled,/usr/share/fonts/100dpi:unscaled,/usr/share/fonts/Type1,/usr/share/fonts/URW,/usr/share/fonts/Speedo,/usr/share/fonts/truetype,/usr/share/fonts/uni,/usr/share/fonts/CID";
 $authType = "-rfbauth $vncUserDir/passwd";
 
 # Here is another example of setting the font path:
@@ -90,7 +90,7 @@
 
 # Uncomment this line if you want default geometry, depth and pixelformat
 # to match the current X display:
-# &GetXDisplayDefaults();
+&GetXDisplayDefaults();
 
 if ($opt{'-geometry'}) {
     $geometry = $opt{'-geometry'};
@@ -158,11 +158,7 @@
 # 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)));
-}
+$cookie = `mcookie`;
 
 system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
 system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); 
@@ -237,6 +233,8 @@
 }
 $ENV{VNCDESKTOP}= $desktopName;
 
+delete @ENV{qw(SESSION_MANAGER)};
+
 system("$xstartup >> " . &quotedString($desktopLog) . " 2>&1 &");
 
 exit;
@@ -284,7 +282,7 @@
 
 sub GetDisplayNumber
 {
-    foreach $n (1..99) {
+    for ($n = 1; $n < 100; $n++) {
 	if (&CheckDisplayNumber($n)) {
 	    return $n+0; # Bruce Mah's workaround for bug in perl 5.005_02
 	}
openSUSE Build Service is sponsored by