1 diff -up tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie tigervnc-1.0.90-20091221svn3929/unix/vncserver
2 --- tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie 2009-11-12 11:39:54.000000000 +0100
3 +++ tigervnc-1.0.90-20091221svn3929/unix/vncserver 2009-12-21 16:15:01.907799091 +0100
4 @@ -189,27 +189,12 @@ $vncPort = 5900 + $displayNumber;
5 $desktopLog = "$vncUserDir/$host:$displayNumber.log";
8 -# Make an X server cookie - use /dev/urandom on systems that have it,
9 -# otherwise use perl's random number generator, seeded with the sum
10 -# of the current time, our PID and part of the encrypted form of the password.
13 -if (open(URANDOM, '<', '/dev/urandom')) {
15 - if (sysread(URANDOM, $randata, 16) == 16) {
16 - $cookie = unpack 'h*', $randata;
21 - srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
23 - $cookie .= sprintf("%02x", int(rand(256)) % 256);
27 -system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
28 -system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie");
29 +# Make an X server cookie - use mcookie
30 +$cookie = `/usr/bin/mcookie`;
31 +open (XAUTH, "|xauth -f $xauthorityFile source -");
32 +print XAUTH "add $host:$displayNumber . $cookie\n";
33 +print XAUTH "add $host/unix:$displayNumber . $cookie\n";
37 $desktopName = $opt{'-name'};