You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tigervnc-cookie.patch 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  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";
  6. unlink($desktopLog);
  7. -# Make an X server cookie - use /dev/urandom on systems that have it,
  8. -# otherwise use perl's random number generator, seeded with the sum
  9. -# of the current time, our PID and part of the encrypted form of the password.
  10. -
  11. -my $cookie = "";
  12. -if (open(URANDOM, '<', '/dev/urandom')) {
  13. - my $randata;
  14. - if (sysread(URANDOM, $randata, 16) == 16) {
  15. - $cookie = unpack 'h*', $randata;
  16. - }
  17. - close(URANDOM);
  18. -}
  19. -if ($cookie eq "") {
  20. - srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
  21. - for (1..16) {
  22. - $cookie .= sprintf("%02x", int(rand(256)) % 256);
  23. - }
  24. -}
  25. -
  26. -system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
  27. -system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie");
  28. +# Make an X server cookie - use mcookie
  29. +$cookie = `/usr/bin/mcookie`;
  30. +open (XAUTH, "|xauth -f $xauthorityFile source -");
  31. +print XAUTH "add $host:$displayNumber . $cookie\n";
  32. +print XAUTH "add $host/unix:$displayNumber . $cookie\n";
  33. +close XAUTH;
  34. if ($opt{'-name'}) {
  35. $desktopName = $opt{'-name'};